diff --git a/dotnet/docs/actionability.mdx b/dotnet/docs/actionability.mdx index adf06b018d..a8accf11ce 100644 --- a/dotnet/docs/actionability.mdx +++ b/dotnet/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [Expect(Locator).ToHaveAttributeAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [Expect(Locator).ToHaveClassAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [Expect(Locator).ToHaveCountAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [Expect(Locator).ToHaveIdAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [Expect(Locator).ToHaveJSPropertyAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/dotnet/docs/api/class-locatorassertions.mdx b/dotnet/docs/api/class-locatorassertions.mdx index ff0fd74174..a36956dd63 100644 --- a/dotnet/docs/api/class-locatorassertions.mdx +++ b/dotnet/docs/api/class-locatorassertions.mdx @@ -384,7 +384,7 @@ Let's see how we can use the assertion: ```csharp // ✓ Contains the right items in the right order -await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"}); +await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"}); // ✖ Wrong order await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"}); @@ -609,7 +609,7 @@ await Expect(locator).ToHaveCountAsync(3); --- -### ToHaveCSSAsync {#locator-assertions-to-have-css-1} +### ToHaveCSSAsync {#locator-assertions-to-have-css} Added in: v1.20locatorAssertions.ToHaveCSSAsync @@ -623,19 +623,19 @@ await Expect(locator).ToHaveCSSAsync("display", "flex"); ``` **Arguments** -- `name` [string] Added in: v1.18# +- `name` [string] Added in: v1.18# CSS property name. -- `value` [string] | [Regex] Added in: v1.18# +- `value` [string] | [Regex] Added in: v1.18# CSS property value. - `options` `LocatorAssertionsToHaveCSSOptions?` *(optional)* - - `Timeout` [float]? *(optional)* Added in: v1.18# + - `Timeout` [float]? *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/dotnet/docs/test-assertions.mdx b/dotnet/docs/test-assertions.mdx index ebfe9091a4..7b84ee2c5f 100644 --- a/dotnet/docs/test-assertions.mdx +++ b/dotnet/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [Expect(Locator).ToHaveAttributeAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [Expect(Locator).ToHaveClassAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [Expect(Locator).ToHaveCountAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [Expect(Locator).ToHaveCSSAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [Expect(Locator).ToHaveIdAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [Expect(Locator).ToHaveJSPropertyAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [Expect(Locator).ToHaveRoleAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/images/speedboard-shards.png b/images/speedboard-shards.png deleted file mode 100644 index 3b39ccb2b1..0000000000 Binary files a/images/speedboard-shards.png and /dev/null differ diff --git a/images/timeline.png b/images/timeline.png new file mode 100644 index 0000000000..4d1a12035c Binary files /dev/null and b/images/timeline.png differ diff --git a/java/docs/actionability.mdx b/java/docs/actionability.mdx index 28854b57b0..b56e820111 100644 --- a/java/docs/actionability.mdx +++ b/java/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [assertThat(locator).hasAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [assertThat(locator).hasClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [assertThat(locator).hasCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [assertThat(locator).hasId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [assertThat(locator).hasJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/java/docs/api/class-locatorassertions.mdx b/java/docs/api/class-locatorassertions.mdx index 44c95d0dbb..3ecb640b41 100644 --- a/java/docs/api/class-locatorassertions.mdx +++ b/java/docs/api/class-locatorassertions.mdx @@ -107,7 +107,7 @@ Let's see how we can use the assertion: ```java // ✓ Contains the right items in the right order -assertThat(page.locator("ul > li")).containsText(new String[] {"Text 1", "Text 3", "Text 4"}); +assertThat(page.locator("ul > li")).containsText(new String[] {"Text 1", "Text 3"}); // ✖ Wrong order assertThat(page.locator("ul > li")).containsText(new String[] {"Text 3", "Text 2"}); @@ -328,7 +328,7 @@ assertThat(page.locator("list > .component")).hasCount(3); --- -### hasCSS {#locator-assertions-to-have-css-1} +### hasCSS {#locator-assertions-to-have-css} Added in: v1.20locatorAssertions.hasCSS @@ -341,19 +341,19 @@ assertThat(page.getByRole(AriaRole.BUTTON)).hasCSS("display", "flex"); ``` **Arguments** -- `name` [String] Added in: v1.18# +- `name` [String] Added in: v1.18# CSS property name. -- `value` [String] | [Pattern] Added in: v1.18# +- `value` [String] | [Pattern] Added in: v1.18# CSS property value. - `options` `LocatorAssertions.HasCSSOptions` *(optional)* - - `setTimeout` [double] *(optional)* Added in: v1.18# + - `setTimeout` [double] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [void]# +- [void]# --- diff --git a/java/docs/test-assertions.mdx b/java/docs/test-assertions.mdx index 42a2c02ab0..88dc40b867 100644 --- a/java/docs/test-assertions.mdx +++ b/java/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [assertThat(locator).hasAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [assertThat(locator).hasClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [assertThat(locator).hasCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [assertThat(locator).hasCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [assertThat(locator).hasId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [assertThat(locator).hasJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [assertThat(locator).hasRole()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/nodejs/docs/actionability.mdx b/nodejs/docs/actionability.mdx index e7efcafc8b..9227ce688b 100644 --- a/nodejs/docs/actionability.mdx +++ b/nodejs/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [expect(locator).toHaveAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).toHaveClass()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).toHaveCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).toHaveCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [expect(locator).toHaveCSS()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [expect(locator).toHaveId()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).toHaveJSProperty()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).toHaveText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx index 594c15e124..e3f22018b3 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -634,9 +634,9 @@ await expect(list).toHaveCount(3); --- -### toHaveCSS(name, value) {#locator-assertions-to-have-css-1} +### toHaveCSS {#locator-assertions-to-have-css} -Added in: v1.20locatorAssertions.toHaveCSS(name, value) +Added in: v1.20locatorAssertions.toHaveCSS Ensures the [Locator] resolves to an element with the given computed CSS style. @@ -648,54 +648,19 @@ await expect(locator).toHaveCSS('display', 'flex'); ``` **Arguments** -- `name` [string] Added in: v1.18# +- `name` [string] Added in: v1.18# CSS property name. -- `value` [string] | [RegExp] Added in: v1.18# +- `value` [string] | [RegExp] Added in: v1.18# CSS property value. - `options` [Object] *(optional)* - - `timeout` [number] *(optional)* Added in: v1.18# + - `timeout` [number] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. **Returns** -- [Promise]<[void]># - ---- - -### toHaveCSS(styles) {#locator-assertions-to-have-css-2} - -Added in: v1.58locatorAssertions.toHaveCSS(styles) - -Ensures the [Locator] resolves to an element with the given computed CSS properties. - -:::note - -The `CSSProperties` object parameter for toHaveCSS requires `react` to be installed for type checking. -::: - -**Usage** - -```js -const locator = page.getByRole('button'); -await expect(locator).toHaveCSS({ - display: 'flex', - backgroundColor: 'rgb(255, 0, 0)' -}); -``` - -**Arguments** -- `styles` [CSSProperties]# - - CSS properties object. -- `options` [Object] *(optional)* - - `timeout` [number] *(optional)*# - - Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`. - -**Returns** -- [Promise]<[void]># +- [Promise]<[void]># --- diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index ad5637ee4a..10b8a3ac60 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -279,6 +279,10 @@ await page.agent(options); - `cacheOutFile` [string] *(optional)* When specified, generated entries are written into the `cacheOutFile` instead of updating the `cacheFile`. + - `expect` [Object] *(optional)*# + - `timeout` [number] *(optional)* + + Default timeout for expect calls in milliseconds, defaults to 5000ms. - `limits` [Object] *(optional)*# - `maxTokens` [number] *(optional)* diff --git a/nodejs/docs/api/class-pageagent.mdx b/nodejs/docs/api/class-pageagent.mdx index f2820ede7d..e53b521f2f 100644 --- a/nodejs/docs/api/class-pageagent.mdx +++ b/nodejs/docs/api/class-pageagent.mdx @@ -60,7 +60,7 @@ await agent.expect('"0 items" to be reported'); Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. - `timeout` [number] *(optional)*# - Request timeout in milliseconds. Defaults to action timeout. Pass `0` to disable timeout. + Expect timeout in milliseconds. Defaults to `5000`. The default value can be changed via `expect.timeout` option in the config, or by specifying the `expect` property of the [expect](/api/class-page.mdx#page-agent-option-expect) option. Pass `0` to disable timeout. **Returns** - [Promise]<[void]># @@ -102,7 +102,7 @@ await agent.extract('List of items in the cart', z.object({ Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. - `timeout` [number] *(optional)*# - Request timeout in milliseconds. Defaults to action timeout. Pass `0` to disable timeout. + Extract timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or 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. Pass `0` to disable timeout. **Returns** - [Promise]<[Object]># @@ -153,7 +153,7 @@ await agent.perform('Click submit button'); Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to context-wide value specified in `agent` property. - `timeout` [number] *(optional)*# - Request timeout in milliseconds. Defaults to action timeout. Pass `0` to disable timeout. + Perform timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or 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. Pass `0` to disable timeout. **Returns** - [Promise]<[Object]># diff --git a/nodejs/docs/api/class-reporter.mdx b/nodejs/docs/api/class-reporter.mdx index 85d1fce53c..6e14897478 100644 --- a/nodejs/docs/api/class-reporter.mdx +++ b/nodejs/docs/api/class-reporter.mdx @@ -166,21 +166,6 @@ await reporter.onEnd(result); - `duration` [number] Test run duration in milliseconds. - - `shards` [Array]<[Object]> - - `shardIndex` [number] *(optional)* - - The index of the shard, one-based. - - `tag` [Array]<[string]> *(optional)* - - Global [testConfig.tag](/api/class-testconfig.mdx#test-config-tag) that differentiates CI environments - - `startTime` [Date] - - Start wall time of shard. - - `duration` [number] - - Shard run duration in milliseconds. - - Only present on merged reports Result of the full test run, `status` can be one of: * `'passed'` - Everything went as expected. diff --git a/nodejs/docs/api/class-testresult.mdx b/nodejs/docs/api/class-testresult.mdx index 7f36fbaf0f..52d9172399 100644 --- a/nodejs/docs/api/class-testresult.mdx +++ b/nodejs/docs/api/class-testresult.mdx @@ -163,23 +163,6 @@ testResult.retry --- -### shardIndex {#test-result-shard-index} - -Added in: v1.58testResult.shardIndex - -The index of the shard between `1` and [`shards`](../test-sharding.mdx). - -**Usage** - -```js -testResult.shardIndex -``` - -**Type** -- [number] - ---- - ### startTime {#test-result-start-time} Added in: v1.10testResult.startTime diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx index f4ae64316e..c57d018a8c 100644 --- a/nodejs/docs/ci.mdx +++ b/nodejs/docs/ci.mdx @@ -101,7 +101,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble options: --user 1001 steps: - uses: actions/checkout@v5 @@ -335,7 +335,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.57.0-noble +container: mcr.microsoft.com/playwright:v1.58.0-noble steps: - task: UseNode@1 @@ -359,7 +359,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-noble-development: docker: - - image: mcr.microsoft.com/playwright:v1.57.0-noble + - image: mcr.microsoft.com/playwright:v1.58.0-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -382,7 +382,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright:v1.57.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.58.0-noble' } } stages { stage('e2e-tests') { steps { @@ -399,7 +399,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright:v1.57.0-noble +image: mcr.microsoft.com/playwright:v1.58.0-noble ``` ### GitLab CI @@ -412,7 +412,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble script: ... ``` @@ -427,7 +427,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble parallel: 7 script: - npm ci @@ -442,7 +442,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble parallel: matrix: - PROJECT: ['chromium', 'webkit'] @@ -458,7 +458,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see ```yml steps: -- name: mcr.microsoft.com/playwright:v1.57.0-noble +- name: mcr.microsoft.com/playwright:v1.58.0-noble script: ... env: @@ -476,7 +476,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.57.0-noble + image: mcr.microsoft.com/playwright:v1.58.0-noble commands: - npx playwright test ``` diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index efadcb502c..25735df6ef 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -22,7 +22,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright:v1.57.0-noble +docker pull mcr.microsoft.com/playwright:v1.58.0-noble ``` ### Run the image @@ -34,7 +34,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.57.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.58.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.57.0-noble /bin/b On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.57.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.58.0-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the Start the Playwright Server in Docker: ```bash -docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.57.0-noble /bin/sh -c "npx -y playwright@1.57.0 run-server --port 3000 --host 0.0.0.0" +docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.58.0-noble /bin/sh -c "npx -y playwright@1.58.0 run-server --port 3000 --host 0.0.0.0" ``` #### Connecting to the Server @@ -105,7 +105,7 @@ const browser = await playwright['chromium'].connect('ws://127.0.0.1:3000/'); If you need to access local servers from within the Docker container: ```bash -docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.57.0-noble /bin/sh -c "npx -y playwright@1.57.0 run-server --port 3000 --host 0.0.0.0" +docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.58.0-noble /bin/sh -c "npx -y playwright@1.58.0 run-server --port 3000 --host 0.0.0.0" ``` This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers. @@ -138,9 +138,9 @@ Once this is enabled you can open the port specified in a new browser tab and yo See [all available image tags]. We currently publish images with the following tags: -- `:v1.57.0` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.57.0-noble` - Playwright v1.57.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.57.0-jammy` - Playwright v1.57.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.58.0` - Playwright v1.58.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.58.0-noble` - Playwright v1.58.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.58.0-jammy` - Playwright v1.58.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). :::note @@ -164,7 +164,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers] ```Dockerfile FROM node:20-bookworm -RUN npx -y playwright@1.57.0 install --with-deps +RUN npx -y playwright@1.58.0 install --with-deps ``` diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx index a77011b5f2..ab212fff4c 100644 --- a/nodejs/docs/release-notes.mdx +++ b/nodejs/docs/release-notes.mdx @@ -9,6 +9,41 @@ import HTMLCard from '@site/src/components/HTMLCard'; import LiteYouTube from '@site/src/components/LiteYouTube'; +## Version 1.58 + +### Timeline + +If you're using [merged reports](./test-sharding.mdx#merging-reports-from-multiple-environments), the HTML report Speedboard tab now shows the Timeline: + +![Timeline chart in the HTML report](../images/timeline.png) + +### UI Mode and Trace Viewer Improvements +- New 'system' theme option follows your OS dark/light mode preference +- Search functionality (Cmd/Ctrl+F) is now available in code editors +- Network details panel has been reorganized for better usability +- JSON responses are now automatically formatted for readability + +Thanks to [@cpAdm](https://github.com/cpAdm) for contributing these improvements! + +### Miscellaneous + +[browserType.connectOverCDP()](/api/class-browsertype.mdx#browser-type-connect-over-cdp) now accepts an `isLocal` option. When set to `true`, it tells Playwright that it runs on the same host as the CDP server, enabling file system optimizations. + +### Breaking Changes ⚠️ +- Removed `_react` and `_vue` selectors. See [locators guide](./locators.mdx) for alternatives. +- Removed `:light` selector engine suffix. Use standard CSS selectors instead. +- Option `devtools` from [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) has been removed. Use `args: ['--auto-open-devtools-for-tabs']` instead. +- Removed macOS 13 support for WebKit. We recommend to upgrade your macOS version, or keep using an older Playwright version. + +### Browser Versions +- Chromium 145.0.7632.6 +- Mozilla Firefox 146.0.1 +- WebKit 26.0 + +This version was also tested against the following stable channels: +- Google Chrome 144 +- Microsoft Edge 144 + ## Version 1.57 ### Speedboard @@ -2829,7 +2864,7 @@ List of all new assertions: - [`expect(locator).toHaveAttribute(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-attribute) - [`expect(locator).toHaveClass(expected)`](./api/class-locatorassertions#locator-assertions-to-have-class) - [`expect(locator).toHaveCount(count)`](./api/class-locatorassertions#locator-assertions-to-have-count) -- [`expect(locator).toHaveCSS(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-css-1) +- [`expect(locator).toHaveCSS(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-css) - [`expect(locator).toHaveId(id)`](./api/class-locatorassertions#locator-assertions-to-have-id) - [`expect(locator).toHaveJSProperty(name, value)`](./api/class-locatorassertions#locator-assertions-to-have-js-property) - [`expect(locator).toHaveText(expected, options)`](./api/class-locatorassertions#locator-assertions-to-have-text) diff --git a/nodejs/docs/test-assertions.mdx b/nodejs/docs/test-assertions.mdx index b2b3aa5359..749e8bd57c 100644 --- a/nodejs/docs/test-assertions.mdx +++ b/nodejs/docs/test-assertions.mdx @@ -47,7 +47,7 @@ The following assertions will retry until the assertion passes, or the assertion | [await expect(locator).toHaveAttribute()](./api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [await expect(locator).toHaveClass()](./api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has specified CSS class property | | [await expect(locator).toHaveCount()](./api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [await expect(locator).toHaveCSS()](./api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [await expect(locator).toHaveCSS()](./api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [await expect(locator).toHaveId()](./api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [await expect(locator).toHaveJSProperty()](./api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [await expect(locator).toHaveRole()](./api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) | diff --git a/nodejs/docs/test-cli.mdx b/nodejs/docs/test-cli.mdx index a6e12bf074..8aaeec4b99 100644 --- a/nodejs/docs/test-cli.mdx +++ b/nodejs/docs/test-cli.mdx @@ -126,6 +126,18 @@ Options `--test-list` and `--test-list-invert` accept a path to a test list file # This is a test list file. # It can include comments and empty lines. +# Run ALL tests in a file: +path/to/example.spec.ts + +# Run all tests in a file for a specific project: +[chromium] › path/to/example.spec.ts + +# Run all tests in a specific group/suite: +path/to/example.spec.ts › suite name + +# Run all tests in a nested group: +path/to/example.spec.ts › outer suite › inner suite + # Fully qualified test with a project: [chromium] › path/to/example.spec.ts:3:9 › suite › nested suite › example test diff --git a/nodejs/docs/test-sharding.mdx b/nodejs/docs/test-sharding.mdx index ad39edfe4a..50922f265a 100644 --- a/nodejs/docs/test-sharding.mdx +++ b/nodejs/docs/test-sharding.mdx @@ -46,20 +46,6 @@ Without the fullyParallel setting, Playwright Test defaults to file-level granul - **Without** `fullyParallel`: Tests are split at the file level, so to balance the shards, it's important to keep your test files small and evenly sized. - To ensure the most effective use of sharding, especially in CI environments, it is recommended to use `fullyParallel: true` when aiming for balanced distribution across shards. Otherwise, you may need to manually organize your test files to avoid imbalances. -### Rebalancing Shards - -If tests in one of your shards take longer, you can manually assign less work to it using the `--shard-weights` option: - -```bash -npx playwright test --shard=x/4 --shard-weights=3:2:3:3 -``` - -Make sure you pass the same `--shard-weights` value to all shards. In this example, Shard 2 gets assigned less tests because they take longer, evening out the full duration. - -In the Speedboard section of the combined HTML report, you can see a visualisation of your individual shard durations, and a recommendation for how to set your shard weights. - -![Speedboard Shard Diagram](../images/speedboard-shards.png) - ## Merging reports from multiple shards In the previous example, each test shard has its own test report. If you want to have a combined report showing all the test results from all the shards, you can merge them. diff --git a/python/docs/actionability.mdx b/python/docs/actionability.mdx index c473f87fc0..0e579fcbbf 100644 --- a/python/docs/actionability.mdx +++ b/python/docs/actionability.mdx @@ -66,7 +66,7 @@ Playwright includes auto-retrying assertions that remove flakiness by waiting un | [expect(locator).to_have_attribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).to_have_class()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).to_have_count()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [expect(locator).to_have_id()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).to_have_js_property()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).to_have_text()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) | Element matches text | diff --git a/python/docs/api/class-locatorassertions.mdx b/python/docs/api/class-locatorassertions.mdx index e31712ee5d..ef4ec5aa2c 100644 --- a/python/docs/api/class-locatorassertions.mdx +++ b/python/docs/api/class-locatorassertions.mdx @@ -516,7 +516,7 @@ expect(locator).not_to_have_count(count, **kwargs) Added in: v1.20locatorAssertions.not_to_have_css -The opposite of [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1). +The opposite of [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css). **Usage** @@ -1418,7 +1418,7 @@ Let's see how we can use the assertion: from playwright.sync_api import expect # ✓ Contains the right items in the right order -expect(page.locator("ul > li")).to_contain_text(["Text 1", "Text 3", "Text 4"]) +expect(page.locator("ul > li")).to_contain_text(["Text 1", "Text 3"]) # ✖ Wrong order expect(page.locator("ul > li")).to_contain_text(["Text 3", "Text 2"]) @@ -1437,7 +1437,7 @@ expect(page.locator("ul")).to_contain_text(["Text 3"]) from playwright.async_api import expect # ✓ Contains the right items in the right order -await expect(page.locator("ul > li")).to_contain_text(["Text 1", "Text 3", "Text 4"]) +await expect(page.locator("ul > li")).to_contain_text(["Text 1", "Text 3"]) # ✖ Wrong order await expect(page.locator("ul > li")).to_contain_text(["Text 3", "Text 2"]) @@ -1822,7 +1822,7 @@ await expect(locator).to_have_count(3) --- -### to_have_css {#locator-assertions-to-have-css-1} +### to_have_css {#locator-assertions-to-have-css} Added in: v1.20locatorAssertions.to_have_css @@ -1861,18 +1861,18 @@ await expect(locator).to_have_css("display", "flex") **Arguments** -- `name` [str] Added in: v1.18# +- `name` [str] Added in: v1.18# CSS property name. -- `value` [str] | [Pattern] Added in: v1.18# +- `value` [str] | [Pattern] Added in: v1.18# CSS property value. -- `timeout` [float] *(optional)* Added in: v1.18# +- `timeout` [float] *(optional)* Added in: v1.18# Time to retry the assertion for in milliseconds. Defaults to `5000`. **Returns** -- [NoneType]# +- [NoneType]# --- diff --git a/python/docs/test-assertions.mdx b/python/docs/test-assertions.mdx index 8a6de57d9e..f7c9a2ee2e 100644 --- a/python/docs/test-assertions.mdx +++ b/python/docs/test-assertions.mdx @@ -27,7 +27,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; | [expect(locator).to_have_attribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) | Element has a DOM attribute | | [expect(locator).to_have_class()](/api/class-locatorassertions.mdx#locator-assertions-to-have-class) | Element has a class property | | [expect(locator).to_have_count()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) | List has exact number of children | -| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css-1) | Element has CSS property | +| [expect(locator).to_have_css()](/api/class-locatorassertions.mdx#locator-assertions-to-have-css) | Element has CSS property | | [expect(locator).to_have_id()](/api/class-locatorassertions.mdx#locator-assertions-to-have-id) | Element has an ID | | [expect(locator).to_have_js_property()](/api/class-locatorassertions.mdx#locator-assertions-to-have-js-property) | Element has a JavaScript property | | [expect(locator).to_have_role()](/api/class-locatorassertions.mdx#locator-assertions-to-have-role) | Element has a specific [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles) |