Skip to content

[Regression]: locator parser rejects checked: 'mixed' / pressed: 'mixed' produced by asLocator #43158

Closed

Description

Last Good Version

1.63 (before d6a10f6)

First Bad Version

main since d6a10f6 (1.65.0-next)

Steps to reproduce

const loc = asLocator('javascript', 'internal:role=checkbox[checked=mixed]');
// => getByRole('checkbox', { checked: 'mixed' })
unsafeLocatorOrSelectorAsSelector('javascript', loc);
// throws: Unexpected checked option for getByRole

Same for python (checked="mixed"), java (setChecked("mixed")) and csharp (Checked = "mixed"), and for pressed.

Expected behavior

Round-trips to internal:role=checkbox[checked=mixed], as it did before d6a10f6 (the role engine supports mixed for checked and pressed).

Actual behavior

getByRoleParts validates every non-name option with isBoolean, so the string 'mixed' is rejected.

Additional context

Regression from #42895 (d6a10f6). Verified by running old vs. new locatorParser.ts side by side on the same inputs.

Environment

Playwright main @ 6936b230a (1.65.0-next). Found by code review of recent commits; not OS/browser specific.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions