chore: add more playwright.locator mentions (#10763)

This commit is contained in:
Pavel Feldman 2021-12-07 13:48:36 -08:00 committed by GitHub
parent 4e344724f9
commit 5d10fbd3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -166,6 +166,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai
* `playwright.$$(selector)`: Highlight all occurrences of the selector. This reflects
how `page.$$` would see the page.
* `playwright.inspect(selector)`: Inspect the selector in the Elements panel.
* `playwright.locator(selector)`: Highlight the first occurrence of the locator.
* `playwright.clear()`: Clear existing highlights.
* `playwright.selector(element)`: Generate a selector that points to the element.

View File

@ -183,6 +183,18 @@ Reveal element in the Elements panel (if DevTools of the respective browser supp
> playwright.inspect('text=Log in')
```
#### playwright.locator(selector)
Query Playwright element using the actual Playwright query engine, for example:
```js
> playwright.locator('.auth-form').withText('Log in');
> Locator ()
> - element: button
> - elements: [button]
```
#### playwright.selector(element)
Generates selector for the given element.