Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/src/api/class-apiresponseassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def test_navigates_to_login_page(page: Page) -> None:
* langs: java, js, csharp
- returns: <[APIResponseAssertions]>

Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful:
Makes the assertion check for the opposite condition.

**Usage**

For example, this code tests that the response status is not successful:

```js
await expect(response).not.toBeOK();
Expand Down
6 changes: 5 additions & 1 deletion docs/src/api/class-genericassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ test('assert a value', async ({ page }) => {
* since: v1.9
- returns: <[GenericAssertions]>

Makes the assertion check for the opposite condition. For example, the following code passes:
Makes the assertion check for the opposite condition.

**Usage**

For example, the following code passes:

```js
const value = 1;
Expand Down
6 changes: 5 additions & 1 deletion docs/src/api/class-locatorassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ public class ExampleTests : PageTest
* langs: java, js, csharp
- returns: <[LocatorAssertions]>

Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text `"error"`:
Makes the assertion check for the opposite condition.

**Usage**

For example, this code tests that the Locator doesn't contain text `"error"`:

```js
await expect(locator).not.toContainText('error');
Expand Down
6 changes: 5 additions & 1 deletion docs/src/api/class-pageassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public class ExampleTests : PageTest
* langs: java, js, csharp
- returns: <[PageAssertions]>

Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain `"error"`:
Makes the assertion check for the opposite condition.

**Usage**

For example, this code tests that the page URL doesn't contain `"error"`:

```js
await expect(page).not.toHaveURL('error');
Expand Down
27 changes: 20 additions & 7 deletions packages/playwright/types/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7921,7 +7921,11 @@ interface AsymmetricMatchers {
*/
interface GenericAssertions<R> {
/**
* Makes the assertion check for the opposite condition. For example, the following code passes:
* Makes the assertion check for the opposite condition.
*
* **Usage**
*
* For example, the following code passes:
*
* ```js
* const value = 1;
Expand Down Expand Up @@ -9432,8 +9436,11 @@ interface LocatorAssertions {
}): Promise<void>;

/**
* Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain
* text `"error"`:
* Makes the assertion check for the opposite condition.
*
* **Usage**
*
* For example, this code tests that the Locator doesn't contain text `"error"`:
*
* ```js
* await expect(locator).not.toContainText('error');
Expand Down Expand Up @@ -9630,8 +9637,11 @@ interface APIResponseAssertions {
toBeOK(): Promise<void>;

/**
* Makes the assertion check for the opposite condition. For example, this code tests that the response status is not
* successful:
* Makes the assertion check for the opposite condition.
*
* **Usage**
*
* For example, this code tests that the response status is not successful:
*
* ```js
* await expect(response).not.toBeOK();
Expand Down Expand Up @@ -9750,8 +9760,11 @@ interface PageAssertions {
}): Promise<void>;

/**
* Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't
* contain `"error"`:
* Makes the assertion check for the opposite condition.
*
* **Usage**
*
* For example, this code tests that the page URL doesn't contain `"error"`:
*
* ```js
* await expect(page).not.toHaveURL('error');
Expand Down
Loading