From ee2c86cff2209aeccdaad8e33f4477013d82a739 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:11:18 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (12-02-25) --- dotnet/docs/api/class-apirequest.mdx | 3 +++ dotnet/docs/api/class-browser.mdx | 6 ++++++ dotnet/docs/api/class-browsertype.mdx | 3 +++ java/docs/api/class-apirequest.mdx | 3 +++ java/docs/api/class-browser.mdx | 6 ++++++ java/docs/api/class-browsertype.mdx | 3 +++ nodejs/docs/api/class-androiddevice.mdx | 3 +++ nodejs/docs/api/class-apirequest.mdx | 3 +++ nodejs/docs/api/class-browser.mdx | 6 ++++++ nodejs/docs/api/class-browsertype.mdx | 3 +++ nodejs/docs/api/class-testoptions.mdx | 26 +++++++++++++++++++++++++ python/docs/api/class-apirequest.mdx | 3 +++ python/docs/api/class-browser.mdx | 6 ++++++ python/docs/api/class-browsertype.mdx | 3 +++ 14 files changed, 77 insertions(+) diff --git a/dotnet/docs/api/class-apirequest.mdx b/dotnet/docs/api/class-apirequest.mdx index a516b740771..d50bec5aae2 100644 --- a/dotnet/docs/api/class-apirequest.mdx +++ b/dotnet/docs/api/class-apirequest.mdx @@ -28,6 +28,9 @@ await ApiRequest.NewContextAsync(options); **Arguments** - `options` `ApiRequestNewContextOptions?` *(optional)* + - `ApiRequestFailsOnErrorStatus` [bool]? *(optional)* Added in: v1.51# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `BaseURL` [string]? *(optional)*# Methods like [ApiRequestContext.GetAsync()](/api/class-apirequestcontext.mdx#api-request-context-get) take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples: diff --git a/dotnet/docs/api/class-browser.mdx b/dotnet/docs/api/class-browser.mdx index 7a53c7bbf4e..31db1629ade 100644 --- a/dotnet/docs/api/class-browser.mdx +++ b/dotnet/docs/api/class-browser.mdx @@ -166,6 +166,9 @@ await browser.CloseAsync(); - `AcceptDownloads` [bool]? *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `ApiRequestFailsOnErrorStatus` [bool]? *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `BaseURL` [string]? *(optional)*# When using [Page.GotoAsync()](/api/class-page.mdx#page-goto), [Page.RouteAsync()](/api/class-page.mdx#page-route), [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url), [Page.RunAndWaitForRequestAsync()](/api/class-page.mdx#page-wait-for-request), or [Page.RunAndWaitForResponseAsync()](/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: @@ -384,6 +387,9 @@ await Browser.NewPageAsync(options); - `AcceptDownloads` [bool]? *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `ApiRequestFailsOnErrorStatus` [bool]? *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `BaseURL` [string]? *(optional)*# When using [Page.GotoAsync()](/api/class-page.mdx#page-goto), [Page.RouteAsync()](/api/class-page.mdx#page-route), [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url), [Page.RunAndWaitForRequestAsync()](/api/class-page.mdx#page-wait-for-request), or [Page.RunAndWaitForResponseAsync()](/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: diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx index 7cb378d26fa..5512dde1d1d 100644 --- a/dotnet/docs/api/class-browsertype.mdx +++ b/dotnet/docs/api/class-browsertype.mdx @@ -277,6 +277,9 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); - `AcceptDownloads` [bool]? *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `ApiRequestFailsOnErrorStatus` [bool]? *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `Args` [IEnumerable]?<[string]> *(optional)*# :::warning diff --git a/java/docs/api/class-apirequest.mdx b/java/docs/api/class-apirequest.mdx index fb3f1e0cd54..003fe85f16c 100644 --- a/java/docs/api/class-apirequest.mdx +++ b/java/docs/api/class-apirequest.mdx @@ -29,6 +29,9 @@ APIRequest.newContext(options); **Arguments** - `options` `ApiRequest.NewContextOptions` *(optional)* + - `setApiRequestFailsOnErrorStatus` [boolean] *(optional)* Added in: v1.51# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `setBaseURL` [String] *(optional)*# Methods like [APIRequestContext.get()](/api/class-apirequestcontext.mdx#api-request-context-get) take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples: diff --git a/java/docs/api/class-browser.mdx b/java/docs/api/class-browser.mdx index 4d1835a5afc..5a92ee2288b 100644 --- a/java/docs/api/class-browser.mdx +++ b/java/docs/api/class-browser.mdx @@ -170,6 +170,9 @@ browser.close(); - `setAcceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `setApiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `setBaseURL` [String] *(optional)*# When using [Page.navigate()](/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: @@ -389,6 +392,9 @@ Browser.newPage(options); - `setAcceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `setApiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `setBaseURL` [String] *(optional)*# When using [Page.navigate()](/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: diff --git a/java/docs/api/class-browsertype.mdx b/java/docs/api/class-browsertype.mdx index 49b7158ef80..c977a01aad9 100644 --- a/java/docs/api/class-browsertype.mdx +++ b/java/docs/api/class-browsertype.mdx @@ -277,6 +277,9 @@ BrowserType.launchPersistentContext(userDataDir, options); - `setAcceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `setApiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `setArgs` [List]<[String]> *(optional)*# :::warning diff --git a/nodejs/docs/api/class-androiddevice.mdx b/nodejs/docs/api/class-androiddevice.mdx index b5907d300d4..741f799a9e0 100644 --- a/nodejs/docs/api/class-androiddevice.mdx +++ b/nodejs/docs/api/class-androiddevice.mdx @@ -199,6 +199,9 @@ await androidDevice.launchBrowser(options); - `acceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `apiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `args` [Array]<[string]> *(optional)* Added in: v1.29# :::warning diff --git a/nodejs/docs/api/class-apirequest.mdx b/nodejs/docs/api/class-apirequest.mdx index 48e6f8c4417..ca33c4f527e 100644 --- a/nodejs/docs/api/class-apirequest.mdx +++ b/nodejs/docs/api/class-apirequest.mdx @@ -29,6 +29,9 @@ await apiRequest.newContext(options); **Arguments** - `options` [Object] *(optional)* + - `apiRequestFailsOnErrorStatus` [boolean] *(optional)* Added in: v1.51# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `baseURL` [string] *(optional)*# Methods like [apiRequestContext.get()](/api/class-apirequestcontext.mdx#api-request-context-get) take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples: diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx index 86973afc5a7..402c41db84e 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -168,6 +168,9 @@ 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. + - `apiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `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: @@ -509,6 +512,9 @@ await browser.newPage(options); - `acceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `apiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `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: diff --git a/nodejs/docs/api/class-browsertype.mdx b/nodejs/docs/api/class-browsertype.mdx index fbdf67d9568..dfc3fe7ac37 100644 --- a/nodejs/docs/api/class-browsertype.mdx +++ b/nodejs/docs/api/class-browsertype.mdx @@ -281,6 +281,9 @@ await browserType.launchPersistentContext(userDataDir, options); - `acceptDownloads` [boolean] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + - `apiRequestFailsOnErrorStatus` [boolean] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `args` [Array]<[string]> *(optional)*# :::warning diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 8c8712bc2eb..92891e0f1d5 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -687,6 +687,32 @@ export default defineConfig({ --- +### pageSnapshot {#test-options-page-snapshot} + +Added in: v1.51testOptions.pageSnapshot + +Whether to automatically capture a ARIA snapshot of the page after each test. Defaults to `'only-on-failure'`. +* `'off'`: Do not capture page snapshots. +* `'on'`: Capture page snapshot after each test. +* `'only-on-failure'`: Capture page snapshot after each test failure. + +**Usage** + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + use: { + pageSnapshot: 'on', + }, +}); +``` + +**Type** +- "off" | "on" | "only-on-failure" + +--- + ### permissions {#test-options-permissions} Added in: v1.10testOptions.permissions diff --git a/python/docs/api/class-apirequest.mdx b/python/docs/api/class-apirequest.mdx index 7ba4e366798..e5935aa9e56 100644 --- a/python/docs/api/class-apirequest.mdx +++ b/python/docs/api/class-apirequest.mdx @@ -28,6 +28,9 @@ api_request.new_context(**kwargs) ``` **Arguments** +- `api_request_fails_on_error_status` [bool] *(optional)* Added in: v1.51# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `base_url` [str] *(optional)*# Methods like [api_request_context.get()](/api/class-apirequestcontext.mdx#api-request-context-get) take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples: diff --git a/python/docs/api/class-browser.mdx b/python/docs/api/class-browser.mdx index eafd76c1efa..d6ddafbc90e 100644 --- a/python/docs/api/class-browser.mdx +++ b/python/docs/api/class-browser.mdx @@ -174,6 +174,9 @@ await browser.close() - `accept_downloads` [bool] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. +- `api_request_fails_on_error_status` [bool] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `base_url` [str] *(optional)*# When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.wait_for_url()](/api/class-page.mdx#page-wait-for-url), [page.expect_request()](/api/class-page.mdx#page-wait-for-request), or [page.expect_response()](/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: @@ -483,6 +486,9 @@ browser.new_page(**kwargs) - `accept_downloads` [bool] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. +- `api_request_fails_on_error_status` [bool] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `base_url` [str] *(optional)*# When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.wait_for_url()](/api/class-page.mdx#page-wait-for-url), [page.expect_request()](/api/class-page.mdx#page-wait-for-request), or [page.expect_response()](/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: diff --git a/python/docs/api/class-browsertype.mdx b/python/docs/api/class-browsertype.mdx index c58687d0aa0..fd2e2294a14 100644 --- a/python/docs/api/class-browsertype.mdx +++ b/python/docs/api/class-browsertype.mdx @@ -329,6 +329,9 @@ browser_type.launch_persistent_context(user_data_dir, **kwargs) - `accept_downloads` [bool] *(optional)*# Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. +- `api_request_fails_on_error_status` [bool] *(optional)*# + + An object containing an option to throw an error when API request returns status codes other than 2xx and 3xx. By default, response object is returned for all status codes. - `args` [List]\[[str]\] *(optional)*# :::warning