From 5d10fbd3d802b765c9abc4fb5ab4366eb3357246 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 7 Dec 2021 13:48:36 -0800 Subject: [PATCH] chore: add more playwright.locator mentions (#10763) --- docs/src/debug.md | 1 + docs/src/inspector.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/src/debug.md b/docs/src/debug.md index 24b1fcb0f3..cbe77a1dfc 100644 --- a/docs/src/debug.md +++ b/docs/src/debug.md @@ -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. diff --git a/docs/src/inspector.md b/docs/src/inspector.md index 3c8e4cceaf..a76f4b52f3 100644 --- a/docs/src/inspector.md +++ b/docs/src/inspector.md @@ -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.