cherry-pick(1.20): recent assertion docs changes (#12696)
This commit is contained in:
parent
b728609592
commit
97bca5c431
|
|
@ -805,7 +805,6 @@ A permission or an array of permissions to grant. Permissions can be one of the
|
||||||
* `'midi'`
|
* `'midi'`
|
||||||
* `'midi-sysex'` (system-exclusive midi)
|
* `'midi-sysex'` (system-exclusive midi)
|
||||||
* `'notifications'`
|
* `'notifications'`
|
||||||
* `'push'`
|
|
||||||
* `'camera'`
|
* `'camera'`
|
||||||
* `'microphone'`
|
* `'microphone'`
|
||||||
* `'background-sync'`
|
* `'background-sync'`
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ Read more about it in our [API testing guide](./api-testing).
|
||||||
|
|
||||||
### Web-First Assertions
|
### Web-First Assertions
|
||||||
|
|
||||||
Playwright for Java 1.18 introduces [Web-First Assertions](./api/class-playwrightassertions).
|
Playwright for Java 1.18 introduces [Web-First Assertions](./test-assertions).
|
||||||
|
|
||||||
Consider the following example:
|
Consider the following example:
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ fetched Node has the `"Submitted"` text. It will be re-fetching the node and
|
||||||
checking it over and over, until the condition is met or until the timeout is
|
checking it over and over, until the condition is met or until the timeout is
|
||||||
reached. You can pass this timeout as an option.
|
reached. You can pass this timeout as an option.
|
||||||
|
|
||||||
Read more in [our documentation](./api/class-playwrightassertions).
|
Read more in [our documentation](./test-assertions).
|
||||||
|
|
||||||
### Locator Improvements
|
### Locator Improvements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ title: "Release notes"
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Trace Viewer](./trace-viewer) now shows [API testing requests](./src/test-api-testing).
|
- [Trace Viewer](./trace-viewer) now shows [API testing requests](./test-api-testing).
|
||||||
- `expect().toMatchSnapshot()` now supports anonymous snapshots: when snapshot name is missing, Playwright Test will generate one
|
- `expect().toMatchSnapshot()` now supports anonymous snapshots: when snapshot name is missing, Playwright Test will generate one
|
||||||
automatically:
|
automatically:
|
||||||
|
|
||||||
|
|
@ -178,7 +178,7 @@ This version was also tested against the following stable channels:
|
||||||
### Locator Improvements
|
### Locator Improvements
|
||||||
|
|
||||||
- [`method: Locator.dragTo`]
|
- [`method: Locator.dragTo`]
|
||||||
- [`expect(locator).toBeChecked({ checked })`](./api/class-playwrightassertions#locator-assertions-to-be-checked)
|
- [`expect(locator).toBeChecked({ checked })`](./test-assertions#locator-assertions-to-be-checked)
|
||||||
- Each locator can now be optionally filtered by the text it contains:
|
- Each locator can now be optionally filtered by the text it contains:
|
||||||
```js
|
```js
|
||||||
await page.locator('li', { hasText: 'my item' }).locator('button').click();
|
await page.locator('li', { hasText: 'my item' }).locator('button').click();
|
||||||
|
|
@ -188,7 +188,7 @@ This version was also tested against the following stable channels:
|
||||||
|
|
||||||
### Testing API improvements
|
### Testing API improvements
|
||||||
|
|
||||||
- [`expect(response).toBeOK()`](./api/class-playwrightassertions)
|
- [`expect(response).toBeOK()`](./test-assertions)
|
||||||
- [`testInfo.attach()`](./api/class-testinfo#test-info-attach)
|
- [`testInfo.attach()`](./api/class-testinfo#test-info-attach)
|
||||||
- [`test.info()`](./api/class-test#test-info)
|
- [`test.info()`](./api/class-test#test-info)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Read more in [our documentation](./api/class-apirequestcontext).
|
||||||
|
|
||||||
### Web-First Assertions
|
### Web-First Assertions
|
||||||
|
|
||||||
Playwright for Python 1.18 introduces [Web-First Assertions](./api/class-playwrightassertions).
|
Playwright for Python 1.18 introduces [Web-First Assertions](./test-assertions).
|
||||||
|
|
||||||
Consider the following example:
|
Consider the following example:
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ fetched Node has the `"Submitted"` text. It will be re-fetching the node and
|
||||||
checking it over and over, until the condition is met or until the timeout is
|
checking it over and over, until the condition is met or until the timeout is
|
||||||
reached. You can pass this timeout as an option.
|
reached. You can pass this timeout as an option.
|
||||||
|
|
||||||
Read more in [our documentation](./api/class-playwrightassertions).
|
Read more in [our documentation](./test-assertions).
|
||||||
|
|
||||||
### Locator Improvements
|
### Locator Improvements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ exports.PlaywrightDevPage = class PlaywrightDevPage {
|
||||||
await this.getStarted();
|
await this.getStarted();
|
||||||
await this.pomLink.click();
|
await this.pomLink.click();
|
||||||
}
|
}
|
||||||
}```
|
}
|
||||||
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright-dev-page.ts
|
// playwright-dev-page.ts
|
||||||
|
|
@ -71,7 +72,8 @@ export class PlaywrightDevPage {
|
||||||
await this.getStarted();
|
await this.getStarted();
|
||||||
await this.pomLink.click();
|
await this.pomLink.click();
|
||||||
}
|
}
|
||||||
}```
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Now we can use the `PlaywrightDevPage` class in our tests.
|
Now we can use the `PlaywrightDevPage` class in our tests.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ title: "Verification"
|
||||||
---
|
---
|
||||||
|
|
||||||
:::caution
|
:::caution
|
||||||
We recommend [Web-First Assertions](./api/class-playwrightassertions) that automatically retry until the expected condition is met instead. This helps reducing the flakiness of the tests.
|
We recommend [Web-First Assertions](./test-assertions) that automatically retry until the expected condition is met instead. This helps reducing the flakiness of the tests.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
|
|
||||||
1
packages/playwright-core/types/types.d.ts
vendored
1
packages/playwright-core/types/types.d.ts
vendored
|
|
@ -6612,7 +6612,6 @@ export interface BrowserContext {
|
||||||
* - `'midi'`
|
* - `'midi'`
|
||||||
* - `'midi-sysex'` (system-exclusive midi)
|
* - `'midi-sysex'` (system-exclusive midi)
|
||||||
* - `'notifications'`
|
* - `'notifications'`
|
||||||
* - `'push'`
|
|
||||||
* - `'camera'`
|
* - `'camera'`
|
||||||
* - `'microphone'`
|
* - `'microphone'`
|
||||||
* - `'background-sync'`
|
* - `'background-sync'`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue