From 691c838b5ffbf1347c93e6e294e341e061e5f6af Mon Sep 17 00:00:00 2001 From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com> Date: Fri, 7 Jul 2023 03:16:54 -0700 Subject: [PATCH] feat(roll): roll to ToT Playwright (07-07-23) (#1090) --- dotnet/docs/mock.mdx | 3 +++ java/docs/mock.mdx | 3 +++ nodejs/docs/mock.mdx | 3 +++ python/docs/mock.mdx | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/dotnet/docs/mock.mdx b/dotnet/docs/mock.mdx index 7b880c6efa5..a6909252eeb 100644 --- a/dotnet/docs/mock.mdx +++ b/dotnet/docs/mock.mdx @@ -91,6 +91,9 @@ await page.RouteFromHARAsync("./hars/fruit.har", new () { // Go to the page await page.GotoAsync("https://demo.playwright.dev/api-mocking"); + +// Assert that the fruit is visible +await Expect(page.GetByText("Strawberry")).ToBeVisibleAsync(); ``` ### Modifying a HAR file diff --git a/java/docs/mock.mdx b/java/docs/mock.mdx index 5f1027837d1..a9f5a135c1e 100644 --- a/java/docs/mock.mdx +++ b/java/docs/mock.mdx @@ -89,6 +89,9 @@ page.routeFromHAR("./hars/fruit.har", new RouteFromHAROptions() // Go to the page page.goto("https://demo.playwright.dev/api-mocking"); + +// Assert that the fruit is visible +assertThat(page.getByText("Strawberry")).isVisible(); ``` ### Modifying a HAR file diff --git a/nodejs/docs/mock.mdx b/nodejs/docs/mock.mdx index cee8b32b60b..0443888b807 100644 --- a/nodejs/docs/mock.mdx +++ b/nodejs/docs/mock.mdx @@ -88,6 +88,9 @@ test('records or updates the HAR file', async ({ page }) => { // Go to the page await page.goto('https://demo.playwright.dev/api-mocking'); + + // Assert that the fruit is visible + await expect(page.getByText('Strawberry')).toBeVisible(); }); ``` diff --git a/python/docs/mock.mdx b/python/docs/mock.mdx index c3b62c82c22..c779504f249 100644 --- a/python/docs/mock.mdx +++ b/python/docs/mock.mdx @@ -164,6 +164,9 @@ def records_or_updates_the_har_file(page: Page): # Go to the page page.goto("https://demo.playwright.dev/api-mocking") + + # Assert that the fruit is visible + expect(page.get_by_text("Strawberry")).to_be_visible() ``` @@ -176,6 +179,9 @@ async def records_or_updates_the_har_file(page: Page): # Go to the page await page.goto("https://demo.playwright.dev/api-mocking") + + # Assert that the fruit is visible + await expect(page.get_by_text("Strawberry")).to_be_visible() ```