• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

playwright-community / playwright-go / 28255612039

26 Jun 2026 05:51PM UTC coverage: 78.993% (+0.1%) from 78.892%
28255612039

Pull #617

github

mxschmitt
chore(skill): make PR creation + drive-CI-to-green an autonomous closing loop

Step 10 now creates the PR (gh pr create) once local checks pass, without
waiting to be asked. Step 11 is an explicit loop: gh run watch --exit-status ->
read each failure's --log-failed -> triage (my code / engine-OS-specific /
behavior change) -> fix -> re-push, repeat until gh pr checks shows 0 fail.
Reconcile 'When to ask': work autonomously through PR + CI, but never merge.
Pull Request #617: chore: roll to Playwright v1.61.1

144 of 171 new or added lines in 12 files covered. (84.21%)

4 existing lines in 2 files now uncovered.

8750 of 11077 relevant lines covered (78.99%)

7071.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

51.72
/errors.go
1
package playwright
2

3
import (
4
        "errors"
5
        "fmt"
6
)
7

8
var (
9
        // ErrPlaywright wraps all Playwright errors.
10
        //   - Use errors.Is to check if the error is a Playwright error.
11
        //   - Use errors.As to cast an error to [Error] if you want to access "Stack".
12
        ErrPlaywright = errors.New("playwright")
13
        // ErrTargetClosed usually wraps a reason.
14
        ErrTargetClosed = errors.New("target closed")
15
        // ErrTimeout wraps timeout errors. It can be either Playwright TimeoutError or client timeout.
16
        ErrTimeout = errors.New("timeout")
17
)
18

19
// Error represents a Playwright error
20
type Error struct {
21
        Name    string `json:"name"`
22
        Message string `json:"message"`
23
        Stack   string `json:"stack"`
24
}
25

26
func (e *Error) Error() string {
1,302✔
27
        return e.Message
1,302✔
28
}
1,302✔
29

30
func (e *Error) Is(target error) bool {
×
31
        err, ok := target.(*Error)
×
32
        if !ok {
×
33
                return false
×
34
        }
×
35
        if err.Name != e.Name {
×
36
                return false
×
37
        }
×
38
        if e.Name != "Error" {
×
39
                return true // same name and not normal error
×
40
        }
×
41
        return e.Message == err.Message
×
42
}
43

44
func parseError(err Error) error {
1,302✔
45
        switch err.Name {
1,302✔
46
        case "TimeoutError":
108✔
47
                return fmt.Errorf("%w: %w: %w", ErrPlaywright, ErrTimeout, &err)
108✔
48
        case "TargetClosedError":
274✔
49
                return fmt.Errorf("%w: %w: %w", ErrPlaywright, ErrTargetClosed, &err)
274✔
50
        }
51
        return fmt.Errorf("%w: %w", ErrPlaywright, &err)
920✔
52
}
53

54
func targetClosedError(reason *string) error {
6,529✔
55
        if reason == nil {
13,049✔
56
                return ErrTargetClosed
6,520✔
57
        }
6,520✔
58
        return fmt.Errorf("%w: %s", ErrTargetClosed, *reason)
9✔
59
}
60

61
// errorWithDetails wraps a server error that also carries structured
62
// errorDetails and a call log. Since v1.61 assertion `expect` failures are
63
// reported this way instead of as a `{ matches: false }` result;
64
// locatorImpl.expect unwraps it via errors.As to rebuild the expect result.
65
type errorWithDetails struct {
66
        err     error
67
        details map[string]any
68
        log     []string
69
}
70

NEW
71
func (e *errorWithDetails) Error() string { return e.err.Error() }
×
72

NEW
73
func (e *errorWithDetails) Unwrap() error { return e.err }
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc