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

mxschmitt / playwright-go / 31999171077
80%

Build:
DEFAULT BRANCH: main
Ran 17 Aug 2026 05:57AM UTC
Jobs 9
Files 62
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Aug 2026 05:47AM UTC coverage: 79.568% (-0.1%) from 79.672%
31999171077

push

github

web-flow
fix: report invalid GetBy*/HasText argument types instead of panicking (#637)

The GetBy* text parameters are `any` because Go has no string|RegExp union, but
the selector helpers assumed anything that was not a regexp was a string:

    func escapeForTextSelector(text any, exact bool) string {
        switch text := text.(type) {
        case *regexp.Regexp:
            return escapeRegexForSelector(text)
        default:
            ...escapeText(text.(string))   // unchecked

so page.GetByText(42) crashed with

    panic: interface conversion: interface {} is int, not string

This affects GetByText, GetByLabel, GetByPlaceholder, GetByAltText, GetByTitle
and GetByTestId on Page, Frame, Locator and FrameLocator, plus GetByRole's
Name/Description options and the HasText/HasNotText locator options, which run
through the same two helpers.

Upstream types these parameters `string | RegExp` and lets the compiler reject
anything else — escapeForTextSelector there is simply
`if (typeof text !== 'string') return escapeRegexForSelector(text)`
(packages/isomorphic/stringUtils.ts). Go gets no such guarantee at the call
site, so the check has to happen at runtime.

Make both escape helpers (and the getBy*Selector helpers above them) return an
error, and have each GetBy* return a Locator carrying it. That matches how the
package already reports a bad Locator() parameter — via Locator.Err() and from
every action on the locator — and how Fetch, NewCDPSession, Clock and
convertInputFiles already report unsupported argument types, naming the type
they got.

newLocator folds HasText/HasNotText failures into the locator's existing err,
alongside the ErrLocatorNotSameFrame handling that was already there.


Claude-Session: https://claude.ai/code/session_01Hr35MBUfsUG9DnxhBgBcZW

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

165 of 225 new or added lines in 5 files covered. (73.33%)

9249 of 11624 relevant lines covered (79.57%)

13864.75 hits per line

Uncovered Changes

Lines Coverage ∆ File
31
79.63
-1.78% frame.go
15
63.33
-2.22% frame_locator.go
12
64.28
0.62% locator.go
2
78.94
0.34% page.go
Jobs
ID Job ID Ran Files Coverage
1 macos-latest-webkit - 31999171077.1 17 Aug 2026 06:53AM UTC 62
14.16
GitHub Action Run
2 windows-latest-firefox - 31999171077.2 17 Aug 2026 06:01AM UTC 62
77.97
GitHub Action Run
3 ubuntu-latest-chromium - 31999171077.3 17 Aug 2026 06:04AM UTC 62
79.29
GitHub Action Run
4 windows-latest-webkit - 31999171077.4 17 Aug 2026 05:58AM UTC 62
77.9
GitHub Action Run
5 windows-latest-chromium - 31999171077.5 17 Aug 2026 06:00AM UTC 62
79.24
GitHub Action Run
6 macos-latest-chromium - 31999171077.6 17 Aug 2026 06:42AM UTC 62
79.26
GitHub Action Run
7 ubuntu-latest-webkit - 31999171077.7 17 Aug 2026 05:57AM UTC 62
77.85
GitHub Action Run
8 ubuntu-latest-firefox - 31999171077.8 17 Aug 2026 05:59AM UTC 62
77.99
GitHub Action Run
9 macos-latest-firefox - 31999171077.9 17 Aug 2026 06:46AM UTC 62
77.99
GitHub Action Run
Source Files on build 31999171077
  • Tree
  • List 62
  • Changed 22
  • Source Changed 0
  • Coverage Changed 22
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5a3e1e9c on github
  • Prev Build on main (#31998086465)
  • Next Build on main (#31999264115)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc