Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (01-08-22) (microsoft#696)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
playwrightmachine and github-actions[bot] authored Aug 1, 2022
1 parent 897d999 commit 289a089
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dotnet/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import TabItem from '@theme/TabItem';
Playwright comes with the ability to generate tests out of the box and is a great way to quickly get started with testing. It will open two windows, a browser window where you interact with the website you wish to test and the Playwright Inspector window where you can record your tests, copy the tests, clear your tests as well as change the language of your tests.

```bash
pwsh bin\Debug\netX\playwright.ps1 codegen wikipedia.org
pwsh bin\Debug\netX\playwright.ps1 codegen playwright.dev
```

Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `codegen` will attempt to generate resilient text-based selectors.

<img width="1916" alt="image" src="https://user-images.githubusercontent.com/13063165/177550119-4e202a56-7d8e-43ac-ad91-bf2f7b2579bd.png"/>
<img width="1183" alt="Screenshot 2022-07-30 at 00 19 06" src="https://user-images.githubusercontent.com/13063165/181852815-971c10da-0b55-4e54-8a73-77e1e825193c.png" />

## Preserve authenticated state

Expand Down
4 changes: 2 additions & 2 deletions java/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import TabItem from '@theme/TabItem';
Playwright comes with the ability to generate tests out of the box and is a great way to quickly get started with testing. It will open two windows, a browser window where you interact with the website you wish to test and the Playwright Inspector window where you can record your tests, copy the tests, clear your tests as well as change the language of your tests.

```bash
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="codegen wikipedia.org"
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="codegen playwright.dev"
```

Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `codegen` will attempt to generate resilient text-based selectors.

<img width="1916" alt="image" src="https://user-images.githubusercontent.com/13063165/177550119-4e202a56-7d8e-43ac-ad91-bf2f7b2579bd.png"/>
<img width="1183" alt="Screenshot 2022-07-30 at 00 19 06" src="https://user-images.githubusercontent.com/13063165/181852815-971c10da-0b55-4e54-8a73-77e1e825193c.png" />

## Preserve authenticated state

Expand Down
43 changes: 43 additions & 0 deletions nodejs/docs/api/class-test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test('basic test', async ({ page }) => {
- [test.describe(title, callback)](./api/class-test.mdx#test-describe-1)
- [test.describe(callback)](./api/class-test.mdx#test-describe-2)
- [test.describe.configure([options])](./api/class-test.mdx#test-describe-configure)
- [test.describe.fixme(title, callback)](./api/class-test.mdx#test-describe-fixme)
- [test.describe.only(title, callback)](./api/class-test.mdx#test-describe-only)
- [test.describe.parallel(title, callback)](./api/class-test.mdx#test-describe-parallel)
- [test.describe.parallel.only(title, callback)](./api/class-test.mdx#test-describe-parallel-only)
Expand Down Expand Up @@ -495,6 +496,48 @@ test('runs second', async ({ page }) => {});
</TabItem>
</Tabs>

## test.describe.fixme(title, callback) {#test-describe-fixme}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.25</font>

- `title`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="test-describe-fixme-option-title"/> &#60;[string]&#62; Group title.<a href="#test-describe-fixme-option-title" class="list-anchor">#</a>
- `callback`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="test-describe-fixme-option-callback"/> &#60;[function]&#62; A callback that is run immediately when calling [test.describe.fixme(title, callback)](./api/class-test.mdx#test-describe-fixme). Any tests added in this callback will belong to the group, and will not be run.<a href="#test-describe-fixme-option-callback" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="test-describe-fixme-return"/> &#60;[void]&#62;<a href="#test-describe-fixme-return" class="list-anchor">#</a>

Declares a test group similarly to [test.describe(title, callback)](./api/class-test.mdx#test-describe-1). Tests in this group are maked as "fixme" and will not be executed.

<Tabs
groupId="js-flavor"
defaultValue="ts"
values={[
{label: 'TypeScript', value: 'ts'},
{label: 'JavaScript', value: 'js'}
]
}>
<TabItem value="ts">

```js
test.describe.fixme('broken tests', () => {
test('example', async ({ page }) => {
// This test will not run
});
});
```

</TabItem>
<TabItem value="js">

```js
test.describe.fixme('broken tests', () => {
test('example', async ({ page }) => {
// This test will not run
});
});
```

</TabItem>
</Tabs>

## test.describe.only(title, callback) {#test-describe-only}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.10</font>
Expand Down
4 changes: 2 additions & 2 deletions nodejs/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import TabItem from '@theme/TabItem';
Playwright comes with the ability to generate tests out of the box and is a great way to quickly get started with testing. It will open two windows, a browser window where you interact with the website you wish to test and the Playwright Inspector window where you can record your tests, copy the tests, clear your tests as well as change the language of your tests.

```bash
npx playwright codegen wikipedia.org
npx playwright codegen playwright.dev
```

Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `codegen` will attempt to generate resilient text-based selectors.

<img width="1916" alt="image" src="https://user-images.githubusercontent.com/13063165/177550119-4e202a56-7d8e-43ac-ad91-bf2f7b2579bd.png"/>
<img width="1183" alt="Screenshot 2022-07-30 at 00 19 06" src="https://user-images.githubusercontent.com/13063165/181852815-971c10da-0b55-4e54-8a73-77e1e825193c.png" />

## Preserve authenticated state

Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Once your test has finished running a [HTML Reporter](./html-reporter.mdx) will
npx playwright show-report
```

<img width="739" alt="image" src="https://user-images.githubusercontent.com/13063165/178003817-3bd2f088-4173-406c-a9e9-74c89181f381.png" />
<img width="739" alt="image" src="https://user-images.githubusercontent.com/13063165/181803518-1f554349-f72a-4ad3-a7aa-4d3d1b4cad13.png" />

## What's next
- [Write tests using web first assertions, page fixtures and locators](./writing-tests.mdx)
Expand Down
10 changes: 7 additions & 3 deletions nodejs/docs/running-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,23 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
npx playwright test example.spec.ts:42 --debug
```

<img width="712" alt="Playwright Inspector" src="https://user-images.githubusercontent.com/883973/108614092-8c478a80-73ac-11eb-9597-67dfce110e00.png"></img>
<img width="1188" alt="Screenshot 2022-07-29 at 23 50 13" src="https://user-images.githubusercontent.com/13063165/181847661-7ec5fb6c-7c21-4db0-9931-a593b21bafc2.png" />

Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright Inspector](./debug.mdx#playwright-inspector) as well as debugging with [Browser Developer tools](./debug.mdx#browser-developer-tools).

## Test Reports

The [HTML Reporter](./html-reporter.mdx) shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests. You can click on each test and explore the tests errors as well as each step of the test. By default, the HTML report is opened automatically if some of the tests failed.
The [HTML Reporter](./html-reporter.mdx) shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests. By default, the HTML report is opened automatically if some of the tests failed.

```bash
npx playwright show-report
```

<img width="739" alt="image" src="https://user-images.githubusercontent.com/13063165/178003817-3bd2f088-4173-406c-a9e9-74c89181f381.png" />
<img width="739" alt="image" src="https://user-images.githubusercontent.com/13063165/181803518-1f554349-f72a-4ad3-a7aa-4d3d1b4cad13.png" />

You can click on each test and explore the tests errors as well as each step of the test.

<img width="739" alt="image" src="https://user-images.githubusercontent.com/13063165/181814327-a597109f-6f24-44a1-b47c-0de9dc7f5912.png" />

## What's Next
- [Generate tests with Codegen](./codegen.mdx)
Expand Down
4 changes: 2 additions & 2 deletions python/docs/codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import TabItem from '@theme/TabItem';
Playwright comes with the ability to generate tests out of the box and is a great way to quickly get started with testing. It will open two windows, a browser window where you interact with the website you wish to test and the Playwright Inspector window where you can record your tests, copy the tests, clear your tests as well as change the language of your tests.

```bash
playwright codegen wikipedia.org
playwright codegen playwright.dev
```

Run `codegen` and perform actions in the browser. Playwright will generate the code for the user interactions. `codegen` will attempt to generate resilient text-based selectors.

<img width="1916" alt="image" src="https://user-images.githubusercontent.com/13063165/177550119-4e202a56-7d8e-43ac-ad91-bf2f7b2579bd.png"/>
<img width="1183" alt="Screenshot 2022-07-30 at 00 19 06" src="https://user-images.githubusercontent.com/13063165/181852815-971c10da-0b55-4e54-8a73-77e1e825193c.png" />

## Preserve authenticated state

Expand Down

0 comments on commit 289a089

Please sign in to comment.