diff --git a/dotnet/docs/actionability.mdx b/dotnet/docs/actionability.mdx index a8accf11ce..adf06b018d 100644 --- a/dotnet/docs/actionability.mdx +++ b/dotnet/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [Expect(Locator).ToHaveAttributeAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [Expect(Locator).ToHaveClassAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [Expect(Locator).ToHaveCountAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [Expect(Locator).ToHaveIdAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [Expect(Locator).ToHaveJSPropertyAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx index d44e785d43..c5c1a16114 100644 --- a/dotnet/docs/api/class-browsertype.mdx +++ b/dotnet/docs/api/class-browsertype.mdx @@ -116,6 +116,9 @@ var page = defaultContext.Pages[0]; - `Headers` [IDictionary]?<[string], [string]> *(optional)* Added in: v1.11# Additional HTTP headers to be sent with connect request. Optional. + - `IsLocal` [bool]? *(optional)* Added in: v1.58# + + Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely upon the file system being the same between Playwright and the Browser. - `SlowMo` [float]? *(optional)* Added in: v1.11# Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0. diff --git a/dotnet/docs/api/class-locator.mdx b/dotnet/docs/api/class-locator.mdx index 3126ed6cdb..731b0c27c3 100644 --- a/dotnet/docs/api/class-locator.mdx +++ b/dotnet/docs/api/class-locator.mdx @@ -555,7 +555,7 @@ await button.ClickAsync(); Added in: v1.57locator.Description -Returns locator description previously set with [Locator.Describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available. +Returns locator description previously set with [Locator.Describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. **Usage** diff --git a/dotnet/docs/api/class-locatorassertions.mdx b/dotnet/docs/api/class-locatorassertions.mdx index 19d688f04f..ff0fd74174 100644 --- a/dotnet/docs/api/class-locatorassertions.mdx +++ b/dotnet/docs/api/class-locatorassertions.mdx @@ -609,7 +609,7 @@ await Expect(locator).ToHaveCountAsync(3); --- -### ToHaveCSSAsync {#locator-assertions-to-have-css} +### ToHaveCSSAsync {#locator-assertions-to-have-css-1} Added in: v1.20locatorAssertions.ToHaveCSSAsync @@ -623,19 +623,19 @@ await Expect(locator).ToHaveCSSAsync("display", "flex"); ``` **Arguments** -- `name` [string] Added in: v1.18# +- `name` [string] Added in: v1.18# CSS property name. -- `value` [string] | [Regex] Added in: v1.18# +- `value` [string] | [Regex] Added in: v1.18# CSS property value. - `options` `LocatorAssertionsToHaveCSSOptions?` *(optional)* - - `Timeout` [float]? *(optional)* Added in: v1.18# + - `Timeout` [float]? *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/dotnet/docs/api/class-route.mdx b/dotnet/docs/api/class-route.mdx index 4c9217f86e..2150752d31 100644 --- a/dotnet/docs/api/class-route.mdx +++ b/dotnet/docs/api/class-route.mdx @@ -95,7 +95,9 @@ The [Headers](/api/class-route.mdx#route-continue-option-headers) option applies :::warning -The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [BrowserContext.AddCookiesAsync()](/api/class-browsercontext.mdx#browser-context-add-cookies). +Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`, `Content-Length` and others, see [this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an override is provided for a forbidden header, it will be ignored and the original request header will be used. + +To set custom cookies, use [BrowserContext.AddCookiesAsync()](/api/class-browsercontext.mdx#browser-context-add-cookies). ::: --- diff --git a/dotnet/docs/test-assertions.mdx b/dotnet/docs/test-assertions.mdx index 7b84ee2c5f..ebfe9091a4 100644 --- a/dotnet/docs/test-assertions.mdx +++ b/dotnet/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [Expect(Locator).ToHaveAttributeAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [Expect(Locator).ToHaveClassAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [Expect(Locator).ToHaveCountAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [Expect(Locator).ToHaveIdAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [Expect(Locator).ToHaveJSPropertyAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [Expect(Locator).ToHaveRoleAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/images/speedboard-shards.png b/images/speedboard-shards.png new file mode 100644 index 0000000000..3b39ccb2b1 Binary files /dev/null and b/images/speedboard-shards.png differ diff --git a/java/docs/actionability.mdx b/java/docs/actionability.mdx index b56e820111..28854b57b0 100644 --- a/java/docs/actionability.mdx +++ b/java/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [assertThat(locator).hasAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [assertThat(locator).hasClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [assertThat(locator).hasCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [assertThat(locator).hasId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [assertThat(locator).hasJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/java/docs/api/class-browsertype.mdx b/java/docs/api/class-browsertype.mdx index c830fe70c1..08bcceedce 100644 --- a/java/docs/api/class-browsertype.mdx +++ b/java/docs/api/class-browsertype.mdx @@ -115,6 +115,9 @@ Page page = defaultContext.pages().get(0); - `setHeaders` [Map]<[String], [String]> *(optional)* Added in: v1.11# Additional HTTP headers to be sent with connect request. Optional. + - `setIsLocal` [boolean] *(optional)* Added in: v1.58# + + Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely upon the file system being the same between Playwright and the Browser. - `setSlowMo` [double] *(optional)* Added in: v1.11# Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0. diff --git a/java/docs/api/class-locator.mdx b/java/docs/api/class-locator.mdx index 580a413b7e..fd9468f973 100644 --- a/java/docs/api/class-locator.mdx +++ b/java/docs/api/class-locator.mdx @@ -556,7 +556,7 @@ button.click(); Added in: v1.57locator.description -Returns locator description previously set with [Locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available. +Returns locator description previously set with [Locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. **Usage** diff --git a/java/docs/api/class-locatorassertions.mdx b/java/docs/api/class-locatorassertions.mdx index 53e31f6e3c..44c95d0dbb 100644 --- a/java/docs/api/class-locatorassertions.mdx +++ b/java/docs/api/class-locatorassertions.mdx @@ -328,7 +328,7 @@ assertThat(page.locator("list > .component")).hasCount(3); --- -### hasCSS {#locator-assertions-to-have-css} +### hasCSS {#locator-assertions-to-have-css-1} Added in: v1.20locatorAssertions.hasCSS @@ -341,19 +341,19 @@ assertThat(page.getByRole(AriaRole.BUTTON)).hasCSS("display", "flex"); ``` **Arguments** -- `name` [String] Added in: v1.18# +- `name` [String] Added in: v1.18# CSS property name. -- `value` [String] | [Pattern] Added in: v1.18# +- `value` [String] | [Pattern] Added in: v1.18# CSS property value. - `options` `LocatorAssertions.HasCSSOptions` *(optional)* - - `setTimeout` [double] *(optional)* Added in: v1.18# + - `setTimeout` [double] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/java/docs/api/class-route.mdx b/java/docs/api/class-route.mdx index a50646b90a..db2a6c9a3a 100644 --- a/java/docs/api/class-route.mdx +++ b/java/docs/api/class-route.mdx @@ -307,7 +307,9 @@ The [setHeaders](/api/class-route.mdx#route-continue-option-headers) option appl :::warning -The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [BrowserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). +Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`, `Content-Length` and others, see [this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an override is provided for a forbidden header, it will be ignored and the original request header will be used. + +To set custom cookies, use [BrowserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). ::: diff --git a/java/docs/intro.mdx b/java/docs/intro.mdx index c987e6efcd..9635207443 100644 --- a/java/docs/intro.mdx +++ b/java/docs/intro.mdx @@ -82,7 +82,7 @@ public class App { -With the Example.java and pom.xml above, compile and execute your new program as follows: +With the App.java and pom.xml above, compile and execute your new program as follows: ```bash mvn compile exec:java -D exec.mainClass="org.example.App" diff --git a/java/docs/locators.mdx b/java/docs/locators.mdx index 4754e740bc..904a7f0da0 100644 --- a/java/docs/locators.mdx +++ b/java/docs/locators.mdx @@ -545,9 +545,9 @@ The filtering locator **must be relative** to the original locator and is querie assertThat(page .getByRole(AriaRole.LISTITEM) .filter(new Locator.FilterOptions() - .setHas(page.GetByRole(AriaRole.LIST) - .GetByRole(AriaRole.HEADING, - new Page.GetByRoleOptions().setName("Product 2"))))) + .setHas(page.getByRole(AriaRole.LIST) + .getByRole(AriaRole.HEADING, + new Locator.GetByRoleOptions().setName("Product 2"))))) .hasCount(1); ``` diff --git a/java/docs/test-assertions.mdx b/java/docs/test-assertions.mdx index 88dc40b867..42a2c02ab0 100644 --- a/java/docs/test-assertions.mdx +++ b/java/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [assertThat(locator).hasAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [assertThat(locator).hasClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [assertThat(locator).hasCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [assertThat(locator).hasId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [assertThat(locator).hasJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [assertThat(locator).hasRole()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/nodejs/docs/accessibility-testing.mdx b/nodejs/docs/accessibility-testing.mdx index 9b8f0b6fb0..91bb75a3a1 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 e72c40edaa..e7efcafc8b 100644 --- a/nodejs/docs/actionability.mdx +++ b/nodejs/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [expect(locator).toHaveAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).toHaveClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).toHaveCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).toHaveCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [expect(locator).toHaveCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [expect(locator).toHaveId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).toHaveJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).toHaveText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | @@ -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 5072e81220..418d6fa2e4 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 5df34f8dd1..99e61844cf 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 a6ba2d859b..aefffad042 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 5b8d3393a6..0b10491cec 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 0e32f9feb6..3182aca0e5 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 ac1cc74037..d677c49b59 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 96b1c5220c..52991fb2e2 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 2bfdad0740..c5fb425c6f 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 0ac972bb66..45392f4667 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 1050a54e6b..d566f1cf19 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 0ebd3e090c..a03a344383 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -168,24 +168,6 @@ If directly using this method to create [BrowserContext]s, it is best practice t - `acceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. - - `agent` [Object] *(optional)* Added in: v1.58# - - `provider` [string] - - LLM provider to use. - - `model` [string] - - Model identifier within provider. - - `cacheFile` [string] *(optional)* - - Cache file to use/generate code for performed actions into. Cache is not used if not specified (default). - - `cacheMode` ['force'] | ['ignore'] | ['auto'] *(optional)* - - Cache control, defaults to 'auto'. - - `secrets` [Object]<[string], [string]> *(optional)* - - Secrets to hide from the LLM. - - Agent settings for [page.perform()](/api/class-page.mdx#page-perform) and [page.extract()](/api/class-page.mdx#page-extract). - `baseURL` [string] *(optional)*# When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples: @@ -913,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 f168b63a53..59a69ad450 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 f636d8ba61..fb1c25d535 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 83bca58e8b..9eac5469b7 100644 --- a/nodejs/docs/api/class-browsertype.mdx +++ b/nodejs/docs/api/class-browsertype.mdx @@ -124,6 +124,9 @@ const page = defaultContext.pages()[0]; - `headers` [Object]<[string], [string]> *(optional)* Added in: v1.11# Additional HTTP headers to be sent with connect request. Optional. + - `isLocal` [boolean] *(optional)* Added in: v1.58# + + Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely upon the file system being the same between Playwright and the Browser. - `logger` [Logger] *(optional)* Added in: v1.14# :::warning[Deprecated] @@ -752,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 16a2f04d11..ac77fc9887 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 fc9247a602..27c66d833b 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 ce10419b8c..8a2f614185 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 00112c43a6..bc6fdd8b77 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 8f5d4a0881..c95d475aa2 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 520cc76461..09f0dab64b 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 8d4a4fc937..461ac06892 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 005b4b9f64..f7cc04660e 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 9c2583e93b..2b52cf7a52 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 c343795440..dad48b1c4b 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 7bf93dae00..c8bdf3266d 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 6e8c9f484b..adc5ca5c43 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 9605686033..821da2350d 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 fa00830f5f..6158aa3a16 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 29752586f3..6c900d8a97 100644 --- a/nodejs/docs/api/class-fullproject.mdx +++ b/nodejs/docs/api/class-fullproject.mdx @@ -301,6 +301,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 3a5ddfe0ef..8e2bde4fb6 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 91512d911a..e817bfb25f 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 c6e877d211..a919296583 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 0bb4c721c3..056ec87d32 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 623712ee78..384d0b0c51 100644 --- a/nodejs/docs/api/class-locator.mdx +++ b/nodejs/docs/api/class-locator.mdx @@ -557,7 +557,7 @@ await button.click(); Added in: v1.57locator.description -Returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available. +Returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. Prefer [locator.toString()](/api/class-locator.mdx#locator-to-string) for a human-readable representation, as it uses the description when available. **Usage** @@ -2330,6 +2330,23 @@ await locator.textContent(options); --- +### toString {#locator-to-string} + +Added in: v1.57locator.toString + +Returns a human-readable representation of the locator, using the [locator.description()](/api/class-locator.mdx#locator-description) if one exists; otherwise, it generates a string based on the locator's selector. + +**Usage** + +```js +locator.toString(); +``` + +**Returns** +- [string]# + +--- + ### uncheck {#locator-uncheck} Added in: v1.14locator.uncheck @@ -2552,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 9e7a3e0cdc..594c15e124 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -634,9 +634,9 @@ await expect(list).toHaveCount(3); --- -### toHaveCSS {#locator-assertions-to-have-css} +### toHaveCSS(name, value) {#locator-assertions-to-have-css-1} -Added in: v1.20locatorAssertions.toHaveCSS +Added in: v1.20locatorAssertions.toHaveCSS(name, value) Ensures the [Locator] resolves to an element with the given computed CSS style. @@ -648,19 +648,54 @@ await expect(locator).toHaveCSS('display', 'flex'); ``` **Arguments** -- `name` [string] Added in: v1.18# +- `name` [string] Added in: v1.18# CSS property name. -- `value` [string] | [RegExp] Added in: v1.18# +- `value` [string] | [RegExp] Added in: v1.18# CSS property value. - `options` [Object] *(optional)* - - `timeout` [number] *(optional)* Added in: v1.18# + - `timeout` [number] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. **Returns** -- [Promise]<[void]># +- [Promise]<[void]># + +--- + +### toHaveCSS(styles) {#locator-assertions-to-have-css-2} + +Added in: v1.58locatorAssertions.toHaveCSS(styles) + +Ensures the [Locator] resolves to an element with the given computed CSS properties. + +:::note + +The `CSSProperties` object parameter for toHaveCSS requires `react` to be installed for type checking. +::: + +**Usage** + +```js +const locator = page.getByRole('button'); +await expect(locator).toHaveCSS({ + display: 'flex', + backgroundColor: 'rgb(255, 0, 0)' +}); +``` + +**Arguments** +- `styles` [CSSProperties]# + + CSS properties object. +- `options` [Object] *(optional)* + - `timeout` [number] *(optional)*# + + Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. + +**Returns** +- [Promise]<[void]># --- @@ -1123,6 +1158,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 e291800f4b..8f6470e1ab 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 21c60e8102..43eebd33ce 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 5abd0e24f3..0dcd73857f 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -257,6 +257,57 @@ 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`. + - `maxTokens` [number] *(optional)*# + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic turns to take per call. Defaults to 10. + - `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. + - `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 @@ -701,36 +752,6 @@ const crypto = require('crypto'); --- -### extract {#page-extract} - -Added in: v1.58page.extract - -Extract information from the page using the agentic loop, return it in a given Zod format. - -**Usage** - -```js -await page.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)* - - `maxTurns` [number] *(optional)*# - - Maximum number of agentic steps to take while extracting the information. - -**Returns** -- [Promise]<[Object]># - ---- - ### frame {#page-frame} Added before v1.9page.frame @@ -1515,35 +1536,6 @@ The [format](/api/class-page.mdx#page-pdf-option-format) options are: --- -### perform {#page-perform} - -Added in: v1.58page.perform - -Perform action using agentic loop. - -**Usage** - -```js -await page.perform('Click submit button'); -``` - -**Arguments** -- `task` [string]# - - Task to perform using agentic loop. -- `options` [Object] *(optional)* - - `key` [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. - - `maxTurns` [number] *(optional)*# - - Maximum number of agentic steps to take while performing this action. - -**Returns** -- [Promise]<[void]># - ---- - ### reload {#page-reload} Added before v1.9page.reload @@ -4588,6 +4580,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 0000000000..7d3bddf5fd --- /dev/null +++ b/nodejs/docs/api/class-pageagent.mdx @@ -0,0 +1,300 @@ +--- +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. + - `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. + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic turns during this call, defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Request timeout in milliseconds. Defaults to action timeout. 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. + - `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. + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic turns during this call, defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Request timeout in milliseconds. Defaults to action timeout. 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. + - `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. + - `maxTurns` [number] *(optional)*# + + Maximum number of agentic turns during this call, defaults to context-wide value specified in `agent` property. + - `timeout` [number] *(optional)*# + + Request timeout in milliseconds. Defaults to action timeout. Pass `0` to disable timeout. + +**Returns** +- [Promise]<[Object]># + - `usage` [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 5e1bde1ddd..74e053becc 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 8f0437ad0d..b6d40a41f0 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 9be5970926..132a3987a7 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 d30824d02b..85d1fce53c 100644 --- a/nodejs/docs/api/class-reporter.mdx +++ b/nodejs/docs/api/class-reporter.mdx @@ -166,6 +166,21 @@ await reporter.onEnd(result); - `duration` [number] Test run duration in milliseconds. + - `shards` [Array]<[Object]> + - `shardIndex` [number] *(optional)* + + The index of the shard, one-based. + - `tag` [Array]<[string]> *(optional)* + + Global [testConfig.tag](/api/class-testconfig.mdx#test-config-tag) that differentiates CI environments + - `startTime` [Date] + + Start wall time of shard. + - `duration` [number] + + Shard run duration in milliseconds. + + Only present on merged reports Result of the full test run, `status` can be one of: * `'passed'` - Everything went as expected. @@ -409,6 +424,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 18b9c4b6eb..a44b77db28 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 346bca72b5..fd0541d4c9 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 f8092afc9e..d8504bb372 100644 --- a/nodejs/docs/api/class-route.mdx +++ b/nodejs/docs/api/class-route.mdx @@ -99,7 +99,9 @@ The [headers](/api/class-route.mdx#route-continue-option-headers) option applies :::warning -The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [browserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). +Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`, `Content-Length` and others, see [this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an override is provided for a forbidden header, it will be ignored and the original request header will be used. + +To set custom cookies, use [browserContext.addCookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). ::: --- @@ -343,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 1f0463565e..87f2533c85 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 cc15a3e11e..a0923964ed 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 277e25cdf1..25c38d1fcc 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 b68080aa14..be374520a1 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 194370aee3..bf283dd6c0 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 0b6c9d5045..28d39a0bad 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 @@ -1079,7 +1099,7 @@ export default defineConfig({ webServer: { command: 'npm run start', wait: { - stdout: '/Listening on port (?\\d+)/' + stdout: /Listening on port (?\d+)/ }, }, }); @@ -1135,10 +1155,10 @@ test('homepage', async ({ page }) => { - `wait` [Object] *(optional)* - `stdout` [RegExp] *(optional)* - Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. + Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - `stderr` [RegExp] *(optional)* - Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. + Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. Consider command started only when given output has been produced. - `timeout` [number] *(optional)* @@ -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 908b2b0352..dca6dd3793 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 9b396cadeb..7826b9f9b2 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 81f237a2b1..a1ea68ee1d 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 336191c2f8..b42e1b9f42 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -92,32 +92,39 @@ Learn more about [various timeouts](../test-timeouts.mdx). --- -### agent {#test-options-agent} +### agentOptions {#test-options-agent-options} -Added in: v1.58testOptions.agent - -Agent settings for [page.perform()](/api/class-page.mdx#page-perform) and [page.extract()](/api/class-page.mdx#page-extract). +Added in: v1.58testOptions.agentOptions **Usage** ```js -testOptions.agent +testOptions.agentOptions ``` **Type** - [Object] - - `provider` [string] + - `api` [string] *(optional)* + + LLM provider to use. Required in non-cache mode. + - `apiKey` [string] *(optional)* + + Key for the LLM provider. + - `apiEndpoint` [string] *(optional)* + + LLM provider endpoint. + - `model` [string] *(optional)* - LLM provider to use. - - `model` [string] + Model identifier within the provider. Required in non-cache mode. + - `cachePathTemplate` [string] *(optional)* - Model identifier within provider. - - `cacheFile` [string] *(optional)* + Cache file template to use/generate code for performed actions into. + - `maxTurns` [number] *(optional)* - Cache file to use/generate code for performed actions into. Cache is not used if not specified (default). - - `cacheMode` ['force'] | ['ignore'] | ['auto'] *(optional)* + Maximum number of agentic turns to take per call. Defaults to 10. + - `maxTokens` [number] *(optional)* - Cache control, defaults to 'auto'. + Maximum number of tokens to consume per call. The agentic loop will stop after input + output tokens exceed this value. Defaults on unlimited. - `secrets` [Object]<[string], [string]> *(optional)* Secrets to hide from the LLM. @@ -1147,6 +1154,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 bd0d80b316..d8105f1fa6 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 732d22b35f..7f36fbaf0f 100644 --- a/nodejs/docs/api/class-testresult.mdx +++ b/nodejs/docs/api/class-testresult.mdx @@ -163,6 +163,23 @@ testResult.retry --- +### shardIndex {#test-result-shard-index} + +Added in: v1.58testResult.shardIndex + +The index of the shard between `1` and [`shards`](../test-sharding.mdx). + +**Usage** + +```js +testResult.shardIndex +``` + +**Type** +- [number] + +--- + ### startTime {#test-result-start-time} Added in: v1.10testResult.startTime @@ -299,6 +316,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 b012a91ec4..b21cf96b03 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 ea57cef823..c2850787f3 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 dcdafa8fd7..859990d643 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 affa0426ed..b934a497f4 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 89507a47dc..3b01b70c5e 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 443c312dd1..23e2f05e01 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 e171e785b5..3617849b30 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 09d4af5050..3d3819042c 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 b80ad8539a..11859eec83 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 702f80b884..fd60d5888b 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 92ed01ef65..3eb8e0722b 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 a6dca0f779..6925c19c29 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 ede1747a40..3f7a142988 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 87407800c0..a4e158c45b 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 e5a9783c25..ce36f4c4ee 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 3ea6555031..07aedaf32a 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 4a4405fd2f..ea4911e04a 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 8afc154d18..795fa39aa8 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 bfc1dde810..672c480def 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 c63a4f2913..f4ae64316e 100644 --- a/nodejs/docs/ci.mdx +++ b/nodejs/docs/ci.mdx @@ -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 3317a1419a..2ae40cf979 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 a81f988397..a97b28d0ba 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 f98c388aae..32f5600b82 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 4e9402c4d8..3bc8504bab 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 861a12d0c9..f4edfc81e2 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 1fdd5d7137..efadcb502c 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -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 6c718242a2..82abba533c 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 3027d5c085..d2e25119f5 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 bf905a66d5..d391a59e69 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 bf1cc813d0..89078f875f 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 ed0f2eed75..f1bb876f51 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 be2073fac3..beb4286b3c 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 f599664a28..2f3acf27c2 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 d2f37d6070..ac04b1f931 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 923e4bb530..f7205dde1d 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 62ab626b18..7b7842a18d 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 bfe63c9f2a..2c74e6459b 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 d01a5464cd..a355947e1c 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 f80f9209fc..017a364946 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 1b91f069e9..85fe84f4e5 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 fbb2fd2e2d..1c5badec2d 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 47680b551e..ffb7a60044 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 40608a2a90..f144d41ebd 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 bf0b94ee80..9e1d9bfed4 100644 --- a/nodejs/docs/other-locators.mdx +++ b/nodejs/docs/other-locators.mdx @@ -507,6 +507,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 e6fe007a76..a32c565c46 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 b2e7398f23..9e5541d9c2 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 c46a73becc..e55b9131c6 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 53810f6e7b..702f4ffdce 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 f4bee905bf..a77011b5f2 100644 --- a/nodejs/docs/release-notes.mdx +++ b/nodejs/docs/release-notes.mdx @@ -42,7 +42,7 @@ export default defineConfig({ webServer: { command: 'npm run start', wait: { - stdout: '/Listening on port (?\\d+)/' + stdout: /Listening on port (?\d+)/ }, }, }); @@ -53,7 +53,7 @@ If you include a named capture group into the expression, then Playwright will p ```js import { test, expect } from '@playwright/test'; -test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); +test.use({ baseURL: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); test('homepage', async ({ page }) => { await page.goto('/'); @@ -69,7 +69,7 @@ After 3 years of being deprecated, we removed `page.accessibility` from our API. ### New APIs - New property [testConfig.tag](/api/class-testconfig.mdx#test-config-tag) adds a tag to all tests in this run. This is useful when using [merge-reports](./test-sharding.mdx#merging-reports-from-multiple-shards). - [worker.on('console')](/api/class-worker.mdx#worker-event-console) event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. [worker.waitForEvent()](/api/class-worker.mdx#worker-wait-for-event) can be used to wait for it. -- [locator.description()](/api/class-locator.mdx#locator-description) returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe), and `Locator.toString()` now uses the description when available. +- [locator.description()](/api/class-locator.mdx#locator-description) returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe), and [locator.toString()](/api/class-locator.mdx#locator-to-string) now uses the description when available. - New option [steps](/api/class-locator.mdx#locator-click-option-steps) in [locator.click()](/api/class-locator.mdx#locator-click) and [locator.dragTo()](/api/class-locator.mdx#locator-drag-to) that configures the number of `mousemove` events emitted while moving the mouse pointer to the target element. - Network requests issued by [Service Workers](./service-workers.mdx#network-events-and-routing) are now reported and can be routed through the [BrowserContext](./api/class-browsercontext.mdx), only in Chromium. You can opt out using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK` environment variable. - Console messages from Service Workers are dispatched through [worker.on('console')](/api/class-worker.mdx#worker-event-console). You can opt out of this using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE` environment variable. @@ -2829,7 +2829,7 @@ List of all new assertions: - [`expect(locator).toHaveAttribute(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-attribute) - [`expect(locator).toHaveClass(expected)`](./api/class-locatorassertions#locator-assertions-to-have-class) - [`expect(locator).toHaveCount(count)`](./api/class-locatorassertions#locator-assertions-to-have-count) -- [`expect(locator).toHaveCSS(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-css) +- [`expect(locator).toHaveCSS(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-css-1) - [`expect(locator).toHaveId(id)`](./api/class-locatorassertions#locator-assertions-to-have-id) - [`expect(locator).toHaveJSProperty(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-js-property) - [`expect(locator).toHaveText(expected, options)`](./api/class-locatorassertions#locator-assertions-to-have-text) @@ -3160,6 +3160,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 06cb7ba559..60ad9137b9 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 ecfa6bc12f..91f913c6bb 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 27b453330d..5a0a41842d 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 a88f0bf656..a613b74d71 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 cc59f03d0c..381361eed2 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 ce3c103295..4c12403748 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 631f1f34bb..b2b3aa5359 100644 --- a/nodejs/docs/test-assertions.mdx +++ b/nodejs/docs/test-assertions.mdx @@ -47,7 +47,7 @@ The following assertions will retry until the assertion passes, or the assertion | [await expect(locator).toHaveAttribute()](./api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [await expect(locator).toHaveClass()](./api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has specified CSS class property | | [await expect(locator).toHaveCount()](./api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [await expect(locator).toHaveCSS()](./api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [await expect(locator).toHaveCSS()](./api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [await expect(locator).toHaveId()](./api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [await expect(locator).toHaveJSProperty()](./api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [await expect(locator).toHaveRole()](./api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | @@ -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 e9ba14f9ea..a6e12bf074 100644 --- a/nodejs/docs/test-cli.mdx +++ b/nodejs/docs/test-cli.mdx @@ -351,6 +351,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 95af452210..73c246f1b3 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 597ebdbbd8..e97413d59c 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 a53c6f0efc..54b7fd4908 100644 --- a/nodejs/docs/test-fixtures.mdx +++ b/nodejs/docs/test-fixtures.mdx @@ -367,6 +367,8 @@ Playwright Test uses [worker processes](./test-parallel.mdx) to run test files. Below we'll create an `account` fixture that will be shared by all tests in the same worker, and override the `page` fixture to log in to this account for each test. To generate unique accounts, we'll use the [workerInfo.workerIndex](/api/class-workerinfo.mdx#worker-info-worker-index) that is available to any test or fixture. Note the tuple-like syntax for the worker fixture - we have to pass `{scope: 'worker'}` so that test runner sets this fixture up once per worker. +In addition to only being run once per worker, worker-scoped fixtures also get a separate timeout equal to the default test timeout. You can change it by passing the `timeout` option. See [fixture timeout](#fixture-timeout) for more details. + ```js title="my-test.ts" import { test as base } from '@playwright/test'; @@ -447,7 +449,7 @@ export { expect } from '@playwright/test'; ## Fixture timeout -By default, the fixture inherits the timeout value of the test. However, for slow fixtures, especially [worker-scoped](#worker-scoped-fixtures) ones, it is convenient to have a separate timeout. This way you can keep the overall test timeout small, and give the slow fixture more time. +Fixture is considered to be a part of a test, and so its setup and teardown running time counts towards the test timeout. Therefore, a slow fixture may cause test timeouts. You can set a separate larger timeout for such a fixture, and keep the overall test timeout small. ```js import { test as base, expect } from '@playwright/test'; @@ -464,6 +466,8 @@ test('example test', async ({ slowFixture }) => { }); ``` +Unlike regular test-scoped fixtures, each [worker-scoped](#worker-scoped-fixtures) fixture has its own timeout, equal to the test timeout. You can change the timeout for a worker-scoped fixture in the same way. + ## Fixtures-options Playwright Test supports running multiple test projects that can be configured separately. You can use "option" fixtures to make your configuration options declarative and type safe. Learn more about [parameterizing tests](./test-parameterize.mdx). @@ -886,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 8414a7a96a..292955d8bd 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 cef7dc04e7..81b3483127 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 0a164ce8a7..caa783e4b2 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 0a20022243..11e228fe41 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 703d330d8d..ea1220db44 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 92f13d6336..3516869573 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 cfc3e82b1e..ad39edfe4a 100644 --- a/nodejs/docs/test-sharding.mdx +++ b/nodejs/docs/test-sharding.mdx @@ -46,6 +46,20 @@ Without the fullyParallel setting, Playwright Test defaults to file-level granul - **Without** `fullyParallel`: Tests are split at the file level, so to balance the shards, it's important to keep your test files small and evenly sized. - To ensure the most effective use of sharding, especially in CI environments, it is recommended to use `fullyParallel: true` when aiming for balanced distribution across shards. Otherwise, you may need to manually organize your test files to avoid imbalances. +### Rebalancing Shards + +If tests in one of your shards take longer, you can manually assign less work to it using the `--shard-weights` option: + +```bash +npx playwright test --shard=x/4 --shard-weights=3:2:3:3 +``` + +Make sure you pass the same `--shard-weights` value to all shards. In this example, Shard 2 gets assigned less tests because they take longer, evening out the full duration. + +In the Speedboard section of the combined HTML report, you can see a visualisation of your individual shard durations, and a recommendation for how to set your shard weights. + +![Speedboard Shard Diagram](../images/speedboard-shards.png) + ## Merging reports from multiple shards In the previous example, each test shard has its own test report. If you want to have a combined report showing all the test results from all the shards, you can merge them. @@ -243,6 +257,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 f0bfe05857..9fc1bd28fc 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 91912dba98..d2a559db00 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 5f40834e34..27ece05860 100644 --- a/nodejs/docs/test-typescript.mdx +++ b/nodejs/docs/test-typescript.mdx @@ -51,16 +51,15 @@ playwright.config.ts ### tsconfig path mapping -Playwright supports [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) declared in the `tsconfig.json`. Make sure that `baseUrl` is also set. +Playwright supports [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) declared in the `tsconfig.json`. Here is an example `tsconfig.json` that works with Playwright: ```json title="tsconfig.json" { "compilerOptions": { - "baseUrl": ".", "paths": { - "@myhelper/*": ["packages/myhelper/*"] // This mapping is relative to "baseUrl". + "@myhelper/*": ["packages/myhelper/*"] // This mapping is relative to the tsconfig. } } } @@ -173,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 5c80d026ef..b910d4f0a5 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 a0e452978a..74540a81eb 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 c0985ec1d7..3bdf84f3f5 100644 --- a/nodejs/docs/test-webserver.mdx +++ b/nodejs/docs/test-webserver.mdx @@ -38,13 +38,13 @@ export default defineConfig({ | `gracefulShutdown` | How to shut down the process. If unspecified, the process group is forcefully `SIGKILL`ed. If set to `{ signal: 'SIGTERM', timeout: 500 }`, the process group is sent a `SIGTERM` signal, followed by `SIGKILL` if it doesn't exit within 500ms. You can also use `SIGINT` as the signal instead. A `0` timeout means no `SIGKILL` will be sent. Windows doesn't support `SIGTERM` and `SIGINT` signals, so this option is ignored on Windows. Note that shutting down a Docker container requires `SIGTERM`. | | `ignoreHTTPSErrors` | Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`. | | `name` | Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`. | -| `port` | **Deprecated**. User `url` instead. The port that your http server is expected to appear on. It does wait until it accepts connections. Either `port` or `url` should be specified. | +| `port` | **Deprecated**. Use `url` instead. The port that your http server is expected to appear on. It does wait until it accepts connections. Either `port` or `url` should be specified. | | `reuseExistingServer`| If `true`, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally. | | `stderr` | Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. | | `stdout` | If `"pipe"`, it will pipe the stdout of the command to the process stdout. If `"ignore"`, it will ignore the stdout of the command. Default to `"ignore"`. | | `timeout` | How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. | | `url`| URL of your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Either `port` or `url` should be specified. | -| `wait` | Consider command started only when given output has been produced. Takes an object with optional `stdout` and/or `stderr` regular expressions. Named capture groups in the regex are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. | +| `wait` | Consider command started only when given output has been produced. Takes an object with optional `stdout` and/or `stderr` regular expressions. Named capture groups in the regex are stored in the environment, for example `/Listening on port (?\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. | ## Adding a server timeout @@ -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 b35111e9fb..aa02dfa3bf 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 c7501a9482..dbea4d83e4 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 9b5b131532..183c4e1e55 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 d37b31739a..aeb98ff0f4 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 dfe44e9398..008ec45725 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 9cb66f8aac..ee885bf612 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 a6f85bef23..bd58503cea 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/actionability.mdx b/python/docs/actionability.mdx index 0e579fcbbf..c473f87fc0 100644 --- a/python/docs/actionability.mdx +++ b/python/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [expect(locator).to_have_attribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).to_have_class()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).to_have_count()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [expect(locator).to_have_id()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).to_have_js_property()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).to_have_text()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/python/docs/api/class-browsertype.mdx b/python/docs/api/class-browsertype.mdx index 60287b0f5c..38c909a7e8 100644 --- a/python/docs/api/class-browsertype.mdx +++ b/python/docs/api/class-browsertype.mdx @@ -167,6 +167,9 @@ page = default_context.pages[0] - `headers` [Dict]\[[str], [str]\] *(optional)* Added in: v1.11# Additional HTTP headers to be sent with connect request. Optional. +- `is_local` [bool] *(optional)* Added in: v1.58# + + Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely upon the file system being the same between Playwright and the Browser. - `slow_mo` [float] *(optional)* Added in: v1.11# Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0. diff --git a/python/docs/api/class-locator.mdx b/python/docs/api/class-locator.mdx index dcdf23e3e0..e24ae4b56d 100644 --- a/python/docs/api/class-locator.mdx +++ b/python/docs/api/class-locator.mdx @@ -3324,7 +3324,7 @@ await frame_locator.get_by_role("button").click() Added in: v1.57locator.description -Returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available. +Returns locator description previously set with [locator.describe()](/api/class-locator.mdx#locator-describe). Returns `null` if no custom description has been set. **Usage** diff --git a/python/docs/api/class-locatorassertions.mdx b/python/docs/api/class-locatorassertions.mdx index 5f11b446be..e31712ee5d 100644 --- a/python/docs/api/class-locatorassertions.mdx +++ b/python/docs/api/class-locatorassertions.mdx @@ -516,7 +516,7 @@ expect(locator).not_to_have_count(count, **kwargs) Added in: v1.20locatorAssertions.not_to_have_css -The opposite of [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css). +The opposite of [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1). **Usage** @@ -1822,7 +1822,7 @@ await expect(locator).to_have_count(3) --- -### to_have_css {#locator-assertions-to-have-css} +### to_have_css {#locator-assertions-to-have-css-1} Added in: v1.20locatorAssertions.to_have_css @@ -1861,18 +1861,18 @@ await expect(locator).to_have_css("display", "flex") **Arguments** -- `name` [str] Added in: v1.18# +- `name` [str] Added in: v1.18# CSS property name. -- `value` [str] | [Pattern] Added in: v1.18# +- `value` [str] | [Pattern] Added in: v1.18# CSS property value. -- `timeout` [float] *(optional)* Added in: v1.18# +- `timeout` [float] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [NoneType]# +- [NoneType]# --- diff --git a/python/docs/api/class-route.mdx b/python/docs/api/class-route.mdx index 652f2b46ce..74c0962ed5 100644 --- a/python/docs/api/class-route.mdx +++ b/python/docs/api/class-route.mdx @@ -128,7 +128,9 @@ The [headers](/api/class-route.mdx#route-continue-option-headers) option applies :::warning -The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [browser_context.add_cookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). +Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`, `Content-Length` and others, see [this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an override is provided for a forbidden header, it will be ignored and the original request header will be used. + +To set custom cookies, use [browser_context.add_cookies()](/api/class-browsercontext.mdx#browser-context-add-cookies). ::: --- diff --git a/python/docs/test-assertions.mdx b/python/docs/test-assertions.mdx index f7c9a2ee2e..8a6de57d9e 100644 --- a/python/docs/test-assertions.mdx +++ b/python/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [expect(locator).to_have_attribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).to_have_class()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).to_have_count()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | +| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | | [expect(locator).to_have_id()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).to_have_js_property()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).to_have_role()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/src/components/GitHubStarButton/index.tsx b/src/components/GitHubStarButton/index.tsx index 2e3656e730..0201882210 100644 --- a/src/components/GitHubStarButton/index.tsx +++ b/src/components/GitHubStarButton/index.tsx @@ -6,7 +6,7 @@ type StarButtonProps = { repo: string } -const STARS = '80k+'; // NOTE: this line is generated by src/generate.js. Do not change! +const STARS = '81k+'; // NOTE: this line is generated by src/generate.js. Do not change! const StarButton: React.FC = ({owner, repo}) => { if (!repo)