chore(docs): validate params/options links (#32820)
Also supports fully-qualified links like this: ``` [`option: BrowserType.launch.headless`] ``` References https://github.com/microsoft/playwright/issues/32590.
This commit is contained in:
parent
597642d269
commit
e5433d0576
|
@ -445,7 +445,7 @@ Either a predicate that receives an event or an options object. Optional.
|
|||
* since: v1.9
|
||||
- returns: <[AndroidWebView]>
|
||||
|
||||
This method waits until [AndroidWebView] matching the [`option: selector`] is opened and returns it. If there is already an open [AndroidWebView] matching the [`option: selector`], returns immediately.
|
||||
This method waits until [AndroidWebView] matching the [`param: selector`] is opened and returns it. If there is already an open [AndroidWebView] matching the [`param: selector`], returns immediately.
|
||||
|
||||
### param: AndroidDevice.webView.selector
|
||||
* since: v1.9
|
||||
|
|
|
@ -247,7 +247,7 @@ var data = new Dictionary<string, object>() {
|
|||
await Request.FetchAsync("https://example.com/api/createBook", new() { Method = "post", DataObject = data });
|
||||
```
|
||||
|
||||
The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use [FormData] to construct request body and pass it to the request as [`option: multipart`] parameter:
|
||||
The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding, by specifiying the `multipart` parameter:
|
||||
|
||||
```js
|
||||
const form = new FormData();
|
||||
|
@ -300,6 +300,7 @@ multipart.Set("fileField", file);
|
|||
await Request.FetchAsync("https://example.com/api/uploadScript", new() { Method = "post", Multipart = multipart });
|
||||
```
|
||||
|
||||
|
||||
### param: APIRequestContext.fetch.urlOrRequest
|
||||
* since: v1.16
|
||||
- `urlOrRequest` <[string]|[Request]>
|
||||
|
|
|
@ -1198,7 +1198,7 @@ Enabling routing disables http cache.
|
|||
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>
|
||||
|
||||
A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### param: BrowserContext.route.handler
|
||||
|
@ -1342,7 +1342,7 @@ await context.RouteWebSocketAsync("/ws", async ws => {
|
|||
* since: v1.48
|
||||
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>
|
||||
|
||||
Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [`option: baseURL`] from the context options.
|
||||
Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [`option: Browser.newContext.baseURL`] context option.
|
||||
|
||||
### param: BrowserContext.routeWebSocket.handler
|
||||
* since: v1.48
|
||||
|
|
|
@ -1304,7 +1304,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
|
|||
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
|
||||
- returns: <[boolean]>
|
||||
|
||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`param: selector`] that does not match any elements is considered hidden.
|
||||
|
||||
### param: Frame.isHidden.selector = %%-input-selector-%%
|
||||
* since: v1.8
|
||||
|
@ -1322,7 +1322,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
|
|||
* discouraged: Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).
|
||||
- returns: <[boolean]>
|
||||
|
||||
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
||||
Returns whether the element is [visible](../actionability.md#visible). [`param: selector`] that does not match any elements is considered not visible.
|
||||
|
||||
### param: Frame.isVisible.selector = %%-input-selector-%%
|
||||
* since: v1.8
|
||||
|
|
|
@ -54,7 +54,7 @@ foreach (var li in await page.GetByRole("listitem").AllAsync())
|
|||
Returns an array of `node.innerText` values for all matching nodes.
|
||||
|
||||
:::warning[Asserting text]
|
||||
If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.
|
||||
If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: LocatorAssertions.toHaveText.useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.
|
||||
:::
|
||||
|
||||
**Usage**
|
||||
|
@ -1291,7 +1291,7 @@ Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/A
|
|||
Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).
|
||||
|
||||
:::warning[Asserting text]
|
||||
If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.
|
||||
If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: LocatorAssertions.toHaveText.useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.
|
||||
:::
|
||||
|
||||
### option: Locator.innerText.timeout = %%-input-timeout-%%
|
||||
|
|
|
@ -2382,7 +2382,7 @@ Headless mode doesn't support navigation to a PDF document. See the
|
|||
- `url` <[string]>
|
||||
|
||||
URL to navigate page to. The url should include scheme, e.g. `https://`.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### option: Page.goto.waitUntil = %%-navigation-wait-until-%%
|
||||
|
@ -2589,7 +2589,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
|
|||
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
|
||||
- returns: <[boolean]>
|
||||
|
||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`param: selector`] that does not match any elements is considered hidden.
|
||||
|
||||
### param: Page.isHidden.selector = %%-input-selector-%%
|
||||
* since: v1.8
|
||||
|
@ -2608,7 +2608,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
|
|||
* discouraged: Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).
|
||||
- returns: <[boolean]>
|
||||
|
||||
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
||||
Returns whether the element is [visible](../actionability.md#visible). [`param: selector`] that does not match any elements is considered not visible.
|
||||
|
||||
### param: Page.isVisible.selector = %%-input-selector-%%
|
||||
* since: v1.8
|
||||
|
@ -2714,8 +2714,7 @@ User can inspect selectors or perform manual steps while paused. Resume will con
|
|||
the place it was paused.
|
||||
|
||||
:::note
|
||||
This method requires Playwright to be started in a headed mode, with a falsy [`option: headless`] value in
|
||||
the [`method: BrowserType.launch`].
|
||||
This method requires Playwright to be started in a headed mode, with a falsy [`option: BrowserType.launch.headless`] option.
|
||||
:::
|
||||
|
||||
## async method: Page.pdf
|
||||
|
@ -3564,7 +3563,7 @@ Enabling routing disables http cache.
|
|||
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>
|
||||
|
||||
A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### param: Page.route.handler
|
||||
|
@ -3708,7 +3707,7 @@ await page.RouteWebSocketAsync("/ws", async ws => {
|
|||
* since: v1.48
|
||||
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>
|
||||
|
||||
Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [`option: baseURL`] from the context options.
|
||||
Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [`option: Browser.newContext.baseURL`] context option.
|
||||
|
||||
### param: Page.routeWebSocket.handler
|
||||
* since: v1.48
|
||||
|
@ -4072,7 +4071,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
|||
[TimeoutError]. Passing zero timeout disables this.
|
||||
|
||||
:::note
|
||||
[`method: Page.tap`] the method will throw if [`option: hasTouch`] option of the browser context is false.
|
||||
[`method: Page.tap`] the method will throw if [`option: Browser.newContext.hasTouch`] option of the browser context is false.
|
||||
:::
|
||||
|
||||
### param: Page.tap.selector = %%-input-selector-%%
|
||||
|
@ -4859,7 +4858,7 @@ await page.RunAndWaitForRequestAsync(async () =>
|
|||
- `urlOrPredicate` <[string]|[RegExp]|[function]\([Request]\):[boolean]>
|
||||
|
||||
Request URL string, regex or predicate receiving [Request] object.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### param: Page.waitForRequest.urlOrPredicate
|
||||
|
@ -5003,7 +5002,7 @@ await page.RunAndWaitForResponseAsync(async () =>
|
|||
- `urlOrPredicate` <[string]|[RegExp]|[function]\([Response]\):[boolean]>
|
||||
|
||||
Request URL string, regex or predicate receiving [Response] object.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### param: Page.waitForResponse.urlOrPredicate
|
||||
|
@ -5012,7 +5011,7 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We
|
|||
- `urlOrPredicate` <[string]|[RegExp]|[function]\([Response]\):[boolean]|[Promise]<[boolean]>>
|
||||
|
||||
Request URL string, regex or predicate receiving [Response] object.
|
||||
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
|
||||
When a [`option: Browser.newContext.baseURL`] 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.
|
||||
|
||||
### option: Page.waitForResponse.timeout
|
||||
|
|
|
@ -10,7 +10,7 @@ touchscreen can only be used in browser contexts that have been initialized with
|
|||
Dispatches a `touchstart` and `touchend` event with a single touch at the position ([`param: x`],[`param: y`]).
|
||||
|
||||
:::note
|
||||
[`method: Page.tap`] the method will throw if [`option: hasTouch`] option of the browser context is false.
|
||||
[`method: Page.tap`] the method will throw if [`option: Browser.newContext.hasTouch`] option of the browser context is false.
|
||||
:::
|
||||
|
||||
### param: Touchscreen.tap.x
|
||||
|
|
|
@ -121,7 +121,7 @@ await context.Tracing.StopAsync(new()
|
|||
- `name` <[string]>
|
||||
|
||||
If specified, intermediate trace files are going to be saved into the files with the
|
||||
given name prefix inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`].
|
||||
given name prefix inside the [`option: BrowserType.launch.tracesDir`] directory specified in [`method: BrowserType.launch`].
|
||||
To specify the final trace zip file name, you need to pass `path` option to
|
||||
[`method: Tracing.stop`] instead.
|
||||
|
||||
|
@ -277,7 +277,7 @@ Trace name to be shown in the Trace Viewer.
|
|||
- `name` <[string]>
|
||||
|
||||
If specified, intermediate trace files are going to be saved into the files with the
|
||||
given name prefix inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`].
|
||||
given name prefix inside the [`option: BrowserType.launch.tracesDir`] directory specified in [`method: BrowserType.launch`].
|
||||
To specify the final trace zip file name, you need to pass `path` option to
|
||||
[`method: Tracing.stopChunk`] instead.
|
||||
|
||||
|
|
|
@ -699,7 +699,7 @@ Logger sink for Playwright logging.
|
|||
- `content` ?<[HarContentPolicy]<"omit"|"embed"|"attach">> Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions.
|
||||
- `path` <[path]> Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default.
|
||||
- `mode` ?<[HarMode]<"full"|"minimal">> When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
|
||||
- `urlFilter` ?<[string]|[RegExp]> A glob or regex pattern to filter requests that are stored in the HAR. When a [`option: baseURL`] 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. Defaults to none.
|
||||
- `urlFilter` ?<[string]|[RegExp]> A glob or regex pattern to filter requests that are stored in the HAR. When a [`option: Browser.newContext.baseURL`] 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. Defaults to none.
|
||||
|
||||
Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not
|
||||
specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be
|
||||
|
@ -1046,7 +1046,7 @@ Close the browser process on SIGHUP. Defaults to `true`.
|
|||
Whether to run browser in headless mode. More details for
|
||||
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
|
||||
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the
|
||||
[`option: devtools`] option is `true`.
|
||||
[`option: BrowserType.launch.devtools`] option is `true`.
|
||||
|
||||
## js-python-browser-option-firefoxuserprefs
|
||||
* langs: js, python
|
||||
|
|
|
@ -451,7 +451,7 @@ will reset pre-configured user agent and device emulation.
|
|||
Playwright runs browsers in headless mode by default. To change this behavior,
|
||||
use `headless: false` as a launch option.
|
||||
|
||||
You can also use the [`option: slowMo`] option
|
||||
You can also use the [`option: BrowserType.launch.slowMo`] option
|
||||
to slow down execution (by N milliseconds per operation) and follow along while debugging.
|
||||
|
||||
```js
|
||||
|
|
|
@ -80,7 +80,7 @@ If there is no listener for [`event: Page.dialog`], all dialogs are automaticall
|
|||
|
||||
## beforeunload dialog
|
||||
|
||||
When [`method: Page.close`] is invoked with the truthy [`option: runBeforeUnload`] value, the page runs its unload handlers. This is the only case when [`method: Page.close`] does not wait for the page to actually close, because it might be that the page stays open in the end of the operation.
|
||||
When [`method: Page.close`] is invoked with the truthy [`option: Page.close.runBeforeUnload`] value, the page runs its unload handlers. This is the only case when [`method: Page.close`] does not wait for the page to actually close, because it might be that the page stays open in the end of the operation.
|
||||
|
||||
You can register a dialog handler to handle the `beforeunload` dialog yourself:
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ title: "Downloads"
|
|||
|
||||
For every attachment downloaded by the page, [`event: Page.download`] event is emitted. All these attachments are downloaded into a temporary folder. You can obtain the download url, file name and payload stream using the [Download] object from the event.
|
||||
|
||||
You can specify where to persist downloaded files using the [`option: downloadsPath`] option in [`method: BrowserType.launch`].
|
||||
You can specify where to persist downloaded files using the [`option: BrowserType.launch.downloadsPath`] option in [`method: BrowserType.launch`].
|
||||
|
||||
:::note
|
||||
Downloaded files are deleted when the browser context that produced them is closed.
|
||||
|
|
|
@ -112,7 +112,7 @@ public class App {
|
|||
}
|
||||
```
|
||||
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, pass the `setHeadless(false)` flag while launching the browser. You can also use [`option: slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, [`option: BrowserType.launch.headless`] option to `false`. You can also use [`option: BrowserType.launch.slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
|
||||
```java
|
||||
playwright.firefox().launch(new BrowserType.LaunchOptions().setHeadless(false).setSlowMo(50));
|
||||
|
|
|
@ -48,7 +48,7 @@ Now run it.
|
|||
dotnet run
|
||||
```
|
||||
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, pass the `Headless = false` flag while launching the browser. You can also use [`option: slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, set [`option: BrowserType.launch.headless`] option to `false`. You can also use [`option: BrowserType.launch.slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
|
||||
```csharp
|
||||
await using var browser = await playwright.Firefox.LaunchAsync(new()
|
||||
|
|
|
@ -75,7 +75,7 @@ with sync_playwright() as p:
|
|||
browser.close()
|
||||
```
|
||||
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, pass the `headless=False` flag while launching the browser. You can also use [`option: slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
By default, Playwright runs the browsers in headless mode. To see the browser UI, set [`option: BrowserType.launch.headless`] option to `False`. You can also use [`option: BrowserType.launch.slowMo`] to slow down execution. Learn more in the debugging tools [section](./debug.md).
|
||||
|
||||
```py
|
||||
firefox.launch(headless=False, slow_mo=50)
|
||||
|
|
|
@ -21,8 +21,8 @@ The Network tab in the trace viewer has several nice improvements:
|
|||
- The `mcr.microsoft.com/playwright/dotnet:v1.47.0` now serves a Playwright image based on Ubuntu 24.04 Noble.
|
||||
To use the 22.04 jammy-based image, please use `mcr.microsoft.com/playwright/dotnet:v1.47.0-jammy` instead.
|
||||
- The `:latest`/`:focal`/`:jammy` tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: cert`] and [`option: key`] as byte arrays instead of file paths.
|
||||
- [`option: noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: Browser.newContext.clientCertificates.cert`] and [`option: Browser.newContext.clientCertificates.key`] as byte arrays instead of file paths.
|
||||
- [`option: Locator.selectOption.noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions `macos-13`. We recommend upgrading GitHub Actions to `macos-14`.
|
||||
|
||||
### Browser Versions
|
||||
|
@ -284,7 +284,7 @@ await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Light and easy" })
|
|||
|
||||
### New APIs
|
||||
|
||||
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
|
||||
- [`method: Page.pdf`] accepts two new options [`option: Page.pdf.tagged`] and [`option: Page.pdf.outline`].
|
||||
|
||||
### Announcements
|
||||
|
||||
|
@ -307,7 +307,7 @@ This version was also tested against the following stable channels:
|
|||
|
||||
- New method [`method: Page.unrouteAll`] removes all routes registered by [`method: Page.route`] and [`method: Page.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New method [`method: BrowserContext.unrouteAll`] removes all routes registered by [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New option [`option: style`] in [`method: Page.screenshot`] and [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
- New options [`option: Page.screenshot.style`] in [`method: Page.screenshot`] and [`option: Locator.screenshot.style`] in [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
@ -345,8 +345,8 @@ await Expect(Page.GetByPlaceholder("Search docs")).ToHaveValueAsync("locator");
|
|||
|
||||
### New APIs
|
||||
|
||||
- Option [`option: reason`] in [`method: Page.close`], [`method: BrowserContext.close`] and [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
- Options [`option: Page.close.reason`] in [`method: Page.close`], [`option: BrowserContext.close.reason`] in [`method: BrowserContext.close`] and [`option: Browser.close.reason`] in [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: BrowserType.launchPersistentContext.firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
|
||||
### Other Changes
|
||||
|
||||
|
@ -517,7 +517,7 @@ This version was also tested against the following stable channels:
|
|||
await Page.GetByRole(AriaRole.Button, new() { Name = "Dismiss" }).ClickAsync();
|
||||
await newEmail.ClickAsync();
|
||||
```
|
||||
* Use new options [`option: hasNot`] and [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
* Use new options [`option: Locator.filter.hasNot`] and [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
to find elements that **do not match** certain conditions.
|
||||
|
||||
```csharp
|
||||
|
@ -534,10 +534,10 @@ This version was also tested against the following stable channels:
|
|||
### New APIs
|
||||
|
||||
- [`method: Locator.or`]
|
||||
- New option [`option: hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
- [`method: LocatorAssertions.toBeAttached`]
|
||||
- New option [`option: timeout`] in [`method: Route.fetch`]
|
||||
- New option [`option: Route.fetch.timeout`] in [`method: Route.fetch`]
|
||||
|
||||
### ⚠️ Breaking change
|
||||
|
||||
|
@ -560,9 +560,9 @@ This version was also tested against the following stable channels:
|
|||
|
||||
### New APIs
|
||||
|
||||
- New options [`option: updateMode`] and [`option: updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- New options [`option: Page.routeFromHAR.updateMode`] and [`option: Page.routeFromHAR.updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- Chaining existing locator objects, see [locator docs](./locators.md#matching-inside-a-locator) for details.
|
||||
- New option [`option: name`] in method [`method: Tracing.startChunk`].
|
||||
- New option [`option: Tracing.startChunk.name`] in method [`method: Tracing.startChunk`].
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ The Network tab in the trace viewer has several nice improvements:
|
|||
- The `mcr.microsoft.com/playwright/java:v1.47.0` now serves a Playwright image based on Ubuntu 24.04 Noble.
|
||||
To use the 22.02 jammy-based image, please use `mcr.microsoft.com/playwright/java:v1.47.0-jammy` instead.
|
||||
- The `:latest`/`:focal`/`:jammy` tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: cert`] and [`option: key`] as byte arrays instead of file paths.
|
||||
- [`option: noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: Browser.newContext.clientCertificates.cert`] and [`option: Browser.newContext.clientCertificates.key`] as byte arrays instead of file paths.
|
||||
- [`option: Locator.selectOption.noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions `macos-13`. We recommend upgrading GitHub Actions to `macos-14`.
|
||||
|
||||
### Browser Versions
|
||||
|
@ -349,7 +349,7 @@ assertThat(page.getByRole(AriaRole.HEADING, new Page.GetByRoleOptions().setName(
|
|||
|
||||
### New APIs
|
||||
|
||||
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
|
||||
- [`method: Page.pdf`] accepts two new options [`option: Page.pdf.tagged`] and [`option: Page.pdf.outline`].
|
||||
|
||||
### Announcements
|
||||
|
||||
|
@ -372,7 +372,7 @@ This version was also tested against the following stable channels:
|
|||
|
||||
- New method [`method: Page.unrouteAll`] removes all routes registered by [`method: Page.route`] and [`method: Page.routeFromHAR`].
|
||||
- New method [`method: BrowserContext.unrouteAll`] removes all routes registered by [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- New option [`option: style`] in [`method: Page.screenshot`] and [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
- New options [`option: Page.screenshot.style`] in [`method: Page.screenshot`] and [`option: Locator.screenshot.style`] in [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
@ -410,8 +410,8 @@ assertThat(page.getByPlaceholder("Search docs")).hasValue("locator");
|
|||
|
||||
### New APIs
|
||||
|
||||
- Option [`option: reason`] in [`method: Page.close`], [`method: BrowserContext.close`] and [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
- Options [`option: Page.close.reason`] in [`method: Page.close`], [`option: BrowserContext.close.reason`] in [`method: BrowserContext.close`] and [`option: Browser.close.reason`] in [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: BrowserType.launchPersistentContext.firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
|
||||
### Other Changes
|
||||
|
||||
|
@ -597,7 +597,7 @@ This version was also tested against the following stable channels:
|
|||
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Dismiss")).click();
|
||||
newEmail.click();
|
||||
```
|
||||
* Use new options [`option: hasNot`] and [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
* Use new options [`option: Locator.filter.hasNot`] and [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
to find elements that **do not match** certain conditions.
|
||||
|
||||
```java
|
||||
|
@ -616,10 +616,10 @@ This version was also tested against the following stable channels:
|
|||
### New APIs
|
||||
|
||||
- [`method: Locator.or`]
|
||||
- New option [`option: hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
- [`method: LocatorAssertions.toBeAttached`]
|
||||
- New option [`option: timeout`] in [`method: Route.fetch`]
|
||||
- New option [`option: Route.fetch.timeout`] in [`method: Route.fetch`]
|
||||
|
||||
### Other highlights
|
||||
|
||||
|
@ -646,9 +646,9 @@ This version was also tested against the following stable channels:
|
|||
|
||||
### New APIs
|
||||
|
||||
- New options [`option: updateMode`] and [`option: updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- New options [`option: Page.routeFromHAR.updateMode`] and [`option: Page.routeFromHAR.updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- Chaining existing locator objects, see [locator docs](./locators.md#matching-inside-a-locator) for details.
|
||||
- New option [`option: name`] in method [`method: Tracing.startChunk`].
|
||||
- New option [`option: Tracing.startChunk.name`] in method [`method: Tracing.startChunk`].
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
|
|
@ -44,16 +44,16 @@ test('query params', async ({ request }) => {
|
|||
);
|
||||
// ...
|
||||
});
|
||||
```
|
||||
```
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- The `mcr.microsoft.com/playwright:v1.47.0` now serves a Playwright image based on Ubuntu 24.04 Noble.
|
||||
To use the 22.04 jammy-based image, please use `mcr.microsoft.com/playwright:v1.47.0-jammy` instead.
|
||||
- New option [`option: behavior`] in [`method: Page.removeAllListeners`], [`method: Browser.removeAllListeners`] and [`method: BrowserContext.removeAllListeners`] to wait for ongoing listeners to complete.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: cert`] and [`option: key`] as buffers instead of file paths.
|
||||
- New options [`option: Page.removeAllListeners.behavior`], [`option: Browser.removeAllListeners.behavior`] and [`option: BrowserContext.removeAllListeners.behavior`] to wait for ongoing listeners to complete.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: Browser.newContext.clientCertificates.cert`] and [`option: Browser.newContext.clientCertificates.key`] as buffers instead of file paths.
|
||||
- Attachments with a `text/html` content type can now be opened in a new tab in the HTML report. This is useful for including third-party reports or other HTML content in the Playwright test report and distributing it to your team.
|
||||
- [`option: noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- [`option: Locator.selectOption.noWaitAfter`] option in [`method: Locator.selectOption`] was deprecated.
|
||||
- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions `macos-13`. We recommend upgrading GitHub Actions to `macos-14`.
|
||||
|
||||
### Browser Versions
|
||||
|
@ -528,7 +528,7 @@ This version was also tested against the following stable channels:
|
|||
|
||||
- New method [`method: Page.unrouteAll`] removes all routes registered by [`method: Page.route`] and [`method: Page.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New method [`method: BrowserContext.unrouteAll`] removes all routes registered by [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New option [`option: style`] in [`method: Page.screenshot`] and [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
- New options [`option: Page.screenshot.style`] in [`method: Page.screenshot`] and [`option: Locator.screenshot.style`] in [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
- New option `stylePath` for methods [`method: PageAssertions.toHaveScreenshot#1`] and [`method: LocatorAssertions.toHaveScreenshot#1`] to apply a custom stylesheet while making the screenshot.
|
||||
- New `fileName` option for [Blob reporter](./test-reporters#blob-reporter), to specify the name of the report to be created.
|
||||
|
||||
|
@ -577,8 +577,8 @@ test('test', async ({ page }) => {
|
|||
|
||||
### New APIs
|
||||
|
||||
- Option [`option: reason`] in [`method: Page.close`], [`method: BrowserContext.close`] and [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
- Options [`option: Page.close.reason`] in [`method: Page.close`], [`option: BrowserContext.close.reason`] in [`method: BrowserContext.close`] and [`option: Browser.close.reason`] in [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: BrowserType.launchPersistentContext.firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
|
||||
### Other Changes
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ This version was also tested against the following stable channels:
|
|||
await page.getByRole('button', { name: 'Dismiss' }).click();
|
||||
await newEmail.click();
|
||||
```
|
||||
* Use new options [`option: hasNot`] and [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
* Use new options [`option: Locator.filter.hasNot`] and [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
to find elements that **do not match** certain conditions.
|
||||
|
||||
```js
|
||||
|
@ -1064,10 +1064,10 @@ This version was also tested against the following stable channels:
|
|||
### New APIs
|
||||
|
||||
- [`method: Locator.or`]
|
||||
- New option [`option: hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
- [`method: LocatorAssertions.toBeAttached`]
|
||||
- New option [`option: timeout`] in [`method: Route.fetch`]
|
||||
- New option [`option: Route.fetch.timeout`] in [`method: Route.fetch`]
|
||||
- [`method: Reporter.onExit`]
|
||||
|
||||
### ⚠️ Breaking change
|
||||
|
@ -1107,10 +1107,10 @@ npx playwright test --ui
|
|||
|
||||
### New APIs
|
||||
|
||||
- New options [`option: updateMode`] and [`option: updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- New options [`option: Page.routeFromHAR.updateMode`] and [`option: Page.routeFromHAR.updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- Chaining existing locator objects, see [locator docs](./locators.md#matching-inside-a-locator) for details.
|
||||
- New property [`property: TestInfo.testId`].
|
||||
- New option [`option: name`] in method [`method: Tracing.startChunk`].
|
||||
- New option [`option: Tracing.startChunk.name`] in method [`method: Tracing.startChunk`].
|
||||
|
||||
|
||||
### ⚠️ Breaking change in component tests
|
||||
|
|
|
@ -21,8 +21,8 @@ The Network tab in the trace viewer has several nice improvements:
|
|||
- The `mcr.microsoft.com/playwright/python:v1.47.0` now serves a Playwright image based on Ubuntu 24.04 Noble.
|
||||
To use the 22.04 jammy-based image, please use `mcr.microsoft.com/playwright/python:v1.47.0-jammy` instead.
|
||||
- The `:latest`/`:focal`/`:jammy` tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: cert`] and [`option: key`] as bytes instead of file paths.
|
||||
- [`option: noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- TLS client certificates can now be passed from memory by passing [`option: Browser.newContext.clientCertificates.cert`] and [`option: Browser.newContext.clientCertificates.key`] as bytes instead of file paths.
|
||||
- [`option: Locator.selectOption.noWaitAfter`] in [`method: Locator.selectOption`] was deprecated.
|
||||
- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions `macos-13`. We recommend upgrading GitHub Actions to `macos-14`.
|
||||
|
||||
### Browser Versions
|
||||
|
@ -260,7 +260,7 @@ expect(page.get_by_role("heading", name="Light and easy")).to_be_visible()
|
|||
|
||||
### New APIs
|
||||
|
||||
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
|
||||
- [`method: Page.pdf`] accepts two new options [`option: Page.pdf.tagged`] and [`option: Page.pdf.outline`].
|
||||
|
||||
### Announcements
|
||||
|
||||
|
@ -283,7 +283,7 @@ This version was also tested against the following stable channels:
|
|||
|
||||
- New method [`method: Page.unrouteAll`] removes all routes registered by [`method: Page.route`] and [`method: Page.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New method [`method: BrowserContext.unrouteAll`] removes all routes registered by [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
|
||||
- New option [`option: style`] in [`method: Page.screenshot`] and [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
- New options [`option: Page.screenshot.style`] in [`method: Page.screenshot`] and [`option: Locator.screenshot.style`] in [`method: Locator.screenshot`] to add custom CSS to the page before taking a screenshot.
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
@ -324,8 +324,8 @@ def test_example(page: Page) -> None:
|
|||
|
||||
### New APIs
|
||||
|
||||
- Option [`option: reason`] in [`method: Page.close`], [`method: BrowserContext.close`] and [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
- Options [`option: Page.close.reason`] in [`method: Page.close`], [`option: BrowserContext.close.reason`] in [`method: BrowserContext.close`] and [`option: Browser.close.reason`] in [`method: Browser.close`]. Close reason is reported for all operations interrupted by the closure.
|
||||
- Option [`option: BrowserType.launchPersistentContext.firefoxUserPrefs`] in [`method: BrowserType.launchPersistentContext`].
|
||||
|
||||
### Other Changes
|
||||
|
||||
|
@ -504,7 +504,7 @@ This version was also tested against the following stable channels:
|
|||
page.get_by_role("button", name="Dismiss").click()
|
||||
new_email.click()
|
||||
```
|
||||
* Use new options [`option: hasNot`] and [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
* Use new options [`option: Locator.filter.hasNot`] and [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
to find elements that **do not match** certain conditions.
|
||||
|
||||
```python
|
||||
|
@ -520,10 +520,10 @@ This version was also tested against the following stable channels:
|
|||
### New APIs
|
||||
|
||||
- [`method: Locator.or`]
|
||||
- New option [`option: hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: hasNotText`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNot`] in [`method: Locator.filter`]
|
||||
- New option [`option: Locator.filter.hasNotText`] in [`method: Locator.filter`]
|
||||
- [`method: LocatorAssertions.toBeAttached`]
|
||||
- New option [`option: timeout`] in [`method: Route.fetch`]
|
||||
- New option [`option: Route.fetch.timeout`] in [`method: Route.fetch`]
|
||||
|
||||
### ⚠️ Breaking change
|
||||
|
||||
|
@ -547,9 +547,9 @@ This version was also tested against the following stable channels:
|
|||
### New APIs
|
||||
|
||||
- Custom expect message, see [test assertions documentation](./test-assertions.md#custom-expect-message).
|
||||
- New options [`option: updateMode`] and [`option: updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- New options [`option: Page.routeFromHAR.updateMode`] and [`option: Page.routeFromHAR.updateContent`] in [`method: Page.routeFromHAR`] and [`method: BrowserContext.routeFromHAR`].
|
||||
- Chaining existing locator objects, see [locator docs](./locators.md#matching-inside-a-locator) for details.
|
||||
- New option [`option: name`] in method [`method: Tracing.startChunk`].
|
||||
- New option [`option: Tracing.startChunk.name`] in method [`method: Tracing.startChunk`].
|
||||
|
||||
### Browser Versions
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ export default defineConfig({
|
|||
- type: ?<[Object]>
|
||||
- `timeout` ?<[int]> Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
|
||||
- `toHaveScreenshot` ?<[Object]> Configuration for the [`method: PageAssertions.toHaveScreenshot#1`] method.
|
||||
- `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
|
||||
- `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
|
||||
- `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
|
||||
- `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
|
||||
- `maxDiffPixels` ?<[int]> An acceptable amount of pixels that could be different, unset by default.
|
||||
- `maxDiffPixelRatio` ?<[float]> An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
|
||||
- `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
|
||||
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: style`] in [`method: Page.screenshot`].
|
||||
- `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
|
||||
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: Page.screenshot.style`] in [`method: Page.screenshot`].
|
||||
- `threshold` ?<[float]> An acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
|
||||
- `toMatchSnapshot` ?<[Object]> Configuration for the [`method: SnapshotAssertions.toMatchSnapshot#1`] method.
|
||||
- `maxDiffPixels` ?<[int]> An acceptable amount of pixels that could be different, unset by default.
|
||||
|
|
|
@ -94,10 +94,10 @@ export default defineConfig({
|
|||
- `threshold` ?<[float]> an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
|
||||
- `maxDiffPixels` ?<[int]> an acceptable amount of pixels that could be different, unset by default.
|
||||
- `maxDiffPixelRatio` ?<[float]> an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
|
||||
- `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
|
||||
- `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
|
||||
- `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
|
||||
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: style`] in [`method: Page.screenshot`].
|
||||
- `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
|
||||
- `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
|
||||
- `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
|
||||
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: Page.screenshot.style`] in [`method: Page.screenshot`].
|
||||
- `toMatchSnapshot` ?<[Object]> Configuration for the [`method: SnapshotAssertions.toMatchSnapshot#1`] method.
|
||||
- `threshold` ?<[float]> an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
|
||||
- `maxDiffPixels` ?<[int]> an acceptable amount of pixels that could be different, unset by default.
|
||||
|
|
|
@ -31,7 +31,7 @@ In the Actions tab you can see what locator was used for every action and how lo
|
|||
|
||||
### Screenshots
|
||||
|
||||
When tracing with the [`option: screenshots`] option turned on (default), each trace records a screencast and renders it as a film strip. You can hover over the film strip to see a magnified image of for each action and state which helps you easily find the action you want to inspect.
|
||||
When tracing with the [`option: Tracing.start.screenshots`] option turned on (default), each trace records a screencast and renders it as a film strip. You can hover over the film strip to see a magnified image of for each action and state which helps you easily find the action you want to inspect.
|
||||
|
||||
Double click on an action to see the time range for that action. You can use the slider in the timeline to increase the actions selected and these will be shown in the Actions tab and all console logs and network logs will be filtered to only show the logs for the actions selected.
|
||||
|
||||
|
@ -40,7 +40,7 @@ Double click on an action to see the time range for that action. You can use the
|
|||
|
||||
### Snapshots
|
||||
|
||||
When tracing with the [`option: snapshots`] option turned on (default), Playwright captures a set of complete DOM snapshots for each action. Depending on the type of the action, it will capture:
|
||||
When tracing with the [`option: Tracing.start.snapshots`] option turned on (default), Playwright captures a set of complete DOM snapshots for each action. Depending on the type of the action, it will capture:
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
|
|
|
@ -3437,8 +3437,7 @@ export interface Page {
|
|||
* User can inspect selectors or perform manual steps while paused. Resume will continue running the original script
|
||||
* from the place it was paused.
|
||||
*
|
||||
* **NOTE** This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the
|
||||
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
|
||||
* **NOTE** This method requires Playwright to be started in a headed mode, with a falsy `headless` option.
|
||||
*/
|
||||
pause(): Promise<void>;
|
||||
|
||||
|
@ -3723,8 +3722,8 @@ export interface Page {
|
|||
*
|
||||
* **NOTE** [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-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
|
||||
* `Browser.newContext.serviceWorkers` to `'block'`.
|
||||
* issue. We recommend disabling Service Workers when using request interception by setting `serviceWorkers` to
|
||||
* `'block'`.
|
||||
*
|
||||
* **NOTE** [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) will not
|
||||
* intercept the first request of a popup page. Use
|
||||
|
@ -3790,7 +3789,7 @@ export interface Page {
|
|||
*
|
||||
* Playwright will not serve requests intercepted by Service Worker from the HAR file. See
|
||||
* [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
|
||||
* using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
||||
* using request interception by setting `serviceWorkers` to `'block'`.
|
||||
* @param har Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a
|
||||
* relative path, then it is resolved relative to the current working directory.
|
||||
* @param options
|
||||
|
@ -3855,7 +3854,7 @@ export interface Page {
|
|||
* ```
|
||||
*
|
||||
* @param url Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the
|
||||
* `baseURL` from the context options.
|
||||
* `baseURL` context option.
|
||||
* @param handler Handler function to route the WebSocket.
|
||||
*/
|
||||
routeWebSocket(url: string|RegExp|((url: URL) => boolean), handler: ((websocketroute: WebSocketRoute) => Promise<any>|any)): Promise<void>;
|
||||
|
@ -8597,7 +8596,7 @@ export interface BrowserContext {
|
|||
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#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 `Browser.newContext.serviceWorkers` to `'block'`.
|
||||
* using request interception by setting `serviceWorkers` to `'block'`.
|
||||
*
|
||||
* **Usage**
|
||||
*
|
||||
|
@ -8660,7 +8659,7 @@ export interface BrowserContext {
|
|||
*
|
||||
* Playwright will not serve requests intercepted by Service Worker from the HAR file. See
|
||||
* [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
|
||||
* using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
||||
* using request interception by setting `serviceWorkers` to `'block'`.
|
||||
* @param har Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a
|
||||
* relative path, then it is resolved relative to the current working directory.
|
||||
* @param options
|
||||
|
@ -8725,7 +8724,7 @@ export interface BrowserContext {
|
|||
* ```
|
||||
*
|
||||
* @param url Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the
|
||||
* `baseURL` from the context options.
|
||||
* `baseURL` context option.
|
||||
* @param handler Handler function to route the WebSocket.
|
||||
*/
|
||||
routeWebSocket(url: string|RegExp|((url: URL) => boolean), handler: ((websocketroute: WebSocketRoute) => Promise<any>|any)): Promise<void>;
|
||||
|
@ -16863,7 +16862,7 @@ export interface APIRequestContext {
|
|||
* ```
|
||||
*
|
||||
* The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`
|
||||
* encoding. Use [FormData] to construct request body and pass it to the request as `multipart` parameter:
|
||||
* encoding, by specifiying the `multipart` parameter:
|
||||
*
|
||||
* ```js
|
||||
* const form = new FormData();
|
||||
|
@ -20164,7 +20163,7 @@ export interface Tracing {
|
|||
start(options?: {
|
||||
/**
|
||||
* If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the
|
||||
* `tracesDir` folder specified in
|
||||
* `tracesDir` directory specified in
|
||||
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). To specify
|
||||
* the final trace zip file name, you need to pass `path` option to
|
||||
* [tracing.stop([options])](https://playwright.dev/docs/api/class-tracing#tracing-stop) instead.
|
||||
|
@ -20224,7 +20223,7 @@ export interface Tracing {
|
|||
startChunk(options?: {
|
||||
/**
|
||||
* If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the
|
||||
* `tracesDir` folder specified in
|
||||
* `tracesDir` directory specified in
|
||||
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). To specify
|
||||
* the final trace zip file name, you need to pass `path` option to
|
||||
* [tracing.stopChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-stop-chunk) instead.
|
||||
|
|
|
@ -130,14 +130,17 @@ async function run() {
|
|||
{
|
||||
const langs = ['js', 'java', 'python', 'csharp'];
|
||||
const documentationRoot = path.join(PROJECT_DIR, 'docs', 'src');
|
||||
const apiRoot = path.join(documentationRoot, 'api');
|
||||
const testApiRoot = path.join(documentationRoot, 'test-api');
|
||||
const testReporterApiRoot = path.join(documentationRoot, 'test-reporter-api');
|
||||
for (const lang of langs) {
|
||||
try {
|
||||
let documentation = parseApi(path.join(documentationRoot, 'api'));
|
||||
let documentation = parseApi(apiRoot);
|
||||
if (lang === 'js') {
|
||||
documentation = documentation.mergeWith(
|
||||
parseApi(path.join(documentationRoot, 'test-api'), path.join(documentationRoot, 'api', 'params.md'))
|
||||
parseApi(testApiRoot, path.join(documentationRoot, 'api', 'params.md'))
|
||||
).mergeWith(
|
||||
parseApi(path.join(documentationRoot, 'test-reporter-api'))
|
||||
parseApi(testReporterApiRoot)
|
||||
);
|
||||
}
|
||||
documentation.filterForLanguage(lang);
|
||||
|
@ -183,7 +186,8 @@ async function run() {
|
|||
// Validates code snippet groups.
|
||||
rootNode = docs.processCodeGroups(rootNode, lang, tabs => tabs.map(tab => tab.spec));
|
||||
// Renders links.
|
||||
documentation.renderLinksInNodes(rootNode);
|
||||
if (!filePath.startsWith(apiRoot) && !filePath.startsWith(testApiRoot) && !filePath.startsWith(testReporterApiRoot))
|
||||
documentation.renderLinksInNodes(rootNode);
|
||||
// Validate links.
|
||||
{
|
||||
md.visitAll(rootNode, node => {
|
||||
|
|
|
@ -47,6 +47,7 @@ const md = require('../markdown');
|
|||
* member?: Member,
|
||||
* param?: string,
|
||||
* option?: string,
|
||||
* optionFullPath?: string,
|
||||
* href?: string,
|
||||
* }): string|undefined} Renderer
|
||||
*/
|
||||
|
@ -737,23 +738,49 @@ function patchLinksInText(classOrMember, text, classesMap, membersMap, linkRende
|
|||
const memberName = p1 + ': ' + p2;
|
||||
const member = membersMap.get(memberName);
|
||||
if (!member)
|
||||
throw new Error('Undefined member references: ' + match);
|
||||
throw new Error(`Undefined member reference: ${match}\n=========\n${text}`);
|
||||
return linkRenderer({ member, href }) || match;
|
||||
}
|
||||
if (p1 === 'param') {
|
||||
let alias = p2;
|
||||
if (classOrMember) {
|
||||
// param/option reference can only be in method or same method parameter comments.
|
||||
const method = /** @type {Member} */(classOrMember).enclosingMethod;
|
||||
const param = method?.argsArray.find(a => a.name === p2);
|
||||
if (!param)
|
||||
throw new Error(`Referenced parameter ${match} not found in the parent method ${method?.name} `);
|
||||
alias = param.alias;
|
||||
if (p1 === 'param' || p1 === 'option') {
|
||||
let /** @type {string } */ alias;
|
||||
let /** @type {Member} */ member;
|
||||
if (p2.includes('.')) {
|
||||
// fully-qualified name
|
||||
const [className, memberName, ...rest] = p2.split('.');
|
||||
const maybeMember = membersMap.get(`method: ${className}.${memberName}`);
|
||||
if (!maybeMember)
|
||||
throw new Error(`Undefined reference: ${match}\n=========\n${text}`);
|
||||
member = maybeMember;
|
||||
alias = rest.join('.');
|
||||
} else {
|
||||
// non-fully-qualified param/option reference from the same method.
|
||||
if (!classOrMember || !(classOrMember instanceof Member)) {
|
||||
Error.stackTraceLimit = 100;
|
||||
throw new Error(`No parent method to find referenced ${match}\n=========\n${text}`);
|
||||
}
|
||||
const maybeMember = classOrMember.enclosingMethod;
|
||||
if (!maybeMember)
|
||||
throw new Error(`Undefined reference: ${match}\n=========\n${text}`);
|
||||
member = maybeMember;
|
||||
alias = p2;
|
||||
}
|
||||
if (p1 === 'param') {
|
||||
const param = member.argsArray.find(a => a.name === alias);
|
||||
if (!param)
|
||||
throw new Error(`Referenced parameter ${match} not found in the parent method ${member.name}\n=========\n${text}`);
|
||||
alias = param.alias;
|
||||
return linkRenderer({ member, param: alias, href }) || match;
|
||||
} else {
|
||||
// p1 === 'option'
|
||||
const options = member.argsArray.find(a => a.name === 'options');
|
||||
const parts = alias.split('.');
|
||||
const option = options?.type?.properties?.find(a => a.name === parts[0]);
|
||||
if (!option)
|
||||
throw new Error(`Referenced option ${match} not found in the parent method ${member.name}\n=========\n${text}`);
|
||||
parts[0] = option.alias;
|
||||
return linkRenderer({ member, option: parts[0], optionFullPath: parts.join('.'), href }) || match;
|
||||
}
|
||||
return linkRenderer({ param: alias, href }) || match;
|
||||
}
|
||||
if (p1 === 'option')
|
||||
return linkRenderer({ option: p2, href }) || match;
|
||||
throw new Error(`Undefined link prefix, expected event|method|property|param|option, got: ` + match);
|
||||
});
|
||||
text = text.replace(/\[([\w]+)\](?:\(([^)]*?)\))?/g, (match, p1, href) => {
|
||||
|
@ -830,7 +857,8 @@ function patchCSharpOptionOverloads(optionsArg, options = {}) {
|
|||
}
|
||||
if (options.csharpOptionOverloadsShortNotation) {
|
||||
const newProp = prop.clone();
|
||||
newProp.alias = newProp.name = shortNotation.join('|');
|
||||
newProp.name = prop.name;
|
||||
newProp.alias = shortNotation.join('|');
|
||||
propsToAdd.push(newProp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,9 +94,9 @@ class LintingService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {string} command
|
||||
* @param {string} command
|
||||
* @param {string[]} args
|
||||
* @param {CodeSnippet[]} snippets
|
||||
* @param {CodeSnippet[]} snippets
|
||||
* @param {string} cwd
|
||||
* @returns {Promise<LintResult[]>}
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ class LintingService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {CodeSnippet[]} snippets
|
||||
* @param {CodeSnippet[]} snippets
|
||||
* @returns {Promise<LintResult[]>}
|
||||
*/
|
||||
async lint(snippets) {
|
||||
|
@ -139,6 +139,7 @@ class JSLintingService extends LintingService {
|
|||
this.eslint = new ESLint({
|
||||
overrideConfigFile: path.join(PROJECT_DIR, '.eslintrc.js'),
|
||||
useEslintrc: false,
|
||||
// @ts-ignore
|
||||
overrideConfig: {
|
||||
plugins: ['react'],
|
||||
settings: {
|
||||
|
@ -290,8 +291,8 @@ class LintingServiceFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {string} language
|
||||
* @param {LintResult} result
|
||||
* @param {string} language
|
||||
* @param {LintResult} result
|
||||
*/
|
||||
_collectMetrics(language, result) {
|
||||
if (!this._metrics[language])
|
||||
|
|
Loading…
Reference in New Issue