Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (25-07-23)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 25, 2023
1 parent 8fe4362 commit 5307f96
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 46 deletions.
4 changes: 2 additions & 2 deletions dotnet/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';


Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. Locator can be created with the [Page.Locator()](/api/class-page.mdx#page-locator) method.
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the [Page.Locator()](/api/class-page.mdx#page-locator) method.

[Learn more about locators](../locators.mdx).

Expand All @@ -20,7 +20,7 @@ Locators are the central piece of Playwright's auto-waiting and retry-ability. I

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

When locator points to a list of elements, returns array of locators, pointing to respective elements.
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.

:::note
[Locator.AllAsync()](/api/class-locator.mdx#locator-all) does not wait for elements to match the locator, and instead immediately returns whatever is present in the page. When the list of elements changes dynamically, [Locator.AllAsync()](/api/class-locator.mdx#locator-all) will produce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling [Locator.AllAsync()](/api/class-locator.mdx#locator-all).
Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can use the test generator to generate tests using emulation so as to genera

### Emulate viewport size

Playwright opens a browser window with it's viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
Playwright opens a browser window with its viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.

```bash
pwsh bin/Debug/netX/playwright.ps1 codegen --viewport-size=800,600 playwright.dev
Expand Down
10 changes: 5 additions & 5 deletions dotnet/docs/locators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate each element by it's implicit role:
You can locate each element by its implicit role:

```csharp
await Expect(page
Expand Down Expand Up @@ -298,7 +298,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate the element by it's test id:
You can locate the element by its test id:

```csharp
await page.GetByTestId("directions").ClickAsync();
Expand Down Expand Up @@ -604,7 +604,7 @@ await newEmail.ClickAsync();
It's usually better to find a [more reliable way](./locators.mdx#quick-guide) to uniquely identify the element instead of checking the visibility.
:::

Consider a page with two buttons, first invisible and second [visible](./actionability.mdx#visible).
Consider a page with two buttons, the first invisible and the second [visible](./actionability.mdx#visible).

```html
<button style='display: none'>Invisible</button>
Expand Down Expand Up @@ -693,7 +693,7 @@ There are many ways to get a specific item in a list.

#### Get by text

Use the [Page.GetByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by it's text content and then click on it.
Use the [Page.GetByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by its text content and then click on it.

For example, consider the following DOM structure:

Expand All @@ -715,7 +715,7 @@ For example, consider the following DOM structure:
```
</HTMLCard>

Locate an item by it's text content and click it.
Locate an item by its text content and click it.

```csharp
await page.GetByText("orange").ClickAsync();
Expand Down
4 changes: 2 additions & 2 deletions java/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';


Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. Locator can be created with the [Page.locator()](/api/class-page.mdx#page-locator) method.
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the [Page.locator()](/api/class-page.mdx#page-locator) method.

[Learn more about locators](../locators.mdx).

Expand All @@ -20,7 +20,7 @@ Locators are the central piece of Playwright's auto-waiting and retry-ability. I

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

When locator points to a list of elements, returns array of locators, pointing to respective elements.
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.

:::note
[Locator.all()](/api/class-locator.mdx#locator-all) does not wait for elements to match the locator, and instead immediately returns whatever is present in the page. When the list of elements changes dynamically, [Locator.all()](/api/class-locator.mdx#locator-all) will produce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling [Locator.all()](/api/class-locator.mdx#locator-all).
Expand Down
2 changes: 1 addition & 1 deletion java/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can use the test generator to generate tests using emulation so as to genera

### Emulate viewport size

Playwright opens a browser window with it's viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
Playwright opens a browser window with its viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.

```bash
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="codegen --viewport-size=800,600 playwright.dev"
Expand Down
10 changes: 5 additions & 5 deletions java/docs/locators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate each element by it's implicit role:
You can locate each element by its implicit role:

```java
assertThat(page
Expand Down Expand Up @@ -299,7 +299,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate the element by it's test id:
You can locate the element by its test id:

```java
page.getByTestId("directions").click();
Expand Down Expand Up @@ -604,7 +604,7 @@ newEmail.click();
It's usually better to find a [more reliable way](./locators.mdx#quick-guide) to uniquely identify the element instead of checking the visibility.
:::

Consider a page with two buttons, first invisible and second [visible](./actionability.mdx#visible).
Consider a page with two buttons, the first invisible and the second [visible](./actionability.mdx#visible).

```html
<button style='display: none'>Invisible</button>
Expand Down Expand Up @@ -693,7 +693,7 @@ There are many ways to get a specific item in a list.

#### Get by text

Use the [Page.getByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by it's text content and then click on it.
Use the [Page.getByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by its text content and then click on it.

For example, consider the following DOM structure:

Expand All @@ -715,7 +715,7 @@ For example, consider the following DOM structure:
```
</HTMLCard>

Locate an item by it's text content and click it.
Locate an item by its text content and click it.

```java
page.getByText("orange").click();
Expand Down
4 changes: 2 additions & 2 deletions nodejs/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';


Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. Locator can be created with the [page.locator()](/api/class-page.mdx#page-locator) method.
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the [page.locator()](/api/class-page.mdx#page-locator) method.

[Learn more about locators](../locators.mdx).

Expand All @@ -20,7 +20,7 @@ Locators are the central piece of Playwright's auto-waiting and retry-ability. I

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

When locator points to a list of elements, returns array of locators, pointing to respective elements.
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.

:::note
[locator.all()](/api/class-locator.mdx#locator-all) does not wait for elements to match the locator, and instead immediately returns whatever is present in the page. When the list of elements changes dynamically, [locator.all()](/api/class-locator.mdx#locator-all) will produce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling [locator.all()](/api/class-locator.mdx#locator-all).
Expand Down
18 changes: 9 additions & 9 deletions nodejs/docs/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
name: 'Playwright Tests - ${{ matrix.project }} - Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -371,7 +371,7 @@ trigger:
pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.36.1-jammy
container: mcr.microsoft.com/playwright:v1.36.2-jammy
steps:
- task: NodeTool@0
Expand All @@ -395,7 +395,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-jammy-development:
docker:
- image: mcr.microsoft.com/playwright:v1.36.1-jammy
- image: mcr.microsoft.com/playwright:v1.36.2-jammy
```
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.
Expand All @@ -418,7 +418,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:v1.36.1-jammy' } }
agent { docker { image 'mcr.microsoft.com/playwright:v1.36.2-jammy' } }
stages {
stage('e2e-tests') {
steps {
Expand All @@ -435,7 +435,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.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
```
### GitLab CI
Expand All @@ -448,7 +448,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
script:
...
```
Expand All @@ -463,7 +463,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
parallel: 7
script:
- npm ci
Expand All @@ -478,7 +478,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.36.1-jammy
image: mcr.microsoft.com/playwright:v1.36.2-jammy
parallel:
matrix:
- PROJECT: ['chromium', 'webkit']
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You can use the test generator to generate tests using emulation so as to genera

### Emulate viewport size

Playwright opens a browser window with it's viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
Playwright opens a browser window with its viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.

```bash
npx playwright codegen --viewport-size=800,600 playwright.dev
Expand Down
6 changes: 3 additions & 3 deletions nodejs/docs/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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.36.1-jammy
docker pull mcr.microsoft.com/playwright:v1.36.2-jammy
```

### Run the image
Expand All @@ -35,15 +35,15 @@ 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.36.1-jammy /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.36.2-jammy /bin/bash
```

#### Crawling and scraping

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.36.1-jammy /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.36.2-jammy /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:
Expand Down
10 changes: 5 additions & 5 deletions nodejs/docs/locators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate each element by it's implicit role:
You can locate each element by its implicit role:

```js
await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();
Expand Down Expand Up @@ -286,7 +286,7 @@ For example, consider the following DOM structure.
```
</HTMLCard>

You can locate the element by it's test id:
You can locate the element by its test id:

```js
await page.getByTestId('directions').click();
Expand Down Expand Up @@ -589,7 +589,7 @@ await newEmail.click();
It's usually better to find a [more reliable way](./locators.mdx#quick-guide) to uniquely identify the element instead of checking the visibility.
:::

Consider a page with two buttons, first invisible and second [visible](./actionability.mdx#visible).
Consider a page with two buttons, the first invisible and the second [visible](./actionability.mdx#visible).

```html
<button style='display: none'>Invisible</button>
Expand Down Expand Up @@ -678,7 +678,7 @@ There are many ways to get a specific item in a list.

#### Get by text

Use the [page.getByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by it's text content and then click on it.
Use the [page.getByText()](/api/class-page.mdx#page-get-by-text) method to locate an element in a list by its text content and then click on it.

For example, consider the following DOM structure:

Expand All @@ -700,7 +700,7 @@ For example, consider the following DOM structure:
```
</HTMLCard>

Locate an item by it's text content and click it.
Locate an item by its text content and click it.

```js
await page.getByText('orange').click();
Expand Down
11 changes: 10 additions & 1 deletion nodejs/docs/test-annotations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,17 @@ npx playwright test --grep "@fast|@slow"

On Windows shells:
- PowerShell

```bash
npx playwright test --grep --% "@fast^|@slow"
```

- Command Prompt(cmd.exe) / Git Bash:


```bash
npx playwright test --grep "@fast^|@slow"
```

Or run tests containing both tags (logical `AND` operator) using regex lookaheads:

```bash
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/test-snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts:
If you are not on the same operating system as your CI system, you can use Docker to generate/update the screenshots:

```bash
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.36.1-jammy /bin/bash
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.36.2-jammy /bin/bash
npm install
npx playwright test --update-snapshots
```
Expand Down
4 changes: 2 additions & 2 deletions python/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';


Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. Locator can be created with the [page.locator()](/api/class-page.mdx#page-locator) method.
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the [page.locator()](/api/class-page.mdx#page-locator) method.

[Learn more about locators](../locators.mdx).

Expand All @@ -20,7 +20,7 @@ Locators are the central piece of Playwright's auto-waiting and retry-ability. I

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

When locator points to a list of elements, returns array of locators, pointing to respective elements.
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.

:::note
[locator.all()](/api/class-locator.mdx#locator-all) does not wait for elements to match the locator, and instead immediately returns whatever is present in the page. When the list of elements changes dynamically, [locator.all()](/api/class-locator.mdx#locator-all) will produce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling [locator.all()](/api/class-locator.mdx#locator-all).
Expand Down
2 changes: 1 addition & 1 deletion python/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can use the test generator to generate tests using emulation so as to genera

### Emulate viewport size

Playwright opens a browser window with it's viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
Playwright opens a browser window with its viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.

```bash
playwright codegen --viewport-size=800,600 playwright.dev
Expand Down
Loading

0 comments on commit 5307f96

Please sign in to comment.