Skip to content

Commit f3781c3

Browse files
committed
addressed comments and fixed errors
1 parent 61357cd commit f3781c3

6 files changed

+51
-18
lines changed

articles/playwright-testing/how-to-manage-authentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ To enable authentication using access tokens:
8181

8282
::: zone pivot="playwright-test-runner"
8383

84-
1. Set up your environment
84+
3. Set up your environment
8585

86-
To set up your environment, you have to configure the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` environment variable with the value you obtained in the previous steps. Make sure this environment variable is available in your setup where you are running tests.
86+
To set up your environment, configure the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` environment variable with the value you obtained in the previous steps. Ensure this environment variable is available in your setup where you are running tests.
8787

8888
We recommend that you use the `dotenv` module to manage your environment. With `dotenv`, you define your environment variables in the `.env` file.
8989

@@ -93,7 +93,7 @@ To enable authentication using access tokens:
9393
npm i --save-dev dotenv
9494
```
9595

96-
1. Create a `.env` file alongside the `playwright.config.ts` file in your Playwright project:
96+
2. Create a `.env` file alongside the `playwright.config.ts` file in your Playwright project:
9797

9898
```
9999
PLAYWRIGHT_SERVICE_ACCESS_TOKEN={MY-ACCESS-TOKEN}
@@ -107,7 +107,7 @@ To enable authentication using access tokens:
107107

108108
3. Set up your environment
109109

110-
To set up your environment, you have to configure the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` environment variable with the value you obtained in the previous steps. Make sure this environment variable is available in your setup where you are running tests.
110+
To set up your environment, configure the `PLAYWRIGHT_SERVICE_ACCESS_TOKEN` environment variable with the value you obtained in the previous steps. Ensure this environment variable is available in your setup where you are running tests.
111111

112112
::: zone-end
113113

articles/playwright-testing/how-to-test-local-applications.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
title: Use remote browsers for local applications
2+
title: Use remote browsers for local or private applications
33
description: Learn how to run end-to-end for locally deployed applications with Microsoft Playwright Testing Preview. Use cloud-hosted browsers to test apps on localhost or private networks.
44
ms.topic: how-to
55
ms.date: 10/04/2023
66
ms.custom: playwright-testing-preview
7+
zone_pivot_group_filename: playwright-testing/ZonePivotGroups.json
8+
zone_pivot_groups: microsoft-playwright-testing
79
---
810

9-
# Use cloud-hosted browsers for locally deployed apps with Microsoft Playwright Testing Preview
11+
# Use cloud-hosted browsers for locally deployed or privately hosted apps with Microsoft Playwright Testing Preview
1012

1113
Learn how to use Microsoft Playwright Testing Preview to run end-to-end tests for locally deployed applications. Microsoft Playwright Testing uses cloud-hosted, remote browsers for running Playwright tests at scale. You can use the service to run tests for apps on localhost, or that you host on your infrastructure.
1214

@@ -21,7 +23,9 @@ To expose local networks and resources to remote browsers, you can use the `expo
2123

2224
You can specify one or multiple networks by using a list of rules. For example, to expose test/staging deployments and [localhost](https://en.wikipedia.org/wiki/Localhost): `*.test.internal-domain,*.staging.internal-domain,<loopback>`.
2325

24-
You can configure the `exposeNetwork` option in `playwright.service.config.ts`. The following example shows how to expose the `localhost` network by using the [`<loopback>`](https://en.wikipedia.org/wiki/Loopback) rule:
26+
::: zone pivot="playwright-test-runner"
27+
28+
You can configure the `exposeNetwork` option in `playwright.service.config.ts`. The following example shows how to expose the `localhost` network by using the [`<loopback>`](https://en.wikipedia.org/wiki/Loopback) rule. You can also replace `localhost` with a domain that you want to enable for the service.
2529

2630
```typescript
2731
import { getServiceConfig, ServiceOS } from "@azure/microsoft-playwright-testing";
@@ -43,6 +47,27 @@ You can now reference `localhost` in the Playwright test code, and run the tests
4347
```bash
4448
npx playwright test --config=playwright.service.config.ts --workers=20
4549
```
50+
::: zone-end
51+
52+
53+
::: zone pivot="nunit-test-runner"
54+
55+
You can configure the `ExposeNetwork` option in `.runsettings`. The following example shows how to expose the `localhost` network by using the [`<loopback>`](https://en.wikipedia.org/wiki/Loopback) rule. You can also replace `localhost` with a domain that you want to enable for the service.
56+
57+
```xml
58+
<TestRunParameters>
59+
<!--Use this option to connect to local resources from your Playwright test code without having to configure additional firewall-->
60+
<Parameter name="ExposeNetwork" value="loopback" />
61+
</TestRunParameters>
62+
```
63+
64+
You can now reference `localhost` in the Playwright test code, and run the tests on cloud-hosted browsers with Microsoft Playwright Testing:
65+
66+
```bash
67+
dotnet test --settings:.runsettings --logger "microsoft-playwright-testing" -- NUnit.NumberOfTestWorkers=20
68+
```
69+
70+
::: zone-end
4671

4772
## Related content
4873

articles/playwright-testing/how-to-use-service-config-file.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ zone_pivot_groups: microsoft-playwright-testing
1313
::: zone pivot="playwright-test-runner"
1414

1515
This article shows you how to use the options available in the `playwright.service.config.ts` file that was generated for you.
16-
If you don't have this file in your code, follow the QuickStart guide, see [Quickstart: Run end-to-end tests at scale with Microsoft Playwright Testing Preview](./quickstart-run-end-to-end-tests.md)
16+
If you don't have this file in your code, follow [Quickstart: Run end-to-end tests at scale with Microsoft Playwright Testing Preview](./quickstart-run-end-to-end-tests.md)
1717

1818
::: zone-end
1919

2020
::: zone pivot="nunit-test-runner"
2121

2222
This article shows you how to use the options available in the `.runsettings` file.
23-
If you don't have this file in your code, follow the QuickStart guide, see [Quickstart: Run end-to-end tests at scale with Microsoft Playwright Testing Preview](./quickstart-run-end-to-end-tests.md)
23+
If you don't have this file in your code, follow [Quickstart: Run end-to-end tests at scale with Microsoft Playwright Testing Preview](./quickstart-run-end-to-end-tests.md)
2424

2525
::: zone-end
2626

@@ -171,6 +171,8 @@ Here's version of the `.runsettings` file with all the available options:
171171
<Parameter name="RunId" value="sample-run-id1" />
172172
<!--Select if you want to use cloud-hosted browsers to run your Playwright tests.-->
173173
<Parameter name="UseCloudHostedBrowsers" value="true" />
174+
<!--Use this option to connect to local resources from your Playwright test code without having to configure additional firewall-->
175+
<Parameter name="ExposeNetwork" value="loopback" />
174176
<!--Select the authentication method you want to use with Entra-->
175177
<Parameter name="AzureTokenCredentialType" value="DefaultAzureCredential" />
176178
<!--Enable/disable GitHub summary in GitHub Actions workflow.-->
@@ -223,7 +225,6 @@ Here's version of the `.runsettings` file with all the available options:
223225
<Parameter name="ServiceAuthType" value="EntraId" />
224226
```
225227

226-
227228
* **`os`**:
228229
- **Description**: This setting allows you to choose the operating system where the browsers running Playwright tests are hosted.
229230
- **Available Options**:
@@ -256,6 +257,12 @@ Here's version of the `.runsettings` file with all the available options:
256257
```xml
257258
<Parameter name="UseCloudHostedBrowsers" value="true" />
258259
```
260+
* **`ExposeNetwork`**
261+
- **Description**: This setting allows you to connect to local resources from your Playwright test code without having to configure another firewall settings. To learn more, see [how to test local applications](./how-to-test-local-applications.md)
262+
- **Example**:
263+
```xml
264+
<Parameter name="ExposeNetwork" value="loopback" />
265+
```
259266

260267
* **`reporter`**
261268
- **Description**: You can publish your test results and artifacts to the service using `microsoft-playwright-testing` logger. You can disable reporting by removing this from your `.runsettings` or by setting it to false.
@@ -264,6 +271,7 @@ Here's version of the `.runsettings` file with all the available options:
264271
```xml
265272
<Logger friendlyName="microsoft-playwright-testing" enabled="True" />
266273
```
274+
267275
* **`EnableGitHubSummary`**:
268276
- **Description**: This setting allows you to configure the Microsoft Playwright Testing service reporter. You can choose whether to include the test run summary in the GitHub summary when running in GitHub Actions.
269277
- **Default Value**: true

articles/playwright-testing/quickstart-automate-end-to-end-testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Update the CI workflow definition to run your Playwright tests with the Playwrig
153153
branches: [ main, master ]
154154
pull_request:
155155
branches: [ main, master ]
156-
permissions: # Required when using Micosoft Entra ID to authenticate
156+
permissions: # Required when using Microsoft Entra ID to authenticate
157157
id-token: write
158158
contents: read
159159
jobs:
@@ -231,7 +231,7 @@ Update the CI workflow definition to run your Playwright tests with the Playwrig
231231
232232
Update the CI workflow definition to run your Playwright tests with the Playwright NUnit CLI. Pass the `.runsettings` file as an input parameter for the Playwright CLI. You configure your environment by specifying environment variables.
233233

234-
1. Open the CI workflow definition
234+
1. Open the CI workflow definition.
235235

236236
1. Add the following steps to run your Playwright tests in Microsoft Playwright Testing.
237237

@@ -340,12 +340,12 @@ Update the CI workflow definition to run your Playwright tests with the Playwrig
340340

341341
::: zone-end
342342

343-
1. Save and commit your changes.
343+
3. Save and commit your changes.
344344

345345
When the CI workflow is triggered, your Playwright tests run in your Microsoft Playwright Testing workspace on cloud-hosted browsers, across 20 parallel workers. The results and artifacts collected are published to the service and can be viewed on service portal.
346346

347347
> [!NOTE]
348-
> Reporting feature is enabled by default for existing workspaces. This is being rolled out in stages and will take a few days. To avoid failures, confirm that `Rich diagnostics using reporting` setting is ON for your workspace before proceeding. See, [Enable reporting for workspace](./how-to-use-service-features.md#manage-feature-for-the-workspace).
348+
> Reporting feature is enabled by default for existing workspaces. This is being rolled out in stages and will take a few days. To avoid failures, confirm that `Rich diagnostics using reporting` setting is ON for your workspace before proceeding. For more information, see, [Enable reporting for workspace](./how-to-use-service-features.md#manage-feature-for-the-workspace).
349349

350350
> [!CAUTION]
351351
> With Microsoft Playwright Testing, you get charged based on the number of total test minutes consumed and test results published. If you're a first-time user or [getting started with a free trial](./how-to-try-playwright-testing-free.md), you might start with running a single test at scale instead of your full test suite to avoid exhausting your free test minutes and test results.

articles/playwright-testing/quickstart-generate-rich-reports-for-tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Microsoft Entra ID is the default and recommended authentication for the service
195195
az login
196196
```
197197
> [!NOTE]
198-
> If you're a part of multiple Microsoft Entra tenants, make sure you sign in to the tenant where your workspace belongs. You can get the tenant ID from Azure portal. See [Find your Microsoft Entra Tenant](/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant). Once you get the ID, sign-in using the command `az login --tenant <TenantID>`
198+
> If you're a part of multiple Microsoft Entra tenants, make sure you sign in to the tenant where your workspace belongs. You can get the tenant ID from Azure portal. For more information, see [Find your Microsoft Entra Tenant](/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant). Once you get the ID, sign-in using the command `az login --tenant <TenantID>`
199199

200200
##### Set up authentication using access tokens
201201

@@ -228,7 +228,7 @@ Enable artifacts such as screenshot, videos and traces to be captured by Playwri
228228
- For videos, see [record videos for your tests](https://playwright.dev/dotnet/docs/videos#introduction)
229229
- For traces, see [recording a trace](https://playwright.dev/dotnet/docs/trace-viewer-intro#recording-a-trace)
230230

231-
Once you collect these artifacts, make sure you attach them to the test path. For more information and example, see [sample configuration for NUnit](https://aka.ms/mpt/nunit-sample)
231+
Once you collect these artifacts, make sure you attach them to the test path. For more information, see [sample configuration for NUnit](https://aka.ms/mpt/nunit-sample)
232232

233233
::: zone-end
234234

@@ -261,7 +261,7 @@ You've now prepared the configuration for publishing test results and artifacts
261261
dotnet test --settings:.runsettings
262262
```
263263
264-
The settings for your test run is defined in `.runsettings` file. See [how to use service package options](./how-to-use-service-config-file.md#options-in-runsettings-file)
264+
The settings for your test run is defined in `.runsettings` file. For more information, see [how to use service package options](./how-to-use-service-config-file.md#options-in-runsettings-file)
265265
266266
> [!NOTE]
267267
> For the Reporting feature of Microsoft Playwright Testing, you get charged based on the number test results published. If you're a first-time user or [getting started with a free trial](./how-to-try-playwright-testing-free.md), you might start with publishing single test result instead of your full test suite to avoid exhausting your free trial limits.

articles/playwright-testing/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ items:
4242
- name: Manage workspace access
4343
displayName: RBAC, permissions, access, role-based access control, users, roles, security, authorization, authentication, grant, revoke
4444
href: how-to-manage-workspace-access.md
45-
- name: Run tests for local apps
45+
- name: Run tests for local and private apps
4646
displayName: local, localhost, internal app, private apps, private endpoint
4747
href: how-to-test-local-applications.md
4848
- name: Configure visual comparisons

0 commit comments

Comments
 (0)