Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dotnet/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ await BrowserContext.SetOfflineAsync(offline);

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>browserContext.SetStorageStateAsync</x-search>

Clears the existing cookies, local storage and IndexedDB entries for all origins and sets the new storage state.
Clears the existing cookies, local storage, IndexedDB entries and virtual WebAuthn credentials, and sets the new storage state. When the storage state contains credentials, the virtual WebAuthn authenticator is installed (equivalent to [Credentials.InstallAsync()](/api/class-credentials.mdx#credentials-install)), preventing all real authenticators from working in this context.

**Usage**

Expand All @@ -926,7 +926,7 @@ await context.SetStorageStateAsync("state.json");

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.StorageStateAsync</x-search>

Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
Returns storage state for this browser context, contains current cookies, local storage snapshot, IndexedDB snapshot and virtual WebAuthn credentials.

**Usage**

Expand All @@ -936,6 +936,9 @@ await BrowserContext.StorageStateAsync(options);

**Arguments**
- `options` `BrowserContextStorageStateOptions?` *(optional)*
- `Credentials` [bool]? *(optional)* <font size="2">Added in: v1.61</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-storage-state-option-credentials"/><a href="#browser-context-storage-state-option-credentials" class="list-anchor">#</a>

Set to `true` to include the context's virtual WebAuthn [BrowserContext.Credentials](/api/class-browsercontext.mdx#browser-context-credentials) (passkeys) in the storage state snapshot. The captured credentials carry their private keys, so they can be re-seeded into a later context via the [StorageState](/api/class-browser.mdx#browser-new-context-option-storage-state) option or [BrowserContext.SetStorageStateAsync()](/api/class-browsercontext.mdx#browser-context-set-storage-state). Note that restoring the storage state that contains credentials will automatically install the virtual WebAuthn authenticator (see [Credentials.InstallAsync()](/api/class-credentials.mdx#credentials-install)), and prevent all real authenticators from working in this context.
- `IndexedDB` [bool]? *(optional)* <font size="2">Added in: v1.51</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-storage-state-option-indexed-db"/><a href="#browser-context-storage-state-option-indexed-db" class="list-anchor">#</a>

Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication, enable this.
Expand Down
8 changes: 6 additions & 2 deletions dotnet/docs/api/class-credentials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import HTMLCard from '@site/src/components/HTMLCard';

`Credentials` is a virtual WebAuthn authenticator scoped to a [BrowserContext]. It lets tests register passkeys and answer `navigator.credentials.create()` / `navigator.credentials.get()` ceremonies in the page, without a real authenticator or hardware security key.

There are two common ways to use it:
There are three common ways to use it:

**Usage: seed a known credential**

Expand All @@ -31,7 +31,7 @@ await page.GotoAsync("https://example.com/login");
// The page's navigator.credentials.get() is answered with the seeded passkey.
```

**Usage: capture a passkey, then reuse it**
**Usage: capture a credential, then reuse it**

```csharp
// setup test: let the app register a passkey, then save it.
Expand Down Expand Up @@ -66,6 +66,10 @@ await page.GotoAsync("https://example.com/login");
// navigator.credentials.get() resolves the captured passkey — already signed in.
```

**Usage: save credentials in the storage state, restore later**

See [authentication guide](../auth.mdx) for examples of using saving and resotring the storage state.

**Defaults**


Expand Down
21 changes: 21 additions & 0 deletions dotnet/docs/api/class-elementhandle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ await ElementHandle.CheckAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-check-option-scroll"/><a href="#element-handle-check-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Timeout` [float]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-check-option-timeout"/><a href="#element-handle-check-option-timeout" class="list-anchor">#</a>

Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.
Expand Down Expand Up @@ -276,6 +279,9 @@ await ElementHandle.ClickAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-click-option-scroll"/><a href="#element-handle-click-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Steps` [int]? *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-click-option-steps"/><a href="#element-handle-click-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
Expand Down Expand Up @@ -352,6 +358,9 @@ await ElementHandle.DblClickAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-dblclick-option-scroll"/><a href="#element-handle-dblclick-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Steps` [int]? *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-dblclick-option-steps"/><a href="#element-handle-dblclick-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
Expand Down Expand Up @@ -662,6 +671,9 @@ await ElementHandle.HoverAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-hover-option-scroll"/><a href="#element-handle-hover-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Timeout` [float]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-hover-option-timeout"/><a href="#element-handle-hover-option-timeout" class="list-anchor">#</a>

Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.
Expand Down Expand Up @@ -1271,6 +1283,9 @@ await ElementHandle.SetCheckedAsync(checked, options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-set-checked-option-scroll"/><a href="#element-handle-set-checked-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Timeout` [float]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-set-checked-option-timeout"/><a href="#element-handle-set-checked-option-timeout" class="list-anchor">#</a>

Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.
Expand Down Expand Up @@ -1388,6 +1403,9 @@ await ElementHandle.TapAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-tap-option-scroll"/><a href="#element-handle-tap-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Timeout` [float]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-tap-option-timeout"/><a href="#element-handle-tap-option-timeout" class="list-anchor">#</a>

Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.
Expand Down Expand Up @@ -1515,6 +1533,9 @@ await ElementHandle.UncheckAsync(options);


A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
- `Scroll` `enum ScrollMode { Auto, None }?` *(optional)* <font size="2">Added in: v1.62</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-uncheck-option-scroll"/><a href="#element-handle-uncheck-option-scroll" class="list-anchor">#</a>

Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`, which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
- `Timeout` [float]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="element-handle-uncheck-option-timeout"/><a href="#element-handle-uncheck-option-timeout" class="list-anchor">#</a>

Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.
Expand Down
Loading
Loading