Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(playwrighttesting): jsdocs example fixes and doc markdown changes #31028

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 } from "@azure/microsoft-playwright-testing";
*
* test("has title", async ({ browserName }) => {
* const { wsEndpoint, options } = 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 & {
Expand Down Expand Up @@ -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}.
*/
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
* }]],
* });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,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();
* });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
* });
* ```
*/
Expand Down
Loading