diff --git a/docs/src/api/class-apiresponseassertions.md b/docs/src/api/class-apiresponseassertions.md index 9584365d887dd..a9913fe812274 100644 --- a/docs/src/api/class-apiresponseassertions.md +++ b/docs/src/api/class-apiresponseassertions.md @@ -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(); diff --git a/docs/src/api/class-genericassertions.md b/docs/src/api/class-genericassertions.md index 603995eddd4e0..40e594fb64e54 100644 --- a/docs/src/api/class-genericassertions.md +++ b/docs/src/api/class-genericassertions.md @@ -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; diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index eb8147a636678..0b9d382a259e1 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -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'); diff --git a/docs/src/api/class-pageassertions.md b/docs/src/api/class-pageassertions.md index 6420735f2be59..3193b17ae9bd0 100644 --- a/docs/src/api/class-pageassertions.md +++ b/docs/src/api/class-pageassertions.md @@ -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'); diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 011941effe469..ec4b057e902de 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -7921,7 +7921,11 @@ interface AsymmetricMatchers { */ interface 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; @@ -9432,8 +9436,11 @@ interface LocatorAssertions { }): Promise; /** - * 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'); @@ -9630,8 +9637,11 @@ interface APIResponseAssertions { toBeOK(): Promise; /** - * 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(); @@ -9750,8 +9760,11 @@ interface PageAssertions { }): Promise; /** - * 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');