diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/README.md b/sdk/playwrighttesting/microsoft-playwright-testing/README.md index b2c6110d94d7..275602f0d3ea 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/README.md +++ b/sdk/playwrighttesting/microsoft-playwright-testing/README.md @@ -37,7 +37,6 @@ Follow these steps to run your existing Playwright test suite with the service. |**Azure Subscription** | Select an Azure subscription where you want to create the workspace. | |**Region** | This is where test run data will be stored for your workspace. | - > [!NOTE] > If you don't see this screen, select an existing workspace and go to the next section. ### Install Microsoft Playwright Testing package @@ -56,8 +55,7 @@ The service configuration serves to: - Add Microsoft Playwright Testing reporting to your config. - Override timeouts for service operations, if needed. -> [!NOTE] -> Make sure your project uses @playwright/test version 1.37 or above. +> Make sure your project uses @playwright/test version 1.47 or above. ### Obtain region endpoint @@ -73,7 +71,6 @@ Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is a We recommend using `dotenv` module to manage your environment. With `dotenv` you'll be using the `.env` file to define your environment variables. -> [!IMPORTANT] > Don't forget to add `.env` file to your `.gitignore` file in order to not leak your secrets. ```sh diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/manually-connecting-to-browsers/README.md b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/manually-connecting-to-browsers/README.md index 41ab92c281b8..06d4b2c65c40 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/manually-connecting-to-browsers/README.md +++ b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/manually-connecting-to-browsers/README.md @@ -31,8 +31,7 @@ The service configuration serves to: - Add Microsoft Playwright Testing reporting to your config. - Override timeouts for service operations, if needed. -> [!NOTE] -> Make sure your project uses @playwright/test version 1.37 or above. +> Make sure your project uses @playwright/test version 1.47 or above. ### Obtain region endpoint @@ -48,7 +47,6 @@ Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is a We recommend using `dotenv` module to manage your environment. With `dotenv` you'll be using the `.env` file to define your environment variables. -> [!IMPORTANT] > Don't forget to add `.env` file to your `.gitignore` file in order to not leak your secrets. ```sh diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/set-default-authentication-mechanism/README.md b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/set-default-authentication-mechanism/README.md index e1791d7aea52..9390f31142ad 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/set-default-authentication-mechanism/README.md +++ b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/javascript/set-default-authentication-mechanism/README.md @@ -31,8 +31,7 @@ The service configuration serves to: - Add Microsoft Playwright Testing reporting to your config. - Override timeouts for service operations, if needed. -> [!NOTE] -> Make sure your project uses @playwright/test version 1.37 or above. +> Make sure your project uses @playwright/test version 1.47 or above. ### Configure authentication settings @@ -81,7 +80,6 @@ Ensure that the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` and `PLAYWRIGHT_SERVICE_URL` t We recommend using `dotenv` module to manage your environment. With `dotenv` you'll be using the `.env` file to define your environment variables. -> [!IMPORTANT] > Don't forget to add `.env` file to your `.gitignore` file in order to not leak your secrets. ```sh diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/manually-connecting-to-browsers/README.md b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/manually-connecting-to-browsers/README.md index dcefc7f489d5..609b725a9a0a 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/manually-connecting-to-browsers/README.md +++ b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/manually-connecting-to-browsers/README.md @@ -31,8 +31,7 @@ The service configuration serves to: - Add Microsoft Playwright Testing reporting to your config. - Override timeouts for service operations, if needed. -> [!NOTE] -> Make sure your project uses @playwright/test version 1.37 or above. +> Make sure your project uses @playwright/test version 1.47 or above. ### Obtain region endpoint @@ -48,7 +47,6 @@ Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is a We recommend using `dotenv` module to manage your environment. With `dotenv` you'll be using the `.env` file to define your environment variables. -> [!IMPORTANT] > Don't forget to add `.env` file to your `.gitignore` file in order to not leak your secrets. ```sh diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/set-default-authentication-mechanism/README.md b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/set-default-authentication-mechanism/README.md index 41555451ee74..e4726a557390 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/set-default-authentication-mechanism/README.md +++ b/sdk/playwrighttesting/microsoft-playwright-testing/samples/v1/typescript/set-default-authentication-mechanism/README.md @@ -31,8 +31,7 @@ The service configuration serves to: - Add Microsoft Playwright Testing reporting to your config. - Override timeouts for service operations, if needed. -> [!NOTE] -> Make sure your project uses @playwright/test version 1.37 or above. +> Make sure your project uses @playwright/test version 1.47 or above. ### Configure authentication settings @@ -81,7 +80,6 @@ Ensure that the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` and `PLAYWRIGHT_SERVICE_URL` t We recommend using `dotenv` module to manage your environment. With `dotenv` you'll be using the `.env` file to define your environment variables. -> [!IMPORTANT] > Don't forget to add `.env` file to your `.gitignore` file in order to not leak your secrets. ```sh diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/src/common/types.ts b/sdk/playwrighttesting/microsoft-playwright-testing/src/common/types.ts index 2d857969f60d..7dcb74789b62 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/src/common/types.ts +++ b/sdk/playwrighttesting/microsoft-playwright-testing/src/common/types.ts @@ -61,7 +61,7 @@ export type ConnectOptions = { * * Maximum time in milliseconds to wait for the connection to be established. * - * @defaultValue `0` + * @defaultValue `30000` */ timeout?: number; @@ -82,8 +82,22 @@ export type ConnectOptions = { * * @example * ``` - * const { wsEndpoint, options }: BrowserConnectOptions = await getConnectOptions(); - * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options); + * import playwright, { test, expect, BrowserType } from "@playwright/test"; + * import { getConnectOptions, BrowserConnectOptions } from "@azure/microsoft-playwright-testing"; + * + * test("has title", async ({ browserName }) => { + * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions(); + * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options); + * const context = await browser.newContext(); + * const page = await context.newPage(); + * + * await page.goto("https://playwright.dev/"); + * await expect(page).toHaveTitle(/Playwright/); + * + * await page.close(); + * await context.close(); + * await browser.close(); + * }); * ``` */ export type BrowserConnectOptions = EndpointOptions & { @@ -111,7 +125,7 @@ export type PlaywrightConfigInput = { * * Path to the global teardown file. This file will be required and run after all the tests. It must export a single * function. See also - * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-setup | testConfig.globalSetup}. + * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown | testConfig.globalTeardown}. * * Learn more about {@link https://playwright.dev/docs/test-global-setup-teardown | global setup and teardown}. */ @@ -174,7 +188,7 @@ export type PlaywrightServiceAdditionalOptions = { * * Maximum time in milliseconds to wait for the connection to be established. * - * @defaultValue `0` + * @defaultValue `30000` */ timeout?: number; @@ -249,7 +263,7 @@ export type ApiErrorMessage = { * import { defineConfig } from "@playwright/test"; * * export default defineConfig({ - * reporter: [["@azure/microsoft-playwright-testing", { + * reporter: [["@azure/microsoft-playwright-testing/reporter", { * enableGitHubSummary: true * }]], * }); diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/src/core/playwrightService.ts b/sdk/playwrighttesting/microsoft-playwright-testing/src/core/playwrightService.ts index 1b2e023f7adc..a692795f3021 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/src/core/playwrightService.ts +++ b/sdk/playwrighttesting/microsoft-playwright-testing/src/core/playwrightService.ts @@ -120,7 +120,6 @@ const getServiceConfig = ( * ``` * import playwright, { test, expect, BrowserType } from "@playwright/test"; * import { getConnectOptions } from "@azure/microsoft-playwright-testing"; - * import playwrightConfig from "./playwright.config"; * * test('has title', async ({ browserName }) => { * const { wsEndpoint, options } = await getConnectOptions(); @@ -131,7 +130,7 @@ const getServiceConfig = ( * await page.goto('https://playwright.dev/'); * await expect(page).toHaveTitle(/Playwright/); * - * await page.close(); + * await page.close(); * await context.close(); * await browser.close(); * }); diff --git a/sdk/playwrighttesting/microsoft-playwright-testing/src/reporter/mptReporter.ts b/sdk/playwrighttesting/microsoft-playwright-testing/src/reporter/mptReporter.ts index 4cfad45a36f9..24fd272ea775 100644 --- a/sdk/playwrighttesting/microsoft-playwright-testing/src/reporter/mptReporter.ts +++ b/sdk/playwrighttesting/microsoft-playwright-testing/src/reporter/mptReporter.ts @@ -43,7 +43,7 @@ import { ServiceErrorMessageConstants } from "../common/messages"; * import { defineConfig } from "@playwright/test"; * * export default defineConfig({ - * reporter: [["@azure/microsoft-playwright-testing"]] + * reporter: [["@azure/microsoft-playwright-testing/reporter"]] * }); * ``` */