You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: locator.toString() and call logs render regexes with u/s/y/d/v flags as string literals #42814
Matching itself is correct; only the rendered locator is wrong. The same string shows up in timeout call logs (waiting for getByText('/nope/u')), the trace viewer and UI mode "pick locator", the HTML report, and codegen output. Pasting the shown locator back into a test matches the literal text /foo/u instead of the regex.
Additional context
detectExact in packages/isomorphic/locatorGenerators.ts recognises a regex with /^\/(.*)\/([igm]*)$/, while the selector parser accepts [dgimsuvy] and escapeRegexForSelector emits whatever flags the user wrote. For internal:text=/foo/u the match fails, so the body falls through and is quoted as a string. internal:role and internal:attr go through parseAttributeSelector and are unaffected.
The u flag is common with non-ASCII patterns, and s with multi-line text.
Activity