playwright/packages/playwright-core/src/utils/isomorphic
Dmitry Gozman 97d55e275d
fix(locator): locator(locator) method uses internal:chain instead of >> (#24235)
Usually, we can just chain two locators with `>>` to implement
`Locator.locator(locator)`. However, this does not play nicely with more
advanced inner locators like `or` and `and`:

```ts
const child = page.locator('input').or(page.locator('button'));
page.locator('parent').locator(child);
```

One would expect the above to locate "input or button" inside a
"parent". However, currently it locates "input inside a parent" or
"button", because it's translated to `parent >> input >>
internal:or="button"`.

To fix this, we have to wrap inner locator into `internal:chain` and
query it separately from the parent.

Fixes #23724.
2023-07-14 12:21:45 -07:00
..
cssParser.ts fix(css): relative-to-scope selectors work (#23665) 2023-06-13 10:27:25 -07:00
cssTokenizer.ts chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
locatorGenerators.ts fix(locator): locator(locator) method uses internal:chain instead of >> (#24235) 2023-07-14 12:21:45 -07:00
locatorParser.ts fix(locator): locator(locator) method uses internal:chain instead of >> (#24235) 2023-07-14 12:21:45 -07:00
locatorUtils.ts fix(locators): escape >> inside a regular expression (#23631) 2023-06-12 10:34:37 -07:00
selectorParser.ts fix(locator): locator(locator) method uses internal:chain instead of >> (#24235) 2023-07-14 12:21:45 -07:00
stringUtils.ts fix(locators): escape >> inside a regular expression (#23631) 2023-06-12 10:34:37 -07:00
traceUtils.ts chore: introduce testInfo.testId (#21670) 2023-03-14 15:58:55 -07:00