diff --git a/dotnet/docs/api/class-apirequestcontext.mdx b/dotnet/docs/api/class-apirequestcontext.mdx index 77062c1a02e..4f674a5a4ce 100644 --- a/dotnet/docs/api/class-apirequestcontext.mdx +++ b/dotnet/docs/api/class-apirequestcontext.mdx @@ -557,7 +557,7 @@ await ApiRequestContext.StorageStateAsync(options); - `options` `ApiRequestContextStorageStateOptions?` *(optional)* - `IndexedDB` [bool]? *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. - `Path` [string]? *(optional)*# The file path to save the storage state to. If [Path](/api/class-apirequestcontext.mdx#api-request-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. diff --git a/dotnet/docs/api/class-browsercontext.mdx b/dotnet/docs/api/class-browsercontext.mdx index 1aad5f33eb2..ffeff14b0c1 100644 --- a/dotnet/docs/api/class-browsercontext.mdx +++ b/dotnet/docs/api/class-browsercontext.mdx @@ -910,11 +910,6 @@ await BrowserContext.SetOfflineAsync(offline); Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot. -:::note - -IndexedDBs with typed arrays are currently not supported. -::: - **Usage** ```csharp @@ -925,7 +920,13 @@ await BrowserContext.StorageStateAsync(options); - `options` `BrowserContextStorageStateOptions?` *(optional)* - `IndexedDB` [bool]? *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this. + + :::note + + IndexedDBs with typed arrays are currently not supported. + ::: + - `Path` [string]? *(optional)*# The file path to save the storage state to. If [Path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. diff --git a/dotnet/docs/api/class-locator.mdx b/dotnet/docs/api/class-locator.mdx index 82b4a425bbb..1908391f60f 100644 --- a/dotnet/docs/api/class-locator.mdx +++ b/dotnet/docs/api/class-locator.mdx @@ -840,6 +840,9 @@ await rowLocator - `HasText|HasTextRegex` [string]? | [Regex]? *(optional)*# Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `
Playwright
`. + - `Visible` [bool]? *(optional)* Added in: v1.51# + + Only matches visible or invisible elements. **Returns** - [Locator]# @@ -2313,29 +2316,6 @@ When all steps combined have not finished during the specified [Timeout](/api/cl --- -### Visible {#locator-visible} - -Added in: v1.51locator.Visible - -Returns a locator that only matches [visible](../actionability.mdx#visible) elements. - -**Usage** - -```csharp -Locator.Visible(options); -``` - -**Arguments** -- `options` `LocatorVisibleOptions?` *(optional)* - - `Visible` [bool]? *(optional)*# - - Whether to match visible or invisible elements. - -**Returns** -- [Locator]# - ---- - ### WaitForAsync {#locator-wait-for} Added in: v1.16locator.WaitForAsync diff --git a/dotnet/docs/api/class-pageassertions.mdx b/dotnet/docs/api/class-pageassertions.mdx index 7ada1a97a5c..5dadf8d906f 100644 --- a/dotnet/docs/api/class-pageassertions.mdx +++ b/dotnet/docs/api/class-pageassertions.mdx @@ -74,7 +74,7 @@ await Expect(Page).ToHaveURLAsync(new Regex(".*checkout")); **Arguments** - `url` [string] | [Regex] | [Func]<[string], bool> Added in: v1.18# - Expected URL string, RegExp, or predicate receiving [URL] to match. When a [BaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + Expected URL string, RegExp, or predicate receiving [URL] to match. When [BaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL. - `options` `PageAssertionsToHaveURLOptions?` *(optional)* - `IgnoreCase` [bool]? *(optional)* Added in: v1.44# diff --git a/dotnet/docs/locators.mdx b/dotnet/docs/locators.mdx index 6a80dfe5b1a..6169b137c07 100644 --- a/dotnet/docs/locators.mdx +++ b/dotnet/docs/locators.mdx @@ -641,7 +641,7 @@ Consider a page with two buttons, the first invisible and the second [visible](. * This will only find a second button, because it is visible, and then click it. ```csharp - await page.Locator("button").Visible().ClickAsync(); + await page.Locator("button").Filter(new() { Visible = true }).ClickAsync(); ``` ## Lists diff --git a/java/docs/api/class-apirequestcontext.mdx b/java/docs/api/class-apirequestcontext.mdx index 1d19150cdf9..e794937f0c4 100644 --- a/java/docs/api/class-apirequestcontext.mdx +++ b/java/docs/api/class-apirequestcontext.mdx @@ -298,7 +298,7 @@ APIRequestContext.storageState(options); - `options` `ApiRequestContext.StorageStateOptions` *(optional)* - `setIndexedDB` [boolean] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. - `setPath` [Path] *(optional)*# The file path to save the storage state to. If [setPath](/api/class-apirequestcontext.mdx#api-request-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. diff --git a/java/docs/api/class-browsercontext.mdx b/java/docs/api/class-browsercontext.mdx index d8e0d25441a..b47529e3fda 100644 --- a/java/docs/api/class-browsercontext.mdx +++ b/java/docs/api/class-browsercontext.mdx @@ -807,11 +807,6 @@ BrowserContext.setOffline(offline); Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot. -:::note - -IndexedDBs with typed arrays are currently not supported. -::: - **Usage** ```java @@ -823,7 +818,13 @@ BrowserContext.storageState(options); - `options` `BrowserContext.StorageStateOptions` *(optional)* - `setIndexedDB` [boolean] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this. + + :::note + + IndexedDBs with typed arrays are currently not supported. + ::: + - `setPath` [Path] *(optional)*# The file path to save the storage state to. If [setPath](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. diff --git a/java/docs/api/class-locator.mdx b/java/docs/api/class-locator.mdx index 16799d61fb0..ec9db77f515 100644 --- a/java/docs/api/class-locator.mdx +++ b/java/docs/api/class-locator.mdx @@ -838,6 +838,9 @@ rowLocator - `setHasText` [String] | [Pattern] *(optional)*# Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `
Playwright
`. + - `setVisible` [boolean] *(optional)* Added in: v1.51# + + Only matches visible or invisible elements. **Returns** - [Locator]# @@ -2313,30 +2316,6 @@ When all steps combined have not finished during the specified [setTimeout](/api --- -### visible {#locator-visible} - -Added in: v1.51locator.visible - -Returns a locator that only matches [visible](../actionability.mdx#visible) elements. - -**Usage** - -```java -Locator.visible(); -Locator.visible(options); -``` - -**Arguments** -- `options` `Locator.VisibleOptions` *(optional)* - - `setVisible` [boolean] *(optional)*# - - Whether to match visible or invisible elements. - -**Returns** -- [Locator]# - ---- - ### waitFor {#locator-wait-for} Added in: v1.16locator.waitFor diff --git a/java/docs/api/class-pageassertions.mdx b/java/docs/api/class-pageassertions.mdx index 43ee013d46e..d7ef3a43992 100644 --- a/java/docs/api/class-pageassertions.mdx +++ b/java/docs/api/class-pageassertions.mdx @@ -70,7 +70,7 @@ assertThat(page).hasURL(".com"); **Arguments** - `url` [String] | [Pattern] | [Predicate]<[String]> Added in: v1.18# - Expected URL string, RegExp, or predicate receiving [URL] to match. When a [setBaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + Expected URL string, RegExp, or predicate receiving [URL] to match. When [setBaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL. - `options` `PageAssertions.HasURLOptions` *(optional)* - `setIgnoreCase` [boolean] *(optional)* Added in: v1.44# diff --git a/java/docs/locators.mdx b/java/docs/locators.mdx index 27ef9c94e32..cbb508e2a73 100644 --- a/java/docs/locators.mdx +++ b/java/docs/locators.mdx @@ -644,7 +644,7 @@ Consider a page with two buttons, the first invisible and the second [visible](. * This will only find a second button, because it is visible, and then click it. ```java - page.locator("button").visible().click(); + page.locator("button").filter(new Locator.FilterOptions.setVisible(true)).click(); ``` ## Lists diff --git a/nodejs/docs/api/class-apirequest.mdx b/nodejs/docs/api/class-apirequest.mdx index 77a455d8889..5ffb36252d8 100644 --- a/nodejs/docs/api/class-apirequest.mdx +++ b/nodejs/docs/api/class-apirequest.mdx @@ -150,59 +150,8 @@ await apiRequest.newContext(options); - - `indexedDB` [Array]<[Object]> *(optional)* - - `name` [string] - - database name - - `version` [number] - - database version - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> *(optional)* + indexedDB to set for context diff --git a/nodejs/docs/api/class-apirequestcontext.mdx b/nodejs/docs/api/class-apirequestcontext.mdx index 331ef5a297d..40aac325a13 100644 --- a/nodejs/docs/api/class-apirequestcontext.mdx +++ b/nodejs/docs/api/class-apirequestcontext.mdx @@ -577,7 +577,7 @@ await apiRequestContext.storageState(options); - `options` [Object] *(optional)* - `indexedDB` [boolean] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. - `path` [string] *(optional)*# The file path to save the storage state to. If [path](/api/class-apirequestcontext.mdx#api-request-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. @@ -622,59 +622,8 @@ await apiRequestContext.storageState(options); - - `indexedDB` [Array]<[Object]> - - `name` [string] - - - - `version` [number] - - - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> + diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx index 86973afc5a7..3caa4158ae1 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -383,59 +383,8 @@ If directly using this method to create [BrowserContext]s, it is best practice t localStorage to set for context - - `indexedDB` [Array]<[Object]> *(optional)* - - `name` [string] - - database name - - `version` [number] - - database version - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> *(optional)* + indexedDB to set for context @@ -724,59 +673,8 @@ await browser.newPage(options); localStorage to set for context - - `indexedDB` [Array]<[Object]> *(optional)* - - `name` [string] - - database name - - `version` [number] - - database version - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> *(optional)* + indexedDB to set for context diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx index 242aac869e2..1eef9fe89ab 100644 --- a/nodejs/docs/api/class-browsercontext.mdx +++ b/nodejs/docs/api/class-browsercontext.mdx @@ -849,11 +849,6 @@ await browserContext.setOffline(offline); Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot. -:::note - -IndexedDBs with typed arrays are currently not supported. -::: - **Usage** ```js @@ -865,7 +860,13 @@ await browserContext.storageState(options); - `options` [Object] *(optional)* - `indexedDB` [boolean] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this. + + :::note + + IndexedDBs with typed arrays are currently not supported. + ::: + - `path` [string] *(optional)*# The file path to save the storage state to. If [path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. @@ -910,59 +911,8 @@ await browserContext.storageState(options); - - `indexedDB` [Array]<[Object]> - - `name` [string] - - - - `version` [number] - - - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> + --- diff --git a/nodejs/docs/api/class-fullconfig.mdx b/nodejs/docs/api/class-fullconfig.mdx index 4a535a3eb8e..39899fdd35f 100644 --- a/nodejs/docs/api/class-fullconfig.mdx +++ b/nodejs/docs/api/class-fullconfig.mdx @@ -251,10 +251,10 @@ fullConfig.reportSlowTests - [null] | [Object] - `max` [number] - The maximum number of slow test files to report. Defaults to `5`. + The maximum number of slow test files to report. - `threshold` [number] - Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + Test file duration in milliseconds that is considered slow. --- diff --git a/nodejs/docs/api/class-locator.mdx b/nodejs/docs/api/class-locator.mdx index 8350cb59bec..fde0b17d8c4 100644 --- a/nodejs/docs/api/class-locator.mdx +++ b/nodejs/docs/api/class-locator.mdx @@ -837,6 +837,9 @@ await rowLocator - `hasText` [string] | [RegExp] *(optional)*# Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `
Playwright
`. + - `visible` [boolean] *(optional)* Added in: v1.51# + + Only matches visible or invisible elements. **Returns** - [Locator]# @@ -2323,30 +2326,6 @@ When all steps combined have not finished during the specified [timeout](/api/cl --- -### visible {#locator-visible} - -Added in: v1.51locator.visible - -Returns a locator that only matches [visible](../actionability.mdx#visible) elements. - -**Usage** - -```js -locator.visible(); -locator.visible(options); -``` - -**Arguments** -- `options` [Object] *(optional)* - - `visible` [boolean] *(optional)*# - - Whether to match visible or invisible elements. - -**Returns** -- [Locator]# - ---- - ### waitFor {#locator-wait-for} Added in: v1.16locator.waitFor diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx index c943a8dc870..17aeef932e7 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -997,13 +997,13 @@ await expect(page.locator('body')).toMatchAriaSnapshot(` Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.mdx). -Snapshot is stored in a separate `.snapshot.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file. +Snapshot is stored in a separate `.aria.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file. **Usage** ```js await expect(page.locator('body')).toMatchAriaSnapshot(); -await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.snapshot.yml' }); +await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.aria.yml' }); ``` **Arguments** diff --git a/nodejs/docs/api/class-pageassertions.mdx b/nodejs/docs/api/class-pageassertions.mdx index 466b4797306..5c71ee88b6d 100644 --- a/nodejs/docs/api/class-pageassertions.mdx +++ b/nodejs/docs/api/class-pageassertions.mdx @@ -220,13 +220,24 @@ Ensures the page is navigated to the given URL. **Usage** ```js -await expect(page).toHaveURL(/.*checkout/); +// Check for the page URL to be 'https://playwright.dev/docs/intro' (including query string) +await expect(page).toHaveURL('https://playwright.dev/docs/intro'); + +// Check for the page URL to contain 'doc', followed by an optional 's', followed by '/' +await expect(page).toHaveURL(/docs?\//); + +// Check for the predicate to be satisfied +// For example: verify query strings +await expect(page).toHaveURL(url => { + const params = url.searchParams; + return params.has('search') && params.has('options') && params.get('id') === '5'; +}); ``` **Arguments** - `url` [string] | [RegExp] | [function]\([URL]\):[boolean] Added in: v1.18# - Expected URL string, RegExp, or predicate receiving [URL] to match. When a [baseURL](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + Expected URL string, RegExp, or predicate receiving [URL] to match. When [baseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL. - `options` [Object] *(optional)* - `ignoreCase` [boolean] *(optional)* Added in: v1.44# diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx index c932bae1223..7adec5a6494 100644 --- a/nodejs/docs/api/class-testconfig.mdx +++ b/nodejs/docs/api/class-testconfig.mdx @@ -532,7 +532,7 @@ export default defineConfig({ The maximum number of slow test files to report. Defaults to `5`. - `threshold` [number] - Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + Test file duration in milliseconds that is considered slow. Defaults to 5 minutes. **Details** diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 92891e0f1d5..78cfd855b22 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -898,59 +898,8 @@ export default defineConfig({ localStorage to set for context - - `indexedDB` [Array]<[Object]> *(optional)* - - `name` [string] - - database name - - `version` [number] - - database version - - `stores` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `autoIncrement` [boolean] - - - - `indexes` [Array]<[Object]> - - `name` [string] - - - - `keyPath` [string] *(optional)* - - - - `keyPathArray` [Array]<[string]> *(optional)* - - - - `unique` [boolean] - - - - `multiEntry` [boolean] - - - - - `records` [Array]<[Object]> - - `key` [Object] *(optional)* - - - - `keyEncoded` [Object] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Object] *(optional)* - - - - `valueEncoded` [Object] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [Array]<[unknown]> *(optional)* + indexedDB to set for context diff --git a/nodejs/docs/aria-snapshots.mdx b/nodejs/docs/aria-snapshots.mdx index 11e30811ee4..8cfb3caf08b 100644 --- a/nodejs/docs/aria-snapshots.mdx +++ b/nodejs/docs/aria-snapshots.mdx @@ -223,10 +223,10 @@ npx playwright test --update-snapshots --update-source-mode=3way #### Snapshots as separate files -To store your snapshots in a separate file, use the `toMatchAriaSnapshot` method with the `name` option, specifying a `.snapshot.yml` file extension. +To store your snapshots in a separate file, use the `toMatchAriaSnapshot` method with the `name` option, specifying a `.aria.yml` file extension. ```js -await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.snapshot.yml' }); +await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.aria.yml' }); ``` By default, snapshots from a test file `example.spec.ts` are placed in the `example.spec.ts-snapshots` directory. As snapshots should be the same across browsers, only one snapshot is saved even if testing with multiple browsers. Should you wish, you can customize the [snapshot path template](./api/class-testconfig#test-config-snapshot-path-template) using the following configuration: diff --git a/nodejs/docs/locators.mdx b/nodejs/docs/locators.mdx index 9c6efe7be7f..70fe24fe089 100644 --- a/nodejs/docs/locators.mdx +++ b/nodejs/docs/locators.mdx @@ -624,7 +624,7 @@ Consider a page with two buttons, the first invisible and the second [visible](. * This will only find a second button, because it is visible, and then click it. ```js - await page.locator('button').visible().click(); + await page.locator('button').filter({ visible: true }).click(); ``` ## Lists diff --git a/python/docs/api/class-apirequest.mdx b/python/docs/api/class-apirequest.mdx index 597241807b9..1f295d3c8c5 100644 --- a/python/docs/api/class-apirequest.mdx +++ b/python/docs/api/class-apirequest.mdx @@ -149,59 +149,8 @@ api_request.new_context(**kwargs) - - `indexedDB` [List]\[[Dict]\] *(optional)* - - `name` [str] - - database name - - `version` [int] - - database version - - `stores` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `autoIncrement` [bool] - - - - `indexes` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `unique` [bool] - - - - `multiEntry` [bool] - - - - - `records` [List]\[[Dict]\] - - `key` [Dict] *(optional)* - - - - `keyEncoded` [Dict] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Dict] *(optional)* - - - - `valueEncoded` [Dict] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [List]\[[Any]\] *(optional)* + indexedDB to set for context diff --git a/python/docs/api/class-apirequestcontext.mdx b/python/docs/api/class-apirequestcontext.mdx index d9e14a1d5fe..533b0d2b110 100644 --- a/python/docs/api/class-apirequestcontext.mdx +++ b/python/docs/api/class-apirequestcontext.mdx @@ -667,7 +667,7 @@ api_request_context.storage_state(**kwargs) **Arguments** - `indexed_db` [bool] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. - `path` [Union]\[[str], [pathlib.Path]\] *(optional)*# The file path to save the storage state to. If [path](/api/class-apirequestcontext.mdx#api-request-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. @@ -712,59 +712,8 @@ api_request_context.storage_state(**kwargs) - - `indexedDB` [List]\[[Dict]\] - - `name` [str] - - - - `version` [int] - - - - `stores` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `autoIncrement` [bool] - - - - `indexes` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `unique` [bool] - - - - `multiEntry` [bool] - - - - - `records` [List]\[[Dict]\] - - `key` [Dict] *(optional)* - - - - `keyEncoded` [Dict] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Dict] *(optional)* - - - - `valueEncoded` [Dict] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [List]\[[Any]\] + diff --git a/python/docs/api/class-browser.mdx b/python/docs/api/class-browser.mdx index eafd76c1efa..56612b253de 100644 --- a/python/docs/api/class-browser.mdx +++ b/python/docs/api/class-browser.mdx @@ -381,59 +381,8 @@ await browser.close() localStorage to set for context - - `indexedDB` [List]\[[Dict]\] *(optional)* - - `name` [str] - - database name - - `version` [int] - - database version - - `stores` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `autoIncrement` [bool] - - - - `indexes` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `unique` [bool] - - - - `multiEntry` [bool] - - - - - `records` [List]\[[Dict]\] - - `key` [Dict] *(optional)* - - - - `keyEncoded` [Dict] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Dict] *(optional)* - - - - `valueEncoded` [Dict] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [List]\[[Any]\] *(optional)* + indexedDB to set for context @@ -690,59 +639,8 @@ browser.new_page(**kwargs) localStorage to set for context - - `indexedDB` [List]\[[Dict]\] *(optional)* - - `name` [str] - - database name - - `version` [int] - - database version - - `stores` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `autoIncrement` [bool] - - - - `indexes` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `unique` [bool] - - - - `multiEntry` [bool] - - - - - `records` [List]\[[Dict]\] - - `key` [Dict] *(optional)* - - - - `keyEncoded` [Dict] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Dict] *(optional)* - - - - `valueEncoded` [Dict] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [List]\[[Any]\] *(optional)* + indexedDB to set for context diff --git a/python/docs/api/class-browsercontext.mdx b/python/docs/api/class-browsercontext.mdx index 62ab1e98ef1..efebdc15cca 100644 --- a/python/docs/api/class-browsercontext.mdx +++ b/python/docs/api/class-browsercontext.mdx @@ -1178,11 +1178,6 @@ browser_context.set_offline(offline) Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot. -:::note - -IndexedDBs with typed arrays are currently not supported. -::: - **Usage** ```python @@ -1193,7 +1188,13 @@ browser_context.storage_state(**kwargs) **Arguments** - `indexed_db` [bool] *(optional)* Added in: v1.51# - Defaults to `true`. Set to `false` to omit IndexedDB from snapshot. + Set to `true` to include IndexedDB in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this. + + :::note + + IndexedDBs with typed arrays are currently not supported. + ::: + - `path` [Union]\[[str], [pathlib.Path]\] *(optional)*# The file path to save the storage state to. If [path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. @@ -1238,59 +1239,8 @@ browser_context.storage_state(**kwargs) - - `indexedDB` [List]\[[Dict]\] - - `name` [str] - - - - `version` [int] - - - - `stores` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `autoIncrement` [bool] - - - - `indexes` [List]\[[Dict]\] - - `name` [str] - - - - `keyPath` [str] *(optional)* - - - - `keyPathArray` [List]\[[str]\] *(optional)* - - - - `unique` [bool] - - - - `multiEntry` [bool] - - - - - `records` [List]\[[Dict]\] - - `key` [Dict] *(optional)* - - - - `keyEncoded` [Dict] *(optional)* - - if `key` is not JSON-serializable, this contains an encoded version that preserves types. - - `value` [Dict] *(optional)* - - - - `valueEncoded` [Dict] *(optional)* - - if `value` is not JSON-serializable, this contains an encoded version that preserves types. - - - + - `indexedDB` [List]\[[Any]\] + --- diff --git a/python/docs/api/class-locator.mdx b/python/docs/api/class-locator.mdx index f440dab3cd8..65ceca096da 100644 --- a/python/docs/api/class-locator.mdx +++ b/python/docs/api/class-locator.mdx @@ -1158,6 +1158,9 @@ await row_locator.filter(has_text="text in column 1").filter( - `has_text` [str] | [Pattern] *(optional)*# Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `
Playwright
`. +- `visible` [bool] *(optional)* Added in: v1.51# + + Only matches visible or invisible elements. **Returns** - [Locator]# @@ -3134,29 +3137,6 @@ When all steps combined have not finished during the specified [timeout](/api/cl --- -### visible {#locator-visible} - -Added in: v1.51locator.visible - -Returns a locator that only matches [visible](../actionability.mdx#visible) elements. - -**Usage** - -```python -locator.visible() -locator.visible(**kwargs) -``` - -**Arguments** -- `visible` [bool] *(optional)*# - - Whether to match visible or invisible elements. - -**Returns** -- [Locator]# - ---- - ### wait_for {#locator-wait-for} Added in: v1.16locator.wait_for diff --git a/python/docs/api/class-pageassertions.mdx b/python/docs/api/class-pageassertions.mdx index 457fe97c6cd..f7101506dbf 100644 --- a/python/docs/api/class-pageassertions.mdx +++ b/python/docs/api/class-pageassertions.mdx @@ -201,7 +201,7 @@ await expect(page).to_have_url(re.compile(".*checkout")) **Arguments** - `url` [str] | [Pattern] | [Callable]\[[URL]\]:[bool] Added in: v1.18# - Expected URL string, RegExp, or predicate receiving [URL] to match. When a [base_url](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + Expected URL string, RegExp, or predicate receiving [URL] to match. When [base_url](/api/class-browser.mdx#browser-new-context-option-base-url) is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL. - `ignore_case` [bool] *(optional)* Added in: v1.44# Whether to perform case-insensitive match. [ignore_case](/api/class-pageassertions.mdx#page-assertions-to-have-url-option-ignore-case) option takes precedence over the corresponding regular expression parameter if specified. A provided predicate ignores this flag. diff --git a/python/docs/locators.mdx b/python/docs/locators.mdx index cfff90bd9d1..c4d8263f35e 100644 --- a/python/docs/locators.mdx +++ b/python/docs/locators.mdx @@ -787,14 +787,14 @@ To click ``: ```py -page.locator("x-details", has_text="Details" ).click() +page.locator("x-details", has_text="Details").click() ``` ```py -await page.locator("x-details", has_text="Details" ).click() +await page.locator("x-details", has_text="Details").click() ``` @@ -1318,14 +1318,14 @@ Consider a page with two buttons, the first invisible and the second [visible](. ```py - page.locator("button").visible().click() + page.locator("button").filter(visible=True).click() ``` ```py - await page.locator("button").visible().click() + await page.locator("button").filter(visible=True).click() ```