From 89a65bb9a9e6777008dcf60edb56274f215bd9cd Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 10:13:11 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (27-01-26) --- dotnet/docs/other-locators.mdx | 79 ----- dotnet/docs/release-notes.mdx | 4 +- java/docs/other-locators.mdx | 79 ----- java/docs/release-notes.mdx | 4 +- nodejs/docs/accessibility-testing.mdx | 1 + nodejs/docs/actionability.mdx | 1 + nodejs/docs/api-testing.mdx | 1 + nodejs/docs/api/class-android.mdx | 1 + nodejs/docs/api/class-androiddevice.mdx | 1 + nodejs/docs/api/class-androidinput.mdx | 1 + nodejs/docs/api/class-androidsocket.mdx | 1 + nodejs/docs/api/class-androidwebview.mdx | 1 + nodejs/docs/api/class-apirequest.mdx | 1 + nodejs/docs/api/class-apirequestcontext.mdx | 1 + nodejs/docs/api/class-apiresponse.mdx | 1 + .../docs/api/class-apiresponseassertions.mdx | 1 + nodejs/docs/api/class-browser.mdx | 1 + nodejs/docs/api/class-browsercontext.mdx | 1 + nodejs/docs/api/class-browserserver.mdx | 1 + nodejs/docs/api/class-browsertype.mdx | 1 + nodejs/docs/api/class-cdpsession.mdx | 1 + nodejs/docs/api/class-clock.mdx | 1 + nodejs/docs/api/class-consolemessage.mdx | 1 + nodejs/docs/api/class-coverage.mdx | 1 + nodejs/docs/api/class-dialog.mdx | 1 + nodejs/docs/api/class-download.mdx | 1 + nodejs/docs/api/class-electron.mdx | 1 + nodejs/docs/api/class-electronapplication.mdx | 1 + nodejs/docs/api/class-elementhandle.mdx | 1 + nodejs/docs/api/class-filechooser.mdx | 1 + nodejs/docs/api/class-fixtures.mdx | 16 + nodejs/docs/api/class-frame.mdx | 1 + nodejs/docs/api/class-framelocator.mdx | 1 + nodejs/docs/api/class-fullconfig.mdx | 21 ++ nodejs/docs/api/class-fullproject.mdx | 18 + nodejs/docs/api/class-genericassertions.mdx | 1 + nodejs/docs/api/class-jshandle.mdx | 1 + nodejs/docs/api/class-keyboard.mdx | 1 + nodejs/docs/api/class-location.mdx | 1 + nodejs/docs/api/class-locator.mdx | 1 + nodejs/docs/api/class-locatorassertions.mdx | 1 + nodejs/docs/api/class-logger.mdx | 1 + nodejs/docs/api/class-mouse.mdx | 1 + nodejs/docs/api/class-page.mdx | 67 ++++ nodejs/docs/api/class-pageagent.mdx | 335 ++++++++++++++++++ nodejs/docs/api/class-pageassertions.mdx | 1 + nodejs/docs/api/class-playwright.mdx | 1 + .../docs/api/class-playwrightassertions.mdx | 1 + nodejs/docs/api/class-reporter.mdx | 1 + nodejs/docs/api/class-request.mdx | 1 + nodejs/docs/api/class-response.mdx | 1 + nodejs/docs/api/class-route.mdx | 1 + nodejs/docs/api/class-selectors.mdx | 1 + nodejs/docs/api/class-snapshotassertions.mdx | 1 + nodejs/docs/api/class-suite.mdx | 1 + nodejs/docs/api/class-test.mdx | 1 + nodejs/docs/api/class-testcase.mdx | 1 + nodejs/docs/api/class-testconfig.mdx | 21 ++ nodejs/docs/api/class-testerror.mdx | 1 + nodejs/docs/api/class-testinfo.mdx | 1 + nodejs/docs/api/class-testinfoerror.mdx | 1 + nodejs/docs/api/class-testoptions.mdx | 55 +++ nodejs/docs/api/class-testproject.mdx | 1 + nodejs/docs/api/class-testresult.mdx | 1 + nodejs/docs/api/class-teststep.mdx | 1 + nodejs/docs/api/class-teststepinfo.mdx | 1 + nodejs/docs/api/class-timeouterror.mdx | 1 + nodejs/docs/api/class-touchscreen.mdx | 1 + nodejs/docs/api/class-tracing.mdx | 1 + nodejs/docs/api/class-video.mdx | 1 + nodejs/docs/api/class-weberror.mdx | 1 + nodejs/docs/api/class-websocket.mdx | 1 + nodejs/docs/api/class-websocketroute.mdx | 1 + nodejs/docs/api/class-worker.mdx | 1 + nodejs/docs/api/class-workerinfo.mdx | 1 + nodejs/docs/aria-snapshots.mdx | 1 + nodejs/docs/auth.mdx | 1 + nodejs/docs/best-practices.mdx | 1 + nodejs/docs/browser-contexts.mdx | 1 + nodejs/docs/browsers.mdx | 1 + nodejs/docs/canary-releases.mdx | 1 + nodejs/docs/chrome-extensions.mdx | 1 + nodejs/docs/ci-intro.mdx | 1 + nodejs/docs/ci.mdx | 21 +- nodejs/docs/clock.mdx | 1 + nodejs/docs/codegen-intro.mdx | 1 + nodejs/docs/codegen.mdx | 1 + nodejs/docs/debug.mdx | 1 + nodejs/docs/dialogs.mdx | 1 + nodejs/docs/docker.mdx | 19 +- nodejs/docs/downloads.mdx | 1 + nodejs/docs/emulation.mdx | 1 + nodejs/docs/evaluating.mdx | 1 + nodejs/docs/events.mdx | 1 + nodejs/docs/extensibility.mdx | 1 + nodejs/docs/frames.mdx | 1 + nodejs/docs/getting-started-vscode.mdx | 1 + nodejs/docs/handles.mdx | 1 + nodejs/docs/input.mdx | 1 + nodejs/docs/intro.mdx | 1 + nodejs/docs/languages.mdx | 1 + nodejs/docs/library.mdx | 1 + nodejs/docs/locators.mdx | 1 + nodejs/docs/mock-browser.mdx | 1 + nodejs/docs/mock.mdx | 1 + nodejs/docs/navigations.mdx | 1 + nodejs/docs/network.mdx | 1 + nodejs/docs/other-locators.mdx | 80 +---- nodejs/docs/pages.mdx | 1 + nodejs/docs/pom.mdx | 1 + nodejs/docs/protractor.mdx | 1 + nodejs/docs/puppeteer.mdx | 1 + nodejs/docs/release-notes.mdx | 5 +- nodejs/docs/running-tests.mdx | 1 + nodejs/docs/screenshots.mdx | 1 + nodejs/docs/selenium-grid.mdx | 1 + nodejs/docs/service-workers.mdx | 1 + nodejs/docs/test-agents.mdx | 1 + nodejs/docs/test-annotations.mdx | 1 + nodejs/docs/test-assertions.mdx | 1 + nodejs/docs/test-cli.mdx | 1 + nodejs/docs/test-components.mdx | 1 + nodejs/docs/test-configuration.mdx | 1 + nodejs/docs/test-fixtures.mdx | 1 + nodejs/docs/test-global-setup-teardown.mdx | 1 + nodejs/docs/test-parallel.mdx | 1 + nodejs/docs/test-parameterize.mdx | 1 + nodejs/docs/test-projects.mdx | 1 + nodejs/docs/test-reporters.mdx | 1 + nodejs/docs/test-retries.mdx | 1 + nodejs/docs/test-sharding.mdx | 1 + nodejs/docs/test-snapshots.mdx | 1 + nodejs/docs/test-timeouts.mdx | 1 + nodejs/docs/test-typescript.mdx | 1 + nodejs/docs/test-ui-mode.mdx | 1 + nodejs/docs/test-use-options.mdx | 1 + nodejs/docs/test-webserver.mdx | 1 + nodejs/docs/testing-library.mdx | 1 + nodejs/docs/touch-events.mdx | 1 + nodejs/docs/trace-viewer-intro.mdx | 1 + nodejs/docs/trace-viewer.mdx | 1 + nodejs/docs/videos.mdx | 1 + nodejs/docs/webview2.mdx | 1 + nodejs/docs/writing-tests.mdx | 1 + python/docs/other-locators.mdx | 119 ------- python/docs/release-notes.mdx | 4 +- src/api_parser.js | 8 +- 147 files changed, 695 insertions(+), 389 deletions(-) create mode 100644 nodejs/docs/api/class-pageagent.mdx diff --git a/dotnet/docs/other-locators.mdx b/dotnet/docs/other-locators.mdx index 45cd3d18a79..6900288ef1f 100644 --- a/dotnet/docs/other-locators.mdx +++ b/dotnet/docs/other-locators.mdx @@ -222,85 +222,6 @@ Alternatively, if you cannot find a suitable locator for the parent element, use var parent = page.GetByText("Hello").Locator("xpath=.."); ``` -## React locator - -:::note - -React locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -React locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In React locator, component names are transcribed with **CamelCase**. - -```csharp -await page.Locator("_react=BookItem").ClickAsync(); -``` - -More examples: -- match by **component**: `_react=BookItem` -- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]` -- match by component and **truthy property value**: `_react=MyButton[enabled]` -- match by component and **boolean value**: `_react=MyButton[enabled = false]` -- match by property **value substring**: `_react=[author *= "King"]` -- match by component and **multiple properties**: `_react=BookItem[author *= "king" i][year = 1990]` -- match by **nested** property value: `_react=[some.nested.value = 12]` -- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]` -- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]` -- match by component and **key**: `_react=BookItem[key = '2']` -- match by property value **regex**: `_react=[author = /Steven(\\s+King)?/i]` - -To find React element names in a tree use [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi). - -:::note - -React locator supports React 15 and above. -::: - -:::note -React locator, as well as [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - -## Vue locator - -:::note - -Vue locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -Vue locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In Vue locator, component names are transcribed with **kebab-case**. - -```csharp -await page.Locator("_vue=book-item").ClickAsync(); -``` - -More examples: -- match by **component**: `_vue=book-item` -- match by component and **exact property value**, case-sensitive: `_vue=book-item[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_vue=[author = "steven king" i]` -- match by component and **truthy property value**: `_vue=my-button[enabled]` -- match by component and **boolean value**: `_vue=my-button[enabled = false]` -- match by property **value substring**: `_vue=[author *= "King"]` -- match by component and **multiple properties**: `_vue=book-item[author *= "king" i][year = 1990]` -- match by **nested** property value: `_vue=[some.nested.value = 12]` -- match by component and property value **prefix**: `_vue=book-item[author ^= "Steven"]` -- match by component and property value **suffix**: `_vue=book-item[author $= "Steven"]` -- match by property value **regex**: `_vue=[author = /Steven(\\s+King)?/i]` - -To find Vue element names in a tree use [Vue DevTools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en). - -:::note - -Vue locator supports Vue2 and above. -::: - -:::note -Vue locator, as well as [Vue DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - ## XPath locator :::warning diff --git a/dotnet/docs/release-notes.mdx b/dotnet/docs/release-notes.mdx index 6c4a6eed8d0..93ef8707747 100644 --- a/dotnet/docs/release-notes.mdx +++ b/dotnet/docs/release-notes.mdx @@ -1514,7 +1514,7 @@ await locator.ClickAsync(); Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1523,7 +1523,7 @@ await page.Locator("_react=SubmitButton[enabled=true]").ClickAsync(); await page.Locator("_vue=submit-button[enabled=true]").ClickAsync(); ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. diff --git a/java/docs/other-locators.mdx b/java/docs/other-locators.mdx index f00a25a0350..9fd3729694f 100644 --- a/java/docs/other-locators.mdx +++ b/java/docs/other-locators.mdx @@ -222,85 +222,6 @@ Alternatively, if you cannot find a suitable locator for the parent element, use Locator parent = page.getByText("Hello").locator("xpath=.."); ``` -## React locator - -:::note - -React locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -React locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In React locator, component names are transcribed with **CamelCase**. - -```java -page.locator("_react=BookItem").click(); -``` - -More examples: -- match by **component**: `_react=BookItem` -- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]` -- match by component and **truthy property value**: `_react=MyButton[enabled]` -- match by component and **boolean value**: `_react=MyButton[enabled = false]` -- match by property **value substring**: `_react=[author *= "King"]` -- match by component and **multiple properties**: `_react=BookItem[author *= "king" i][year = 1990]` -- match by **nested** property value: `_react=[some.nested.value = 12]` -- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]` -- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]` -- match by component and **key**: `_react=BookItem[key = '2']` -- match by property value **regex**: `_react=[author = /Steven(\\s+King)?/i]` - -To find React element names in a tree use [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi). - -:::note - -React locator supports React 15 and above. -::: - -:::note -React locator, as well as [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - -## Vue locator - -:::note - -Vue locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -Vue locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In Vue locator, component names are transcribed with **kebab-case**. - -```java -page.locator("_vue=book-item").click(); -``` - -More examples: -- match by **component**: `_vue=book-item` -- match by component and **exact property value**, case-sensitive: `_vue=book-item[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_vue=[author = "steven king" i]` -- match by component and **truthy property value**: `_vue=my-button[enabled]` -- match by component and **boolean value**: `_vue=my-button[enabled = false]` -- match by property **value substring**: `_vue=[author *= "King"]` -- match by component and **multiple properties**: `_vue=book-item[author *= "king" i][year = 1990]` -- match by **nested** property value: `_vue=[some.nested.value = 12]` -- match by component and property value **prefix**: `_vue=book-item[author ^= "Steven"]` -- match by component and property value **suffix**: `_vue=book-item[author $= "Steven"]` -- match by property value **regex**: `_vue=[author = /Steven(\\s+King)?/i]` - -To find Vue element names in a tree use [Vue DevTools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en). - -:::note - -Vue locator supports Vue2 and above. -::: - -:::note -Vue locator, as well as [Vue DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - ## XPath locator :::warning diff --git a/java/docs/release-notes.mdx b/java/docs/release-notes.mdx index 5b728b4c895..efff5541ae6 100644 --- a/java/docs/release-notes.mdx +++ b/java/docs/release-notes.mdx @@ -1524,7 +1524,7 @@ locator.click(); Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1533,7 +1533,7 @@ page.locator("_react=SubmitButton[enabled=true]").click(); page.locator("_vue=submit-button[enabled=true]").click(); ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. diff --git a/nodejs/docs/accessibility-testing.mdx b/nodejs/docs/accessibility-testing.mdx index 9b8f0b6fb05..91bb75a3a15 100644 --- a/nodejs/docs/accessibility-testing.mdx +++ b/nodejs/docs/accessibility-testing.mdx @@ -366,6 +366,7 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/actionability.mdx b/nodejs/docs/actionability.mdx index e72c40edaac..9227ce688bd 100644 --- a/nodejs/docs/actionability.mdx +++ b/nodejs/docs/actionability.mdx @@ -156,6 +156,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api-testing.mdx b/nodejs/docs/api-testing.mdx index 5072e812205..418d6fa2e45 100644 --- a/nodejs/docs/api-testing.mdx +++ b/nodejs/docs/api-testing.mdx @@ -407,6 +407,7 @@ test('global context request has isolated cookie storage', async ({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-android.mdx b/nodejs/docs/api/class-android.mdx index 5df34f8dd16..99e61844cf1 100644 --- a/nodejs/docs/api/class-android.mdx +++ b/nodejs/docs/api/class-android.mdx @@ -277,6 +277,7 @@ android.setDefaultTimeout(timeout); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-androiddevice.mdx b/nodejs/docs/api/class-androiddevice.mdx index a6ba2d859bb..aefffad042d 100644 --- a/nodejs/docs/api/class-androiddevice.mdx +++ b/nodejs/docs/api/class-androiddevice.mdx @@ -973,6 +973,7 @@ androidDevice.on('webview', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-androidinput.mdx b/nodejs/docs/api/class-androidinput.mdx index 5b8d3393a6d..0b10491cec6 100644 --- a/nodejs/docs/api/class-androidinput.mdx +++ b/nodejs/docs/api/class-androidinput.mdx @@ -191,6 +191,7 @@ await androidInput.type(text); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-androidsocket.mdx b/nodejs/docs/api/class-androidsocket.mdx index 0e32f9feb6b..3182aca0e5c 100644 --- a/nodejs/docs/api/class-androidsocket.mdx +++ b/nodejs/docs/api/class-androidsocket.mdx @@ -118,6 +118,7 @@ androidSocket.on('data', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-androidwebview.mdx b/nodejs/docs/api/class-androidwebview.mdx index ac1cc740376..d677c49b59d 100644 --- a/nodejs/docs/api/class-androidwebview.mdx +++ b/nodejs/docs/api/class-androidwebview.mdx @@ -113,6 +113,7 @@ androidWebView.on('close', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-apirequest.mdx b/nodejs/docs/api/class-apirequest.mdx index 96b1c5220c0..52991fb2e25 100644 --- a/nodejs/docs/api/class-apirequest.mdx +++ b/nodejs/docs/api/class-apirequest.mdx @@ -201,6 +201,7 @@ await apiRequest.newContext(options); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-apirequestcontext.mdx b/nodejs/docs/api/class-apirequestcontext.mdx index 2bfdad0740d..c5fb425c6fd 100644 --- a/nodejs/docs/api/class-apirequestcontext.mdx +++ b/nodejs/docs/api/class-apirequestcontext.mdx @@ -658,6 +658,7 @@ await apiRequestContext.storageState(options); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-apiresponse.mdx b/nodejs/docs/api/class-apiresponse.mdx index 0ac972bb669..45392f46675 100644 --- a/nodejs/docs/api/class-apiresponse.mdx +++ b/nodejs/docs/api/class-apiresponse.mdx @@ -224,6 +224,7 @@ apiResponse.url(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-apiresponseassertions.mdx b/nodejs/docs/api/class-apiresponseassertions.mdx index 1050a54e6b6..d566f1cf19b 100644 --- a/nodejs/docs/api/class-apiresponseassertions.mdx +++ b/nodejs/docs/api/class-apiresponseassertions.mdx @@ -96,6 +96,7 @@ expect(response).not [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx index e3208aad8de..a03a3443831 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -895,6 +895,7 @@ browser.on('disconnected', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx index f168b63a539..59a69ad450d 100644 --- a/nodejs/docs/api/class-browsercontext.mdx +++ b/nodejs/docs/api/class-browsercontext.mdx @@ -1361,6 +1361,7 @@ await browserContext.setHTTPCredentials(httpCredentials); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-browserserver.mdx b/nodejs/docs/api/class-browserserver.mdx index f636d8ba612..fb1c25d535d 100644 --- a/nodejs/docs/api/class-browserserver.mdx +++ b/nodejs/docs/api/class-browserserver.mdx @@ -132,6 +132,7 @@ browserServer.on('close', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-browsertype.mdx b/nodejs/docs/api/class-browsertype.mdx index 5258a0f8438..9eac5469b73 100644 --- a/nodejs/docs/api/class-browsertype.mdx +++ b/nodejs/docs/api/class-browsertype.mdx @@ -755,6 +755,7 @@ browserType.name(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-cdpsession.mdx b/nodejs/docs/api/class-cdpsession.mdx index 16a2f04d116..ac77fc98871 100644 --- a/nodejs/docs/api/class-cdpsession.mdx +++ b/nodejs/docs/api/class-cdpsession.mdx @@ -104,6 +104,7 @@ await cdpSession.send(method, params); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-clock.mdx b/nodejs/docs/api/class-clock.mdx index fc9247a6022..27c66d833b7 100644 --- a/nodejs/docs/api/class-clock.mdx +++ b/nodejs/docs/api/class-clock.mdx @@ -232,6 +232,7 @@ await page.clock.setSystemTime('2020-02-02'); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-consolemessage.mdx b/nodejs/docs/api/class-consolemessage.mdx index ce10419b8cb..8a2f6141854 100644 --- a/nodejs/docs/api/class-consolemessage.mdx +++ b/nodejs/docs/api/class-consolemessage.mdx @@ -175,6 +175,7 @@ consoleMessage.worker(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-coverage.mdx b/nodejs/docs/api/class-coverage.mdx index 00112c43a60..bc6fdd8b770 100644 --- a/nodejs/docs/api/class-coverage.mdx +++ b/nodejs/docs/api/class-coverage.mdx @@ -216,6 +216,7 @@ await coverage.stopJSCoverage(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-dialog.mdx b/nodejs/docs/api/class-dialog.mdx index 8f5d4a08819..c95d475aa2e 100644 --- a/nodejs/docs/api/class-dialog.mdx +++ b/nodejs/docs/api/class-dialog.mdx @@ -175,6 +175,7 @@ dialog.type(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-download.mdx b/nodejs/docs/api/class-download.mdx index 520cc764610..09f0dab64bb 100644 --- a/nodejs/docs/api/class-download.mdx +++ b/nodejs/docs/api/class-download.mdx @@ -225,6 +225,7 @@ download.url(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-electron.mdx b/nodejs/docs/api/class-electron.mdx index 8d4a4fc937e..461ac068927 100644 --- a/nodejs/docs/api/class-electron.mdx +++ b/nodejs/docs/api/class-electron.mdx @@ -213,6 +213,7 @@ await electron.launch(options); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-electronapplication.mdx b/nodejs/docs/api/class-electronapplication.mdx index 005b4b9f641..f7cc04660e7 100644 --- a/nodejs/docs/api/class-electronapplication.mdx +++ b/nodejs/docs/api/class-electronapplication.mdx @@ -344,6 +344,7 @@ electronApplication.on('window', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-elementhandle.mdx b/nodejs/docs/api/class-elementhandle.mdx index 9c2583e93ba..2b52cf7a52c 100644 --- a/nodejs/docs/api/class-elementhandle.mdx +++ b/nodejs/docs/api/class-elementhandle.mdx @@ -1625,6 +1625,7 @@ This method does not work across navigations, use [page.waitForSelector()](/api/ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-filechooser.mdx b/nodejs/docs/api/class-filechooser.mdx index c343795440a..dad48b1c4b0 100644 --- a/nodejs/docs/api/class-filechooser.mdx +++ b/nodejs/docs/api/class-filechooser.mdx @@ -147,6 +147,7 @@ await fileChooser.setFiles(files, options); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-fixtures.mdx b/nodejs/docs/api/class-fixtures.mdx index 7bf93dae008..c8bdf3266de 100644 --- a/nodejs/docs/api/class-fixtures.mdx +++ b/nodejs/docs/api/class-fixtures.mdx @@ -28,6 +28,21 @@ Playwright Test comes with builtin fixtures listed below, and you can add your o ## Properties +### agent {#fixtures-agent} + +Added in: v1.58fixtures.agent + +**Usage** + +```js +fixtures.agent +``` + +**Type** +- [PageAgent] + +--- + ### browser {#fixtures-browser} Added in: v1.10fixtures.browser @@ -180,6 +195,7 @@ test('basic test', async ({ request }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-frame.mdx b/nodejs/docs/api/class-frame.mdx index 6e8c9f484b8..adc5ca5c43d 100644 --- a/nodejs/docs/api/class-frame.mdx +++ b/nodejs/docs/api/class-frame.mdx @@ -2687,6 +2687,7 @@ await frame.waitForTimeout(timeout); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-framelocator.mdx b/nodejs/docs/api/class-framelocator.mdx index 9605686033d..821da2350d6 100644 --- a/nodejs/docs/api/class-framelocator.mdx +++ b/nodejs/docs/api/class-framelocator.mdx @@ -569,6 +569,7 @@ frameLocator.nth(index); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-fullconfig.mdx b/nodejs/docs/api/class-fullconfig.mdx index fa00830f5f9..6158aa3a16c 100644 --- a/nodejs/docs/api/class-fullconfig.mdx +++ b/nodejs/docs/api/class-fullconfig.mdx @@ -298,6 +298,26 @@ fullConfig.rootDir --- +### runAgents {#full-config-run-agents} + +Added in: v1.58fullConfig.runAgents + +Whether to run LLM agent for [PageAgent]: +* "all" disregards existing cache and performs all actions via LLM +* "missing" only performs actions that don't have generated cache actions +* "none" does not talk to LLM at all, relies on the cached actions (default) + +**Usage** + +```js +fullConfig.runAgents +``` + +**Type** +- "all" | "missing" | "none" + +--- + ### shard {#full-config-shard} Added in: v1.10fullConfig.shard @@ -455,6 +475,7 @@ fullConfig.workers [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-fullproject.mdx b/nodejs/docs/api/class-fullproject.mdx index 29752586f38..36e220a4c82 100644 --- a/nodejs/docs/api/class-fullproject.mdx +++ b/nodejs/docs/api/class-fullproject.mdx @@ -65,6 +65,23 @@ fullProject.grepInvert --- +### ignoreSnapshots {#full-project-ignore-snapshots} + +Added in: v1.59fullProject.ignoreSnapshots + +See [testProject.ignoreSnapshots](/api/class-testproject.mdx#test-project-ignore-snapshots). + +**Usage** + +```js +fullProject.ignoreSnapshots +``` + +**Type** +- [boolean] + +--- + ### metadata {#full-project-metadata} Added in: v1.10fullProject.metadata @@ -301,6 +318,7 @@ fullProject.use [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-genericassertions.mdx b/nodejs/docs/api/class-genericassertions.mdx index 3a5ddfe0efb..8e2bde4fb6b 100644 --- a/nodejs/docs/api/class-genericassertions.mdx +++ b/nodejs/docs/api/class-genericassertions.mdx @@ -818,6 +818,7 @@ expect(value).not [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-jshandle.mdx b/nodejs/docs/api/class-jshandle.mdx index 91512d911ac..e817bfb25f7 100644 --- a/nodejs/docs/api/class-jshandle.mdx +++ b/nodejs/docs/api/class-jshandle.mdx @@ -218,6 +218,7 @@ await jsHandle.jsonValue(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-keyboard.mdx b/nodejs/docs/api/class-keyboard.mdx index c6e877d211b..a9192965836 100644 --- a/nodejs/docs/api/class-keyboard.mdx +++ b/nodejs/docs/api/class-keyboard.mdx @@ -259,6 +259,7 @@ await keyboard.up(key); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-location.mdx b/nodejs/docs/api/class-location.mdx index 0bb4c721c31..056ec87d32c 100644 --- a/nodejs/docs/api/class-location.mdx +++ b/nodejs/docs/api/class-location.mdx @@ -97,6 +97,7 @@ location.line [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-locator.mdx b/nodejs/docs/api/class-locator.mdx index e8c54761c3a..384d0b0c51c 100644 --- a/nodejs/docs/api/class-locator.mdx +++ b/nodejs/docs/api/class-locator.mdx @@ -2569,6 +2569,7 @@ To press a special key, like `Control` or `ArrowDown`, use [locator.press()](/ap [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx index 9e7a3e0cdcc..e3f22018b38 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -1123,6 +1123,7 @@ expect(locator).not [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-logger.mdx b/nodejs/docs/api/class-logger.mdx index e291800f4b6..8f6470e1abe 100644 --- a/nodejs/docs/api/class-logger.mdx +++ b/nodejs/docs/api/class-logger.mdx @@ -118,6 +118,7 @@ logger.log(name, severity, message, args, hints); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-mouse.mdx b/nodejs/docs/api/class-mouse.mdx index 21c60e8102d..43eebd33ce9 100644 --- a/nodejs/docs/api/class-mouse.mdx +++ b/nodejs/docs/api/class-mouse.mdx @@ -247,6 +247,7 @@ await mouse.wheel(deltaX, deltaY); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index 2d070378d07..10b8a3ac602 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -257,6 +257,72 @@ await page.addStyleTag(options); --- +### agent {#page-agent} + +Added in: v1.58page.agent + +Initialize page agent with the llm provider and cache. + +**Usage** + +```js +await page.agent(); +await page.agent(options); +``` + +**Arguments** +- `options` [Object] *(optional)* + - `cache` [Object] *(optional)*# + - `cacheFile` [string] *(optional)* + + Cache file to use/generate code for performed actions into. Cache is not used if not specified (default). + - `cacheOutFile` [string] *(optional)* + + When specified, generated entries are written into the `cacheOutFile` instead of updating the `cacheFile`. + - `expect` [Object] *(optional)*# + - `timeout` [number] *(optional)* + + Default timeout for expect calls in milliseconds, defaults to 5000ms. + - `limits` [Object] *(optional)*# + - `maxTokens` [number] *(optional)* + + Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to unlimited. + - `maxActions` [number] *(optional)* + + Maximum number of agentic actions to generate, defaults to 10. + - `maxActionRetries` [number] *(optional)* + + Maximum number retries per action, defaults to 3. + + Limits to use for the agentic loop. + - `provider` [Object] *(optional)*# + - `api` "openai" | "openai-compatible" | "anthropic" | "google" + + API to use. + - `apiEndpoint` [string] *(optional)* + + Endpoint to use if different from default. + - `apiKey` [string] + + API key for the LLM provider. + - `apiTimeout` [number] *(optional)* + + Amount of time to wait for the provider to respond to each request. + - `model` [string] + + Model identifier within the provider. Required in non-cache mode. + - `secrets` [Object]<[string], [string]> *(optional)*# + + Secrets to hide from the LLM. + - `systemPrompt` [string] *(optional)*# + + System prompt for the agent's loop. + +**Returns** +- [Promise]<[PageAgent]># + +--- + ### bringToFront {#page-bring-to-front} Added before v1.9page.bringToFront @@ -4529,6 +4595,7 @@ await page.waitForTimeout(1000); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-pageagent.mdx b/nodejs/docs/api/class-pageagent.mdx new file mode 100644 index 00000000000..e53b521f2f7 --- /dev/null +++ b/nodejs/docs/api/class-pageagent.mdx @@ -0,0 +1,335 @@ +--- +id: class-pageagent +title: "PageAgent" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + + +--- + +## Methods + +### dispose {#page-agent-dispose} + +Added in: v1.58pageAgent.dispose + +Dispose this agent. + +**Usage** + +```js +await pageAgent.dispose(); +``` + +**Returns** +- [Promise]<[void]># + +--- + +### expect {#page-agent-expect} + +Added in: v1.58pageAgent.expect + +Expect certain condition to be met. + +**Usage** + +```js +await agent.expect('"0 items" to be reported'); +``` + +**Arguments** +- `expectation` [string]# + + Expectation to assert. +- `options` [Object] *(optional)* + - `cacheKey` [string] *(optional)*# + + All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally with the `task` as a key. This option allows controlling the cache key explicitly. + - `maxActionRetries` [number] *(optional)*# + + Maximum number of retries when generating each action, defaults to context-wide value specified in `agent` property. + - `maxActions` [number] *(optional)*# + + Maximum number of agentic actions to generate, defaults to context-wide value specified in `agent` property. + - `maxTokens` [number] *(optional)*# + + Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Expect timeout in milliseconds. Defaults to `5000`. The default value can be changed via `expect.timeout` option in the config, or by specifying the `expect` property of the [expect](/api/class-page.mdx#page-agent-option-expect) option. Pass `0` to disable timeout. + +**Returns** +- [Promise]<[void]># + +--- + +### extract {#page-agent-extract} + +Added in: v1.58pageAgent.extract + +Extract information from the page using the agentic loop, return it in a given Zod format. + +**Usage** + +```js +await agent.extract('List of items in the cart', z.object({ + title: z.string().describe('Item title to extract'), + price: z.string().describe('Item price to extract'), +}).array()); +``` + +**Arguments** +- `query` [string]# + + Task to perform using agentic loop. +- `schema` [z.ZodSchema]# +- `options` [Object] *(optional)* + - `cacheKey` [string] *(optional)*# + + All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally with the `task` as a key. This option allows controlling the cache key explicitly. + - `maxActionRetries` [number] *(optional)*# + + Maximum number of retries when generating each action, defaults to context-wide value specified in `agent` property. + - `maxActions` [number] *(optional)*# + + Maximum number of agentic actions to generate, defaults to context-wide value specified in `agent` property. + - `maxTokens` [number] *(optional)*# + + Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Extract timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or by using the [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. Pass `0` to disable timeout. + +**Returns** +- [Promise]<[Object]># + - `result` [Object] + + + - `usage` [Object] + - `turns` [number] + + + - `inputTokens` [number] + + + - `outputTokens` [number] + + + +--- + +### perform {#page-agent-perform} + +Added in: v1.58pageAgent.perform + +Perform action using agentic loop. + +**Usage** + +```js +await agent.perform('Click submit button'); +``` + +**Arguments** +- `task` [string]# + + Task to perform using agentic loop. +- `options` [Object] *(optional)* + - `cacheKey` [string] *(optional)*# + + All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally with the `task` as a key. This option allows controlling the cache key explicitly. + - `maxActionRetries` [number] *(optional)*# + + Maximum number of retries when generating each action, defaults to context-wide value specified in `agent` property. + - `maxActions` [number] *(optional)*# + + Maximum number of agentic actions to generate, defaults to context-wide value specified in `agent` property. + - `maxTokens` [number] *(optional)*# + + Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Perform timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or by using the [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. Pass `0` to disable timeout. + +**Returns** +- [Promise]<[Object]># + - `usage` [Object] + - `turns` [number] + + + - `inputTokens` [number] + + + - `outputTokens` [number] + + + +--- + +### usage {#page-agent-usage} + +Added in: v1.58pageAgent.usage + +Returns the current token usage for this agent. + +**Usage** + +```js +const usage = await agent.usage(); +console.log(`Tokens used: ${usage.inputTokens} in, ${usage.outputTokens} out`); +``` + +**Returns** +- [Promise]<[Object]># + - `turns` [number] + + + - `inputTokens` [number] + + + - `outputTokens` [number] + + +--- + +## Events + +### on('turn') {#page-agent-event-turn} + +Added in: v1.58pageAgent.on('turn') + +Emitted when the agent makes a turn. + +**Usage** + +```js +pageAgent.on('turn', data => {}); +``` + +**Event data** +- [Object] + - `role` [string] + + + - `message` [string] + + + - `usage` [Object] *(optional)* + - `inputTokens` [number] + + + - `outputTokens` [number] + + + + + +[Android]: /api/class-android.mdx "Android" +[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice" +[AndroidInput]: /api/class-androidinput.mdx "AndroidInput" +[AndroidSocket]: /api/class-androidsocket.mdx "AndroidSocket" +[AndroidWebView]: /api/class-androidwebview.mdx "AndroidWebView" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserServer]: /api/class-browserserver.mdx "BrowserServer" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Coverage]: /api/class-coverage.mdx "Coverage" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[Electron]: /api/class-electron.mdx "Electron" +[ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Logger]: /api/class-logger.mdx "Logger" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Selectors]: /api/class-selectors.mdx "Selectors" +[SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Fixtures]: /api/class-fixtures.mdx "Fixtures" +[FullConfig]: /api/class-fullconfig.mdx "FullConfig" +[FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" +[Test]: /api/class-test.mdx "Test" +[TestConfig]: /api/class-testconfig.mdx "TestConfig" +[TestInfo]: /api/class-testinfo.mdx "TestInfo" +[TestInfoError]: /api/class-testinfoerror.mdx "TestInfoError" +[TestOptions]: /api/class-testoptions.mdx "TestOptions" +[TestProject]: /api/class-testproject.mdx "TestProject" +[TestStepInfo]: /api/class-teststepinfo.mdx "TestStepInfo" +[WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" +[Reporter]: /api/class-reporter.mdx "Reporter" +[Suite]: /api/class-suite.mdx "Suite" +[TestCase]: /api/class-testcase.mdx "TestCase" +[TestError]: /api/class-testerror.mdx "TestError" +[TestResult]: /api/class-testresult.mdx "TestResult" +[TestStep]: /api/class-teststep.mdx "TestStep" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array" +[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean" +[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer" +[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess" +[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date "Date" +[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error" +[EventEmitter]: https://nodejs.org/api/events.html#events_class_eventemitter "EventEmitter" +[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function" +[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData "FormData" +[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map" +[Metadata]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object<string, any>" +[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null" +[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number" +[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable" +[ReadStream]: https://nodejs.org/api/fs.html#class-fsreadstream "ReadStream" +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp" +[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string" +[void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "void" +[URL]: https://nodejs.org/api/url.html "URL" +[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams "URLSearchParams" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/about "Microsoft Artifact Registry" +[Dockerfile.noble]: https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble" diff --git a/nodejs/docs/api/class-pageassertions.mdx b/nodejs/docs/api/class-pageassertions.mdx index 5e1bde1dddf..74e053becc4 100644 --- a/nodejs/docs/api/class-pageassertions.mdx +++ b/nodejs/docs/api/class-pageassertions.mdx @@ -306,6 +306,7 @@ expect(page).not [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-playwright.mdx b/nodejs/docs/api/class-playwright.mdx index 8f0437ad0dc..b6d40a41f05 100644 --- a/nodejs/docs/api/class-playwright.mdx +++ b/nodejs/docs/api/class-playwright.mdx @@ -210,6 +210,7 @@ playwright.webkit [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-playwrightassertions.mdx b/nodejs/docs/api/class-playwrightassertions.mdx index 9be59709264..132a3987a79 100644 --- a/nodejs/docs/api/class-playwrightassertions.mdx +++ b/nodejs/docs/api/class-playwrightassertions.mdx @@ -138,6 +138,7 @@ Creates a [PageAssertions] object for the given [Page]. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-reporter.mdx b/nodejs/docs/api/class-reporter.mdx index d30824d02b7..6e148974789 100644 --- a/nodejs/docs/api/class-reporter.mdx +++ b/nodejs/docs/api/class-reporter.mdx @@ -409,6 +409,7 @@ reporter.printsToStdio(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-request.mdx b/nodejs/docs/api/class-request.mdx index 18b9c4b6eb1..a44b77db288 100644 --- a/nodejs/docs/api/class-request.mdx +++ b/nodejs/docs/api/class-request.mdx @@ -482,6 +482,7 @@ request.url(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-response.mdx b/nodejs/docs/api/class-response.mdx index 346bca72b54..fd0541d4c90 100644 --- a/nodejs/docs/api/class-response.mdx +++ b/nodejs/docs/api/class-response.mdx @@ -390,6 +390,7 @@ response.url(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-route.mdx b/nodejs/docs/api/class-route.mdx index 42ffe92fedf..d8504bb3723 100644 --- a/nodejs/docs/api/class-route.mdx +++ b/nodejs/docs/api/class-route.mdx @@ -345,6 +345,7 @@ route.request(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-selectors.mdx b/nodejs/docs/api/class-selectors.mdx index 1f0463565ee..87f2533c851 100644 --- a/nodejs/docs/api/class-selectors.mdx +++ b/nodejs/docs/api/class-selectors.mdx @@ -133,6 +133,7 @@ selectors.setTestIdAttribute(attributeName); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-snapshotassertions.mdx b/nodejs/docs/api/class-snapshotassertions.mdx index cc15a3e11e4..a0923964ed3 100644 --- a/nodejs/docs/api/class-snapshotassertions.mdx +++ b/nodejs/docs/api/class-snapshotassertions.mdx @@ -151,6 +151,7 @@ Note that matching snapshots only work with Playwright test runner. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-suite.mdx b/nodejs/docs/api/class-suite.mdx index 277e25cdf1e..25c38d1fcc4 100644 --- a/nodejs/docs/api/class-suite.mdx +++ b/nodejs/docs/api/class-suite.mdx @@ -237,6 +237,7 @@ suite.type [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-test.mdx b/nodejs/docs/api/class-test.mdx index b68080aa14f..be374520a1a 100644 --- a/nodejs/docs/api/class-test.mdx +++ b/nodejs/docs/api/class-test.mdx @@ -1910,6 +1910,7 @@ test.describe.serial.only(() => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testcase.mdx b/nodejs/docs/api/class-testcase.mdx index 194370aee33..bf283dd6c08 100644 --- a/nodejs/docs/api/class-testcase.mdx +++ b/nodejs/docs/api/class-testcase.mdx @@ -323,6 +323,7 @@ testCase.type [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx index 97619298fd4..28d39a0bad8 100644 --- a/nodejs/docs/api/class-testconfig.mdx +++ b/nodejs/docs/api/class-testconfig.mdx @@ -671,6 +671,26 @@ export default defineConfig({ --- +### runAgents {#test-config-run-agents} + +Added in: v1.58testConfig.runAgents + +Whether to run LLM agent for [PageAgent]: +* "all" disregards existing cache and performs all actions via LLM +* "missing" only performs actions that don't have generated cache actions +* "none" does not talk to LLM at all, relies on the cached actions (default) + +**Usage** + +```js +testConfig.runAgents +``` + +**Type** +- "all" | "missing" | "none" + +--- + ### shard {#test-config-shard} Added in: v1.10testConfig.shard @@ -1256,6 +1276,7 @@ This path will serve as the base directory for each test file snapshot directory [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testerror.mdx b/nodejs/docs/api/class-testerror.mdx index 908b2b03527..dca6dd37935 100644 --- a/nodejs/docs/api/class-testerror.mdx +++ b/nodejs/docs/api/class-testerror.mdx @@ -148,6 +148,7 @@ testError.value [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testinfo.mdx b/nodejs/docs/api/class-testinfo.mdx index 9b396cadebe..7826b9f9b29 100644 --- a/nodejs/docs/api/class-testinfo.mdx +++ b/nodejs/docs/api/class-testinfo.mdx @@ -894,6 +894,7 @@ testInfo.workerIndex [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testinfoerror.mdx b/nodejs/docs/api/class-testinfoerror.mdx index 81f237a2b17..a1ea68ee1dd 100644 --- a/nodejs/docs/api/class-testinfoerror.mdx +++ b/nodejs/docs/api/class-testinfoerror.mdx @@ -114,6 +114,7 @@ testInfoError.value [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 6e108dd1698..9a34db62425 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -92,6 +92,60 @@ Learn more about [various timeouts](../test-timeouts.mdx). --- +### agentOptions {#test-options-agent-options} + +Added in: v1.58testOptions.agentOptions + +**Usage** + +```js +testOptions.agentOptions +``` + +**Type** +- [Object] + - `provider` [Object] + - `api` "openai" | "openai-compatible" | "anthropic" | "google" + + API to use. + - `apiEndpoint` [string] *(optional)* + + Endpoint to use if different from default. + - `apiKey` [string] + + API key for the LLM provider. + - `apiTimeout` [number] *(optional)* + + Amount of time to wait for the provider to respond to each request. + - `model` [string] + + Model identifier within the provider. Required in non-cache mode. + + + - `cachePathTemplate` [string] *(optional)* + + Cache file template to use/generate code for performed actions into. + - `limits` [Object] + - `maxTokens` [number] *(optional)* + + Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to unlimited. + - `maxActions` [number] *(optional)* + + Maximum number of agentic actions to generate, defaults to 10. + - `maxActionRetries` [number] *(optional)* + + Maximum number retries per action, defaults to 3. + + + - `secrets` [Object]<[string], [string]> *(optional)* + + Secrets to hide from the LLM. + - `systemPrompt` [string] + + System prompt for the agent's loop. + +--- + ### baseURL {#test-options-base-url} Added in: v1.10testOptions.baseURL @@ -1115,6 +1169,7 @@ export default defineConfig({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx index bd0d80b316c..d8105f1fa6c 100644 --- a/nodejs/docs/api/class-testproject.mdx +++ b/nodejs/docs/api/class-testproject.mdx @@ -798,6 +798,7 @@ export default defineConfig({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-testresult.mdx b/nodejs/docs/api/class-testresult.mdx index 732d22b35fc..52d91723996 100644 --- a/nodejs/docs/api/class-testresult.mdx +++ b/nodejs/docs/api/class-testresult.mdx @@ -299,6 +299,7 @@ testResult.workerIndex [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-teststep.mdx b/nodejs/docs/api/class-teststep.mdx index b012a91ec43..b21cf96b038 100644 --- a/nodejs/docs/api/class-teststep.mdx +++ b/nodejs/docs/api/class-teststep.mdx @@ -262,6 +262,7 @@ testStep.title [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-teststepinfo.mdx b/nodejs/docs/api/class-teststepinfo.mdx index ea57cef8236..c2850787f39 100644 --- a/nodejs/docs/api/class-teststepinfo.mdx +++ b/nodejs/docs/api/class-teststepinfo.mdx @@ -193,6 +193,7 @@ testStepInfo.titlePath [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-timeouterror.mdx b/nodejs/docs/api/class-timeouterror.mdx index dcdafa8fd7b..859990d6432 100644 --- a/nodejs/docs/api/class-timeouterror.mdx +++ b/nodejs/docs/api/class-timeouterror.mdx @@ -64,6 +64,7 @@ const playwright = require('playwright'); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-touchscreen.mdx b/nodejs/docs/api/class-touchscreen.mdx index affa0426ed4..b934a497f4c 100644 --- a/nodejs/docs/api/class-touchscreen.mdx +++ b/nodejs/docs/api/class-touchscreen.mdx @@ -78,6 +78,7 @@ await touchscreen.tap(x, y); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-tracing.mdx b/nodejs/docs/api/class-tracing.mdx index 89507a47dc1..3b01b70c5e6 100644 --- a/nodejs/docs/api/class-tracing.mdx +++ b/nodejs/docs/api/class-tracing.mdx @@ -258,6 +258,7 @@ await tracing.stopChunk(options); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-video.mdx b/nodejs/docs/api/class-video.mdx index 443c312dd13..23e2f05e019 100644 --- a/nodejs/docs/api/class-video.mdx +++ b/nodejs/docs/api/class-video.mdx @@ -106,6 +106,7 @@ await video.saveAs(path); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-weberror.mdx b/nodejs/docs/api/class-weberror.mdx index e171e785b51..3617849b305 100644 --- a/nodejs/docs/api/class-weberror.mdx +++ b/nodejs/docs/api/class-weberror.mdx @@ -90,6 +90,7 @@ webError.page(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-websocket.mdx b/nodejs/docs/api/class-websocket.mdx index 09d4af5050a..3d3819042cc 100644 --- a/nodejs/docs/api/class-websocket.mdx +++ b/nodejs/docs/api/class-websocket.mdx @@ -194,6 +194,7 @@ webSocket.on('socketerror', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-websocketroute.mdx b/nodejs/docs/api/class-websocketroute.mdx index b80ad8539af..11859eec834 100644 --- a/nodejs/docs/api/class-websocketroute.mdx +++ b/nodejs/docs/api/class-websocketroute.mdx @@ -245,6 +245,7 @@ webSocketRoute.url(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-worker.mdx b/nodejs/docs/api/class-worker.mdx index 702f80b884c..fd60d5888b1 100644 --- a/nodejs/docs/api/class-worker.mdx +++ b/nodejs/docs/api/class-worker.mdx @@ -206,6 +206,7 @@ worker.on('console', data => {}); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/api/class-workerinfo.mdx b/nodejs/docs/api/class-workerinfo.mdx index 92ed01ef65c..3eb8e0722b2 100644 --- a/nodejs/docs/api/class-workerinfo.mdx +++ b/nodejs/docs/api/class-workerinfo.mdx @@ -118,6 +118,7 @@ workerInfo.workerIndex [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/aria-snapshots.mdx b/nodejs/docs/aria-snapshots.mdx index a6dca0f7796..6925c19c29e 100644 --- a/nodejs/docs/aria-snapshots.mdx +++ b/nodejs/docs/aria-snapshots.mdx @@ -467,6 +467,7 @@ Commonly used ARIA attributes, like `checked`, `disabled`, `expanded`, `level`, [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/auth.mdx b/nodejs/docs/auth.mdx index ede1747a40c..3f7a142988c 100644 --- a/nodejs/docs/auth.mdx +++ b/nodejs/docs/auth.mdx @@ -560,6 +560,7 @@ test('not signed in test', async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/best-practices.mdx b/nodejs/docs/best-practices.mdx index 87407800c0e..a4e158c45ba 100644 --- a/nodejs/docs/best-practices.mdx +++ b/nodejs/docs/best-practices.mdx @@ -544,6 +544,7 @@ await page.getByRole('link', { name: 'next page' }).click(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/browser-contexts.mdx b/nodejs/docs/browser-contexts.mdx index e5a9783c254..ce36f4c4ee9 100644 --- a/nodejs/docs/browser-contexts.mdx +++ b/nodejs/docs/browser-contexts.mdx @@ -148,6 +148,7 @@ const userPage = await userContext.newPage(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/browsers.mdx b/nodejs/docs/browsers.mdx index 3ea65550316..07aedaf32a7 100644 --- a/nodejs/docs/browsers.mdx +++ b/nodejs/docs/browsers.mdx @@ -672,6 +672,7 @@ npx playwright uninstall --all [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/canary-releases.mdx b/nodejs/docs/canary-releases.mdx index 4a4405fd2f5..ea4911e04ae 100644 --- a/nodejs/docs/canary-releases.mdx +++ b/nodejs/docs/canary-releases.mdx @@ -74,6 +74,7 @@ The stable and the `next` documentation is published on [playwright.dev](https:/ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/chrome-extensions.mdx b/nodejs/docs/chrome-extensions.mdx index 8afc154d183..795fa39aa8d 100644 --- a/nodejs/docs/chrome-extensions.mdx +++ b/nodejs/docs/chrome-extensions.mdx @@ -132,6 +132,7 @@ test('popup page', async ({ page, extensionId }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/ci-intro.mdx b/nodejs/docs/ci-intro.mdx index bfc1dde810b..672c480def2 100644 --- a/nodejs/docs/ci-intro.mdx +++ b/nodejs/docs/ci-intro.mdx @@ -197,6 +197,7 @@ Artifacts like trace files, HTML reports or even the console logs contain inform [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx index c63a4f2913a..c57d018a8c4 100644 --- a/nodejs/docs/ci.mdx +++ b/nodejs/docs/ci.mdx @@ -101,7 +101,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble options: --user 1001 steps: - uses: actions/checkout@v5 @@ -335,7 +335,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.57.0-noble +container: mcr.microsoft.com/playwright:v1.58.0-noble steps: - task: UseNode@1 @@ -359,7 +359,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-noble-development: docker: - - image: mcr.microsoft.com/playwright:v1.57.0-noble + - image: mcr.microsoft.com/playwright:v1.58.0-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -382,7 +382,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright:v1.57.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.58.0-noble' } } stages { stage('e2e-tests') { steps { @@ -399,7 +399,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright:v1.57.0-noble +image: mcr.microsoft.com/playwright:v1.58.0-noble ``` ### GitLab CI @@ -412,7 +412,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble script: ... ``` @@ -427,7 +427,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble parallel: 7 script: - npm ci @@ -442,7 +442,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble parallel: matrix: - PROJECT: ['chromium', 'webkit'] @@ -458,7 +458,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see ```yml steps: -- name: mcr.microsoft.com/playwright:v1.57.0-noble +- name: mcr.microsoft.com/playwright:v1.58.0-noble script: ... env: @@ -476,7 +476,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble commands: - npx playwright test ``` @@ -539,6 +539,7 @@ xvfb-run npx playwright test [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/clock.mdx b/nodejs/docs/clock.mdx index 3317a1419a4..2ae40cf9790 100644 --- a/nodejs/docs/clock.mdx +++ b/nodejs/docs/clock.mdx @@ -210,6 +210,7 @@ await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:02 AM [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/codegen-intro.mdx b/nodejs/docs/codegen-intro.mdx index a81f988397a..a97b28d0baa 100644 --- a/nodejs/docs/codegen-intro.mdx +++ b/nodejs/docs/codegen-intro.mdx @@ -96,6 +96,7 @@ You can generate tests using emulation for specific viewports, devices, color sc [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/codegen.mdx b/nodejs/docs/codegen.mdx index f98c388aaef..32f5600b826 100644 --- a/nodejs/docs/codegen.mdx +++ b/nodejs/docs/codegen.mdx @@ -252,6 +252,7 @@ const { chromium } = require('@playwright/test'); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/debug.mdx b/nodejs/docs/debug.mdx index 4e9402c4d88..3bc8504bab1 100644 --- a/nodejs/docs/debug.mdx +++ b/nodejs/docs/debug.mdx @@ -349,6 +349,7 @@ await chromium.launch({ headless: false, slowMo: 100 }); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/dialogs.mdx b/nodejs/docs/dialogs.mdx index 861a12d0c9c..f4edfc81e2b 100644 --- a/nodejs/docs/dialogs.mdx +++ b/nodejs/docs/dialogs.mdx @@ -102,6 +102,7 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index 1fdd5d71370..25735df6ef1 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -22,7 +22,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright:v1.57.0-noble +docker pull mcr.microsoft.com/playwright:v1.58.0-noble ``` ### Run the image @@ -34,7 +34,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.57.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.58.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.57.0-noble /bin/b On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.57.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.58.0-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the Start the Playwright Server in Docker: ```bash -docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.57.0-noble /bin/sh -c "npx -y playwright@1.57.0 run-server --port 3000 --host 0.0.0.0" +docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.58.0-noble /bin/sh -c "npx -y playwright@1.58.0 run-server --port 3000 --host 0.0.0.0" ``` #### Connecting to the Server @@ -105,7 +105,7 @@ const browser = await playwright['chromium'].connect('ws://127.0.0.1:3000/'); If you need to access local servers from within the Docker container: ```bash -docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.57.0-noble /bin/sh -c "npx -y playwright@1.57.0 run-server --port 3000 --host 0.0.0.0" +docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.58.0-noble /bin/sh -c "npx -y playwright@1.58.0 run-server --port 3000 --host 0.0.0.0" ``` This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers. @@ -138,9 +138,9 @@ Once this is enabled you can open the port specified in a new browser tab and yo See [all available image tags]. We currently publish images with the following tags: -- `:v1.57.0` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.57.0-noble` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.57.0-jammy` - Playwright v1.57.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.58.0` - Playwright v1.58.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.58.0-noble` - Playwright v1.58.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.58.0-jammy` - Playwright v1.58.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). :::note @@ -164,7 +164,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers] ```Dockerfile FROM node:20-bookworm -RUN npx -y playwright@1.57.0 install --with-deps +RUN npx -y playwright@1.58.0 install --with-deps ``` @@ -201,6 +201,7 @@ RUN npx -y playwright@1.57.0 install --with-deps [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/downloads.mdx b/nodejs/docs/downloads.mdx index 6c718242a26..82abba533c2 100644 --- a/nodejs/docs/downloads.mdx +++ b/nodejs/docs/downloads.mdx @@ -78,6 +78,7 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/emulation.mdx b/nodejs/docs/emulation.mdx index 3027d5c085c..d2e25119f5d 100644 --- a/nodejs/docs/emulation.mdx +++ b/nodejs/docs/emulation.mdx @@ -628,6 +628,7 @@ const context = await browser.newContext({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/evaluating.mdx b/nodejs/docs/evaluating.mdx index bf905a66d5a..d391a59e698 100644 --- a/nodejs/docs/evaluating.mdx +++ b/nodejs/docs/evaluating.mdx @@ -171,6 +171,7 @@ test.beforeEach(async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/events.mdx b/nodejs/docs/events.mdx index bf1cc813d0f..89078f875fd 100644 --- a/nodejs/docs/events.mdx +++ b/nodejs/docs/events.mdx @@ -91,6 +91,7 @@ await page.evaluate("prompt('Enter a number:')"); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/extensibility.mdx b/nodejs/docs/extensibility.mdx index ed0f2eed754..f1bb876f51c 100644 --- a/nodejs/docs/extensibility.mdx +++ b/nodejs/docs/extensibility.mdx @@ -98,6 +98,7 @@ test('selector engine test', async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/frames.mdx b/nodejs/docs/frames.mdx index be2073fac3a..beb4286b3c4 100644 --- a/nodejs/docs/frames.mdx +++ b/nodejs/docs/frames.mdx @@ -67,6 +67,7 @@ await frame.fill('#username-input', 'John'); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/getting-started-vscode.mdx b/nodejs/docs/getting-started-vscode.mdx index f599664a282..2f3acf27c20 100644 --- a/nodejs/docs/getting-started-vscode.mdx +++ b/nodejs/docs/getting-started-vscode.mdx @@ -177,6 +177,7 @@ If you have multiple `playwright.config.ts` files, you can switch between them u [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/handles.mdx b/nodejs/docs/handles.mdx index d2f37d6070a..ac04b1f9312 100644 --- a/nodejs/docs/handles.mdx +++ b/nodejs/docs/handles.mdx @@ -151,6 +151,7 @@ await locator.click(); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/input.mdx b/nodejs/docs/input.mdx index 923e4bb530a..f7205dde1d0 100644 --- a/nodejs/docs/input.mdx +++ b/nodejs/docs/input.mdx @@ -298,6 +298,7 @@ await page.getByTestId('scrolling-container').evaluate(e => e.scrollTop += 100); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/intro.mdx b/nodejs/docs/intro.mdx index 62ab626b180..7b7842a18d4 100644 --- a/nodejs/docs/intro.mdx +++ b/nodejs/docs/intro.mdx @@ -303,6 +303,7 @@ pnpm exec playwright --version [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/languages.mdx b/nodejs/docs/languages.mdx index bfe63c9f2a7..2c74e6459bc 100644 --- a/nodejs/docs/languages.mdx +++ b/nodejs/docs/languages.mdx @@ -68,6 +68,7 @@ Playwright for .NET comes with MSTest, NUnit, xUnit, and xUnit v3 [base classes] [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/library.mdx b/nodejs/docs/library.mdx index d01a5464cd2..a355947e1cc 100644 --- a/nodejs/docs/library.mdx +++ b/nodejs/docs/library.mdx @@ -455,6 +455,7 @@ let page: import('playwright').Page; [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/locators.mdx b/nodejs/docs/locators.mdx index f80f9209fc1..017a3649460 100644 --- a/nodejs/docs/locators.mdx +++ b/nodejs/docs/locators.mdx @@ -949,6 +949,7 @@ For less commonly used locators, look at the [other locators](./other-locators.m [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/mock-browser.mdx b/nodejs/docs/mock-browser.mdx index 1b91f069e9c..85fe84f4e59 100644 --- a/nodejs/docs/mock-browser.mdx +++ b/nodejs/docs/mock-browser.mdx @@ -198,6 +198,7 @@ test('update battery status (no golden)', async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/mock.mdx b/nodejs/docs/mock.mdx index fbb2fd2e2d5..1c5badec2d0 100644 --- a/nodejs/docs/mock.mdx +++ b/nodejs/docs/mock.mdx @@ -201,6 +201,7 @@ For more details, see [WebSocketRoute]. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/navigations.mdx b/nodejs/docs/navigations.mdx index 47680b551eb..ffb7a600444 100644 --- a/nodejs/docs/navigations.mdx +++ b/nodejs/docs/navigations.mdx @@ -110,6 +110,7 @@ Playwright splits the process of showing a new document in a page into **navigat [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/network.mdx b/nodejs/docs/network.mdx index 40608a2a90f..f144d41ebd3 100644 --- a/nodejs/docs/network.mdx +++ b/nodejs/docs/network.mdx @@ -375,6 +375,7 @@ If you're interested in not solely using Service Workers for testing and network [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/other-locators.mdx b/nodejs/docs/other-locators.mdx index bf0b94ee805..092953389d5 100644 --- a/nodejs/docs/other-locators.mdx +++ b/nodejs/docs/other-locators.mdx @@ -222,85 +222,6 @@ Alternatively, if you cannot find a suitable locator for the parent element, use const parent = page.getByText('Hello').locator('xpath=..'); ``` -## React locator - -:::note - -React locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -React locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In React locator, component names are transcribed with **CamelCase**. - -```js -await page.locator('_react=BookItem').click(); -``` - -More examples: -- match by **component**: `_react=BookItem` -- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]` -- match by component and **truthy property value**: `_react=MyButton[enabled]` -- match by component and **boolean value**: `_react=MyButton[enabled = false]` -- match by property **value substring**: `_react=[author *= "King"]` -- match by component and **multiple properties**: `_react=BookItem[author *= "king" i][year = 1990]` -- match by **nested** property value: `_react=[some.nested.value = 12]` -- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]` -- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]` -- match by component and **key**: `_react=BookItem[key = '2']` -- match by property value **regex**: `_react=[author = /Steven(\\s+King)?/i]` - -To find React element names in a tree use [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi). - -:::note - -React locator supports React 15 and above. -::: - -:::note -React locator, as well as [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - -## Vue locator - -:::note - -Vue locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -Vue locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In Vue locator, component names are transcribed with **kebab-case**. - -```js -await page.locator('_vue=book-item').click(); -``` - -More examples: -- match by **component**: `_vue=book-item` -- match by component and **exact property value**, case-sensitive: `_vue=book-item[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_vue=[author = "steven king" i]` -- match by component and **truthy property value**: `_vue=my-button[enabled]` -- match by component and **boolean value**: `_vue=my-button[enabled = false]` -- match by property **value substring**: `_vue=[author *= "King"]` -- match by component and **multiple properties**: `_vue=book-item[author *= "king" i][year = 1990]` -- match by **nested** property value: `_vue=[some.nested.value = 12]` -- match by component and property value **prefix**: `_vue=book-item[author ^= "Steven"]` -- match by component and property value **suffix**: `_vue=book-item[author $= "Steven"]` -- match by property value **regex**: `_vue=[author = /Steven(\\s+King)?/i]` - -To find Vue element names in a tree use [Vue DevTools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en). - -:::note - -Vue locator supports Vue2 and above. -::: - -:::note -Vue locator, as well as [Vue DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - ## XPath locator :::warning @@ -507,6 +428,7 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/pages.mdx b/nodejs/docs/pages.mdx index e6fe007a765..a32c565c46d 100644 --- a/nodejs/docs/pages.mdx +++ b/nodejs/docs/pages.mdx @@ -124,6 +124,7 @@ page.on('popup', async popup => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/pom.mdx b/nodejs/docs/pom.mdx index b2e7398f23b..9e5541d9c2e 100644 --- a/nodejs/docs/pom.mdx +++ b/nodejs/docs/pom.mdx @@ -200,6 +200,7 @@ await expect(playwrightDev.tocList).toHaveText([ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/protractor.mdx b/nodejs/docs/protractor.mdx index c46a73becca..e55b9131c65 100644 --- a/nodejs/docs/protractor.mdx +++ b/nodejs/docs/protractor.mdx @@ -200,6 +200,7 @@ Learn more about Playwright Test runner: [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/puppeteer.mdx b/nodejs/docs/puppeteer.mdx index 53810f6e7b7..702f4ffdce2 100644 --- a/nodejs/docs/puppeteer.mdx +++ b/nodejs/docs/puppeteer.mdx @@ -205,6 +205,7 @@ Learn more about Playwright Test runner: [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx index e0b9e6179ba..9e850c9b626 100644 --- a/nodejs/docs/release-notes.mdx +++ b/nodejs/docs/release-notes.mdx @@ -2810,7 +2810,7 @@ await locator.click(); Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -2819,7 +2819,7 @@ await page.locator('_react=SubmitButton[enabled=true]').click(); await page.locator('_vue=submit-button[enabled=true]').click(); ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. @@ -3195,6 +3195,7 @@ This version of Playwright was also tested against the following stable channels [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/running-tests.mdx b/nodejs/docs/running-tests.mdx index 06cb7ba5596..60ad9137b96 100644 --- a/nodejs/docs/running-tests.mdx +++ b/nodejs/docs/running-tests.mdx @@ -205,6 +205,7 @@ You can filter and search for tests as well as click on each test to see the tes [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/screenshots.mdx b/nodejs/docs/screenshots.mdx index ecfa6bc12fa..91f913c6bbc 100644 --- a/nodejs/docs/screenshots.mdx +++ b/nodejs/docs/screenshots.mdx @@ -75,6 +75,7 @@ await page.locator('.header').screenshot({ path: 'screenshot.png' }); [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/selenium-grid.mdx b/nodejs/docs/selenium-grid.mdx index 27b453330df..5a0a41842d2 100644 --- a/nodejs/docs/selenium-grid.mdx +++ b/nodejs/docs/selenium-grid.mdx @@ -157,6 +157,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/service-workers.mdx b/nodejs/docs/service-workers.mdx index a88f0bf656a..a613b74d717 100644 --- a/nodejs/docs/service-workers.mdx +++ b/nodejs/docs/service-workers.mdx @@ -163,6 +163,7 @@ Requests for updated Service Worker main script code currently cannot be routed [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-agents.mdx b/nodejs/docs/test-agents.mdx index cc59f03d0c0..381361eed2f 100644 --- a/nodejs/docs/test-agents.mdx +++ b/nodejs/docs/test-agents.mdx @@ -287,6 +287,7 @@ Seed tests provide a ready-to-use `page` context to bootstrap execution. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-annotations.mdx b/nodejs/docs/test-annotations.mdx index ce3c103295c..4c124037488 100644 --- a/nodejs/docs/test-annotations.mdx +++ b/nodejs/docs/test-annotations.mdx @@ -351,6 +351,7 @@ test('example test', async ({ page, browser }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-assertions.mdx b/nodejs/docs/test-assertions.mdx index 631f1f34bb8..749e8bd57c7 100644 --- a/nodejs/docs/test-assertions.mdx +++ b/nodejs/docs/test-assertions.mdx @@ -393,6 +393,7 @@ test('passes', async ({ database }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-cli.mdx b/nodejs/docs/test-cli.mdx index 2ef65fb26bb..8aaeec4b990 100644 --- a/nodejs/docs/test-cli.mdx +++ b/nodejs/docs/test-cli.mdx @@ -363,6 +363,7 @@ npx playwright clear-cache [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-components.mdx b/nodejs/docs/test-components.mdx index 95af452210d..73c246f1b3d 100644 --- a/nodejs/docs/test-components.mdx +++ b/nodejs/docs/test-components.mdx @@ -891,6 +891,7 @@ Accessing a component's internal methods or its instance within test code is nei [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-configuration.mdx b/nodejs/docs/test-configuration.mdx index 597ebdbbd8f..e97413d59ca 100644 --- a/nodejs/docs/test-configuration.mdx +++ b/nodejs/docs/test-configuration.mdx @@ -187,6 +187,7 @@ export default defineConfig({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-fixtures.mdx b/nodejs/docs/test-fixtures.mdx index 5a99d045d70..54b7fd49080 100644 --- a/nodejs/docs/test-fixtures.mdx +++ b/nodejs/docs/test-fixtures.mdx @@ -890,6 +890,7 @@ Note that the fixtures will still run once per [worker process](./test-parallel. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-global-setup-teardown.mdx b/nodejs/docs/test-global-setup-teardown.mdx index 8414a7a96a4..292955d8bd3 100644 --- a/nodejs/docs/test-global-setup-teardown.mdx +++ b/nodejs/docs/test-global-setup-teardown.mdx @@ -308,6 +308,7 @@ export default globalSetup; [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-parallel.mdx b/nodejs/docs/test-parallel.mdx index cef7dc04e77..81b3483127d 100644 --- a/nodejs/docs/test-parallel.mdx +++ b/nodejs/docs/test-parallel.mdx @@ -316,6 +316,7 @@ Do not define your tests directly in a helper file. This could lead to unexpecte [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-parameterize.mdx b/nodejs/docs/test-parameterize.mdx index 0a164ce8a7a..caa783e4b25 100644 --- a/nodejs/docs/test-parameterize.mdx +++ b/nodejs/docs/test-parameterize.mdx @@ -453,6 +453,7 @@ for (const record of records) { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-projects.mdx b/nodejs/docs/test-projects.mdx index 0a20022243b..11e228fe413 100644 --- a/nodejs/docs/test-projects.mdx +++ b/nodejs/docs/test-projects.mdx @@ -260,6 +260,7 @@ Projects can be also used to parametrize tests with your custom configuration - [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-reporters.mdx b/nodejs/docs/test-reporters.mdx index 703d330d8dd..ea1220db44f 100644 --- a/nodejs/docs/test-reporters.mdx +++ b/nodejs/docs/test-reporters.mdx @@ -531,6 +531,7 @@ Here's a short list of open source reporter implementations that you can take a [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-retries.mdx b/nodejs/docs/test-retries.mdx index 92f13d63369..35168695730 100644 --- a/nodejs/docs/test-retries.mdx +++ b/nodejs/docs/test-retries.mdx @@ -276,6 +276,7 @@ test('runs second', async () => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-sharding.mdx b/nodejs/docs/test-sharding.mdx index cfc3e82b1e6..50922f265aa 100644 --- a/nodejs/docs/test-sharding.mdx +++ b/nodejs/docs/test-sharding.mdx @@ -243,6 +243,7 @@ Supported options: [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-snapshots.mdx b/nodejs/docs/test-snapshots.mdx index f0bfe058573..9fc1bd28fc5 100644 --- a/nodejs/docs/test-snapshots.mdx +++ b/nodejs/docs/test-snapshots.mdx @@ -173,6 +173,7 @@ Snapshots are stored next to the test file, in a separate directory. For example [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-timeouts.mdx b/nodejs/docs/test-timeouts.mdx index 91912dba981..d2a559db00f 100644 --- a/nodejs/docs/test-timeouts.mdx +++ b/nodejs/docs/test-timeouts.mdx @@ -244,6 +244,7 @@ API reference: [test.extend()](/api/class-test.mdx#test-extend). [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-typescript.mdx b/nodejs/docs/test-typescript.mdx index eb9cc49fcc9..27ece058605 100644 --- a/nodejs/docs/test-typescript.mdx +++ b/nodejs/docs/test-typescript.mdx @@ -172,6 +172,7 @@ Then `npm run test` will build the tests and run them. [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-ui-mode.mdx b/nodejs/docs/test-ui-mode.mdx index 5c80d026ef1..b910d4f0a53 100644 --- a/nodejs/docs/test-ui-mode.mdx +++ b/nodejs/docs/test-ui-mode.mdx @@ -164,6 +164,7 @@ Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your tr [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-use-options.mdx b/nodejs/docs/test-use-options.mdx index a0e452978ab..74540a81ebb 100644 --- a/nodejs/docs/test-use-options.mdx +++ b/nodejs/docs/test-use-options.mdx @@ -381,6 +381,7 @@ test('no base url', async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/test-webserver.mdx b/nodejs/docs/test-webserver.mdx index 94839ab970a..3bdf84f3f5d 100644 --- a/nodejs/docs/test-webserver.mdx +++ b/nodejs/docs/test-webserver.mdx @@ -165,6 +165,7 @@ export default defineConfig({ [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/testing-library.mdx b/nodejs/docs/testing-library.mdx index b35111e9fbb..aa02dfa3bf4 100644 --- a/nodejs/docs/testing-library.mdx +++ b/nodejs/docs/testing-library.mdx @@ -188,6 +188,7 @@ Learn more about Playwright Test runner: [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/touch-events.mdx b/nodejs/docs/touch-events.mdx index c7501a94825..dbea4d83e48 100644 --- a/nodejs/docs/touch-events.mdx +++ b/nodejs/docs/touch-events.mdx @@ -176,6 +176,7 @@ test(`pinch in gesture to zoom out the map`, async ({ page }) => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/trace-viewer-intro.mdx b/nodejs/docs/trace-viewer-intro.mdx index 9b5b1315321..183c4e1e55e 100644 --- a/nodejs/docs/trace-viewer-intro.mdx +++ b/nodejs/docs/trace-viewer-intro.mdx @@ -108,6 +108,7 @@ To learn more about traces, check out our detailed guide on [Trace Viewer](/trac [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/trace-viewer.mdx b/nodejs/docs/trace-viewer.mdx index d37b31739ad..aeb98ff0f48 100644 --- a/nodejs/docs/trace-viewer.mdx +++ b/nodejs/docs/trace-viewer.mdx @@ -245,6 +245,7 @@ The "Attachments" tab allows you to explore attachments. If you're doing [visual [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/videos.mdx b/nodejs/docs/videos.mdx index dfe44e93982..008ec457255 100644 --- a/nodejs/docs/videos.mdx +++ b/nodejs/docs/videos.mdx @@ -136,6 +136,7 @@ Note that the video is only available after the page or browser context is close [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/webview2.mdx b/nodejs/docs/webview2.mdx index 9cb66f8aacf..ee885bf612b 100644 --- a/nodejs/docs/webview2.mdx +++ b/nodejs/docs/webview2.mdx @@ -151,6 +151,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/nodejs/docs/writing-tests.mdx b/nodejs/docs/writing-tests.mdx index a6f85bef237..bd58503ceaf 100644 --- a/nodejs/docs/writing-tests.mdx +++ b/nodejs/docs/writing-tests.mdx @@ -204,6 +204,7 @@ test.describe('navigation', () => { [Logger]: /api/class-logger.mdx "Logger" [Mouse]: /api/class-mouse.mdx "Mouse" [Page]: /api/class-page.mdx "Page" +[PageAgent]: /api/class-pageagent.mdx "PageAgent" [PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" [Playwright]: /api/class-playwright.mdx "Playwright" [PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" diff --git a/python/docs/other-locators.mdx b/python/docs/other-locators.mdx index 92b1b7ae1cd..0713cac44ba 100644 --- a/python/docs/other-locators.mdx +++ b/python/docs/other-locators.mdx @@ -497,125 +497,6 @@ parent = page.get_by_text("Hello").locator('xpath=..') -## React locator - -:::note - -React locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -React locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In React locator, component names are transcribed with **CamelCase**. - - - - -```py -page.locator("_react=BookItem").click() -``` - - - - -```py -await page.locator("_react=BookItem").click() -``` - - - - -More examples: -- match by **component**: `_react=BookItem` -- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]` -- match by component and **truthy property value**: `_react=MyButton[enabled]` -- match by component and **boolean value**: `_react=MyButton[enabled = false]` -- match by property **value substring**: `_react=[author *= "King"]` -- match by component and **multiple properties**: `_react=BookItem[author *= "king" i][year = 1990]` -- match by **nested** property value: `_react=[some.nested.value = 12]` -- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]` -- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]` -- match by component and **key**: `_react=BookItem[key = '2']` -- match by property value **regex**: `_react=[author = /Steven(\\s+King)?/i]` - -To find React element names in a tree use [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi). - -:::note - -React locator supports React 15 and above. -::: - -:::note -React locator, as well as [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - -## Vue locator - -:::note - -Vue locator is experimental and prefixed with `_`. The functionality might change in future. -::: - -Vue locator allows finding elements by their component name and property values. The syntax is very similar to [CSS attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all CSS attribute selector operators. - -In Vue locator, component names are transcribed with **kebab-case**. - - - - -```py -page.locator("_vue=book-item").click() -``` - - - - -```py -await page.locator("_vue=book-item").click() -``` - - - - -More examples: -- match by **component**: `_vue=book-item` -- match by component and **exact property value**, case-sensitive: `_vue=book-item[author = "Steven King"]` -- match by property value only, **case-insensitive**: `_vue=[author = "steven king" i]` -- match by component and **truthy property value**: `_vue=my-button[enabled]` -- match by component and **boolean value**: `_vue=my-button[enabled = false]` -- match by property **value substring**: `_vue=[author *= "King"]` -- match by component and **multiple properties**: `_vue=book-item[author *= "king" i][year = 1990]` -- match by **nested** property value: `_vue=[some.nested.value = 12]` -- match by component and property value **prefix**: `_vue=book-item[author ^= "Steven"]` -- match by component and property value **suffix**: `_vue=book-item[author $= "Steven"]` -- match by property value **regex**: `_vue=[author = /Steven(\\s+King)?/i]` - -To find Vue element names in a tree use [Vue DevTools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en). - -:::note - -Vue locator supports Vue2 and above. -::: - -:::note -Vue locator, as well as [Vue DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi), only work against **unminified** application builds. -::: - ## XPath locator :::warning diff --git a/python/docs/release-notes.mdx b/python/docs/release-notes.mdx index 4e812e15f85..cc7f23258e7 100644 --- a/python/docs/release-notes.mdx +++ b/python/docs/release-notes.mdx @@ -1678,7 +1678,7 @@ locator.click() Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1687,7 +1687,7 @@ page.locator("_react=SubmitButton[enabled=true]").click() page.locator("_vue=submit-button[enabled=true]").click() ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. diff --git a/src/api_parser.js b/src/api_parser.js index d7fc1a7fca5..0718ccb4928 100644 --- a/src/api_parser.js +++ b/src/api_parser.js @@ -93,9 +93,6 @@ class ApiParser { if (!match) throw new Error('Invalid member: ' + spec.text); const metainfo = extractMetainfo(spec); - if (metainfo.hidden) - return; - const name = match[3]; let returnType = null; let optional = false; @@ -128,6 +125,8 @@ class ApiParser { const clazz = /** @type {docs.Class} */(this.classes.get(match[2])); if (!clazz) throw new Error(`Unknown class ${match[2]} for member: ` + spec.text); + if (metainfo.hidden) + return; const existingMember = clazz.membersArray.find(m => m.name === name && m.kind === member.kind); if (existingMember && isTypeOverride(existingMember, member)) { @@ -147,9 +146,6 @@ class ApiParser { const match = spec.text.match(/(param|option): (.*)/); if (!match) throw `Something went wrong with matching ${spec.text}`; - const metainfo = extractMetainfo(spec); - if (metainfo.hidden) - return null; // For "test.describe.only.title": // - className is "test"