Skip to content

[Bug]: locator parser does not support within() and getByRef() added in v1.64 #43159

Closed

Description

Version

main (1.65.0-next, 6936b23)

Steps to reproduce

unsafeLocatorOrSelectorAsSelector('javascript',
  "getByRole('cell').nth(2).within(getByRole('row'))");
// throws: Unsupported locator method within

unsafeLocatorOrSelectorAsSelector('javascript', "getByRef('e5')");
// throws: Unsupported locator method getByRef

Pasting the example from the Locator.within docs into the trace viewer / inspector locator box doesn't resolve.

Expected behavior

a.within(b) parses to the same selector the client produces (b >> internal:chain="a"), and getByRef('e5') parses to aria-ref=e5, in all four languages (within/Within, get_by_ref/GetByRef).

Actual behavior

Both throw "Unsupported locator method" (the method tables in packages/isomorphic/locatorParser.ts don't include them).

Additional context

APIs added in #42887 (Locator.within) and #43055 (Page.getByRef).

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