Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(roll): roll to ToT Playwright (roll/next-26-09-24) #1536

Merged
merged 1 commit into from
Sep 26, 2024
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
1 change: 1 addition & 0 deletions dotnet/docs/api/class-accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This method is deprecated. Please use other libraries such as [Axe](https://www.
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

:::note

The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless [InterestingOnly](/api/class-accessibility.mdx#accessibility-snapshot-option-interesting-only) is set to `false`.
:::

Expand Down
1 change: 1 addition & 0 deletions dotnet/docs/api/class-apirequest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ await ApiRequest.NewContextAsync(options);
An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
:::

Expand Down
7 changes: 7 additions & 0 deletions dotnet/docs/api/class-browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ In case this browser is obtained using [BrowserType.LaunchAsync()](/api/class-br
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the browser server.

:::note

This is similar to force quitting the browser. Therefore, you should call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) on any [BrowserContext]'s you explicitly created earlier with [Browser.NewContextAsync()](/api/class-browser.mdx#browser-new-context) **before** calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close).
:::

Expand Down Expand Up @@ -116,6 +117,7 @@ Browser.IsConnected
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browser.NewBrowserCDPSessionAsync</x-search>

:::note

CDP Sessions are only supported on Chromium-based browsers.
:::

Expand All @@ -139,6 +141,7 @@ await Browser.NewBrowserCDPSessionAsync();
Creates a new browser context. It won't share cookies/cache with other browser contexts.

:::note

If directly using this method to create [BrowserContext]s, it is best practice to explicitly close the returned context via [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) when your code is done with the [BrowserContext], and before calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close). This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved.
:::

Expand Down Expand Up @@ -205,6 +208,7 @@ await browser.CloseAsync();
An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
:::

Expand Down Expand Up @@ -349,6 +353,7 @@ await browser.CloseAsync();
Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport).

:::note

The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic.
:::

Expand Down Expand Up @@ -418,6 +423,7 @@ await Browser.NewPageAsync(options);
An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
:::

Expand Down Expand Up @@ -562,6 +568,7 @@ await Browser.NewPageAsync(options);
Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport).

:::note

The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic.
:::

Expand Down
10 changes: 10 additions & 0 deletions dotnet/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ The order of evaluation of multiple scripts installed via [BrowserContext.AddIni
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.BackgroundPages</x-search>

:::note

Background pages are only supported on Chromium-based browsers.
:::

Expand Down Expand Up @@ -214,6 +215,7 @@ await context.ClearPermissionsAsync();
Closes the browser context. All the pages that belong to the browser context will be closed.

:::note

The default browser context cannot be closed.
:::

Expand Down Expand Up @@ -443,6 +445,7 @@ await BrowserContext.GrantPermissionsAsync(permissions, options);
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.NewCDPSessionAsync</x-search>

:::note

CDP sessions are only supported on Chromium-based browsers.
:::

Expand Down Expand Up @@ -505,6 +508,7 @@ BrowserContext.Pages
Routing provides the capability to modify network requests that are made by any page in the browser context. Once route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.

:::note

[BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route) will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting [ServiceWorkers](/api/class-browser.mdx#browser-new-context-option-service-workers) to `'block'`.
:::

Expand Down Expand Up @@ -547,6 +551,7 @@ Page routes (set up with [Page.RouteAsync()](/api/class-page.mdx#page-route)) ta
To remove a route with its handler you can use [BrowserContext.UnrouteAsync()](/api/class-browsercontext.mdx#browser-context-unroute).

:::note

Enabling routing disables http cache.
:::

Expand Down Expand Up @@ -768,6 +773,7 @@ This setting will change the default maximum navigation time for the following m
* [Page.RunAndWaitForNavigationAsync()](/api/class-page.mdx#page-wait-for-navigation)

:::note

[Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) and [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) take priority over [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout).
:::

Expand All @@ -791,6 +797,7 @@ BrowserContext.SetDefaultNavigationTimeout(timeout);
This setting will change the default maximum time for all the methods accepting [timeout](/api/class-browsercontext.mdx#browser-context-set-default-timeout-option-timeout) option.

:::note

[Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout), [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) and [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout) take priority over [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout).
:::

Expand All @@ -814,6 +821,7 @@ BrowserContext.SetDefaultTimeout(timeout);
The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged with page-specific extra HTTP headers set with [Page.SetExtraHTTPHeadersAsync()](/api/class-page.mdx#page-set-extra-http-headers). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.

:::note

[BrowserContext.SetExtraHTTPHeadersAsync()](/api/class-browsercontext.mdx#browser-context-set-extra-http-headers) does not guarantee the order of headers in the outgoing requests.
:::

Expand Down Expand Up @@ -1022,6 +1030,7 @@ BrowserContext.Tracing
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.event BackgroundPage</x-search>

:::note

Only works with Chromium browser's persistent context.
:::

Expand Down Expand Up @@ -1172,6 +1181,7 @@ BrowserContext.Request += async (_, request) => {};
Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use [Page.RequestFailed](/api/class-page.mdx#page-event-request-failed).

:::note

HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with [BrowserContext.RequestFinished](/api/class-browsercontext.mdx#browser-context-event-request-finished) event and not with [BrowserContext.RequestFailed](/api/class-browsercontext.mdx#browser-context-event-request-failed).
:::

Expand Down
5 changes: 5 additions & 0 deletions dotnet/docs/api/class-browsertype.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ This method attaches Playwright to an existing browser instance using the Chrome
The default browser context is accessible via [Browser.Contexts](/api/class-browser.mdx#browser-contexts).

:::note

Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
:::

Expand Down Expand Up @@ -162,6 +163,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
- `Args` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-args"/><a href="#browser-type-launch-option-args" class="list-anchor">#</a>

:::warning

Use custom browser args at your own risk, as some of them may break Playwright functionality.
:::

Expand Down Expand Up @@ -265,6 +267,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
- `Args` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-args"/><a href="#browser-type-launch-persistent-context-option-args" class="list-anchor">#</a>

:::warning

Use custom browser args at your own risk, as some of them may break Playwright functionality.
:::

Expand Down Expand Up @@ -317,6 +320,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
:::

Expand Down Expand Up @@ -502,6 +506,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport).

:::note

The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic.
:::

Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-elementhandle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
ElementHandle represents an in-page DOM element. ElementHandles can be created with the [Page.QuerySelectorAsync()](/api/class-page.mdx#page-query-selector) method.

:::warning[Discouraged]

The use of ElementHandle is discouraged, use [Locator] objects and web-first assertions instead.
:::

Expand Down Expand Up @@ -308,6 +309,7 @@ If the element is detached from the DOM at any moment during the action, this me
When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-dblclick-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this.

:::note

`elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event.
:::

Expand Down Expand Up @@ -1346,6 +1348,7 @@ If the element is detached from the DOM at any moment during the action, this me
When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-tap-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this.

:::note

`elementHandle.tap()` requires that the `hasTouch` option of the browser context be set to true.
:::

Expand Down
9 changes: 9 additions & 0 deletions dotnet/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ await page
An attribute that is usually set by `aria-disabled` or `disabled`.

:::note

Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about [`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).
:::

Expand Down Expand Up @@ -684,6 +685,7 @@ The method will throw an error if:
The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [Response.Status](/api/class-response.mdx#response-status).

:::note

The method either throws an error or returns a main resource response. The only exceptions are navigation to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.
:::

Expand Down Expand Up @@ -821,6 +823,7 @@ Returns frame's name attribute as specified in the tag.
If the name is empty, returns the id attribute instead.

:::note

This value is calculated once when the frame is created, and will not update if the attribute is changed later.
:::

Expand Down Expand Up @@ -999,6 +1002,7 @@ Waits for the required load state to be reached.
This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.

:::note

Most of the time, this method is not needed because Playwright [auto-waits before every action](../actionability.mdx).
:::

Expand Down Expand Up @@ -1225,6 +1229,7 @@ This method double clicks an element matching [selector](/api/class-frame.mdx#fr
When all steps combined have not finished during the specified [Timeout](/api/class-frame.mdx#frame-dblclick-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this.

:::note

`frame.dblclick()` dispatches two `click` events and a single `dblclick` event.
:::

Expand Down Expand Up @@ -1996,6 +2001,7 @@ Use locator-based [Frame.Locator()](/api/class-frame.mdx#frame-locator) instead.
Returns the ElementHandle pointing to the frame element.

:::caution

The use of [ElementHandle] is discouraged, use [Locator] objects and web-first assertions instead.
:::

Expand Down Expand Up @@ -2035,6 +2041,7 @@ Use locator-based [Frame.Locator()](/api/class-frame.mdx#frame-locator) instead.
Returns the ElementHandles pointing to the frame elements.

:::caution

The use of [ElementHandle] is discouraged, use [Locator] objects instead.
:::

Expand Down Expand Up @@ -2379,6 +2386,7 @@ This method taps an element matching [selector](/api/class-frame.mdx#frame-tap-o
When all steps combined have not finished during the specified [Timeout](/api/class-frame.mdx#frame-tap-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this.

:::note

`frame.tap()` requires that the `hasTouch` option of the browser context be set to true.
:::

Expand Down Expand Up @@ -2594,6 +2602,7 @@ Use web assertions that assert visibility or a locator-based [Locator.WaitForAsy
Returns when element specified by selector satisfies [State](/api/class-frame.mdx#frame-wait-for-selector-option-state) option. Returns `null` if waiting for `hidden` or `detached`.

:::note

Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and web-first assertions make the code wait-for-selector-free.
:::

Expand Down
1 change: 1 addition & 0 deletions dotnet/docs/api/class-framelocator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ await page
An attribute that is usually set by `aria-disabled` or `disabled`.

:::note

Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about [`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).
:::

Expand Down
1 change: 1 addition & 0 deletions dotnet/docs/api/class-jshandle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ await JsHandle.GetPropertyAsync(propertyName);
Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**.

:::note

The method will return an empty JSON object if the referenced object is not stringifiable. It will throw an error if the object has circular references.
:::

Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-keyboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ If [key](/api/class-keyboard.mdx#keyboard-down-option-key) is a modifier key, `S
After the key is pressed once, subsequent calls to [Keyboard.DownAsync()](/api/class-keyboard.mdx#keyboard-down) will have [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use [Keyboard.UpAsync()](/api/class-keyboard.mdx#keyboard-up).

:::note

Modifier keys DO influence `keyboard.down`. Holding down `Shift` will type the text in upper case.
:::

Expand Down Expand Up @@ -120,6 +121,7 @@ Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not
<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>keyboard.PressAsync</x-search>

:::tip

In most cases, you should use [Locator.PressAsync()](/api/class-locator.mdx#locator-press) instead.
:::

Expand Down Expand Up @@ -169,6 +171,7 @@ Shortcut for [Keyboard.DownAsync()](/api/class-keyboard.mdx#keyboard-down) and [
<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>keyboard.TypeAsync</x-search>

:::caution

In most cases, you should use [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.PressSequentiallyAsync()](/api/class-locator.mdx#locator-press-sequentially).
:::

Expand Down
Loading
Loading