Skip to content

Commit 7955199

Browse files
committed
fix errors
1 parent 1c42e1b commit 7955199

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

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

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ After you complete this quickstart, you have a CI workflow that runs your Playwr
2121

2222
* An Azure account with an active subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
2323

24-
* A Microsoft Playwright Testing workspace. Complete the [quickstart: run Playwright tests at scale](./quickstart-run-end-to-end-tests.md) to create a workspace.
24+
* A Microsoft Playwright Testing workspace. Complete the [quickstart: run Playwright tests at scale](./quickstart-run-end-to-end-tests.md) and create a workspace.
2525

2626
# [GitHub Actions](#tab/github)
2727
- A GitHub account. If you don't have a GitHub account, you can [create one for free](https://github.com/).
@@ -62,7 +62,7 @@ To get the service endpoint URL and store it as a CI workflow secret, perform th
6262
::: zone pivot="playwright-test-runner"
6363
## Add service configuration file
6464

65-
If you haven't configured your Playwright tests yet for running them with service, add a service configuration file to your repository. In the next step, you then specify this service configuration file on the Playwright CLI.
65+
If you don't have Playwright tests configured to run with the service, add a service configuration file to your repository. In the next step, you then specify this service configuration file on the Playwright CLI.
6666

6767
1. Create a new file `playwright.service.config.ts` alongside the `playwright.config.ts` file.
6868

@@ -92,7 +92,7 @@ Update the `package.json` file in your repository to add details about Microsoft
9292

9393
## Enable artifacts in Playwright configuration
9494

95-
In the `playwright.config.ts` file of your project, make sure you are collecting all the required artifacts.
95+
In the `playwright.config.ts` file of your project, make sure you're collecting all the required artifacts.
9696
```typescript
9797
use: {
9898
trace: 'on-first-retry',
@@ -120,7 +120,7 @@ In your project, install Microsoft Playwright Testing package.
120120
dotnet add package Azure.Developer.MicrosoftPlaywrightTesting.NUnit --prerelease
121121
```
122122

123-
This updates your project's `csproj` file by adding the service package details to the `ItemGroup` section. Remember to commit these changes.
123+
This command updates your project's `csproj` file by adding the service package details to the `ItemGroup` section. Remember to commit these changes.
124124

125125
```xml
126126
<ItemGroup>
@@ -150,85 +150,85 @@ If you haven't configured your Playwright tests yet for running them with servic
150150

151151
## Enable artifacts in your Playwright setup
152152

153-
Enable artifacts such as screenshot, videos and traces to be captured by Playwright.
153+
Set up Playwright to capture artifacts such as screenshot, videos and traces.
154154
- For screenshots, see [capture screenshots](https://playwright.dev/dotnet/docs/screenshots#introduction)
155155
- For videos, see [record videos for your tests](https://playwright.dev/dotnet/docs/videos#introduction)
156156
- For traces, see [recording a trace](https://playwright.dev/dotnet/docs/trace-viewer-intro#recording-a-trace)
157157

158-
Once you collect these artifacts, attach them to the `TestContext` to ensure they are available in your test reports. For more information, see our [sample project for NUnit](https://aka.ms/mpt/nunit-sample)
158+
Once you collect these artifacts, attach them to the `TestContext` to ensure they're available in your test reports. For more information, see our [sample project for NUnit](https://aka.ms/mpt/nunit-sample)
159159
::: zone-end
160160

161161
## Set up authentication
162162

163-
The CI machine running Playwright tests needs to authenticate with Playwright Testing service to get the browsers to run the tests and to publish the test results and arifacts back to the service.
163+
The CI machine running Playwright tests needs to authenticate with Playwright Testing service to get the browsers to run the tests and to publish the test results and artifacts back to the service.
164164

165165
The service offers two authentication methods: Microsoft Entra ID and Access Tokens. We strongly recommend using Microsoft Entra ID to authenticate your pipelines.
166166

167167
#### Set up authentication using Microsoft Entra ID
168168

169-
# [GitHub Actions](#tab/github)
169+
# [GitHub Actions](#tab/github)
170170

171-
If you are using GitHub Actions, you can connect to the service using GitHub OpenID Connect. Follow the steps below to set up the integration:
171+
If you are using GitHub Actions, you can connect to the service using GitHub OpenID Connect. Follow the steps to set up the integration:
172172

173-
##### Prerequisites
173+
##### Prerequisites
174174

175-
**Option 1: Microsoft Entra application**
175+
**Option 1: Microsoft Entra application**
176176

177-
* Create a Microsoft Entra application with a service principal by [Azure portal](/entra/identity-platform/howto-create-service-principal-portal#register-an-application-with-microsoft-entra-id-and-create-a-service-principal), [Azure CLI](/cli/azure/azure-cli-sp-tutorial-1#create-a-service-principal), or [Azure PowerShell](/powershell/azure/create-azure-service-principal-azureps#create-a-service-principal).
177+
* Create a Microsoft Entra application with a service principal by [Azure portal](/entra/identity-platform/howto-create-service-principal-portal#register-an-application-with-microsoft-entra-id-and-create-a-service-principal), [Azure CLI](/cli/azure/azure-cli-sp-tutorial-1#create-a-service-principal), or [Azure PowerShell](/powershell/azure/create-azure-service-principal-azureps#create-a-service-principal).
178178

179-
* Copy the values for **Client ID**, **Subscription ID**, and **Directory (tenant) ID** to use later in your GitHub Actions workflow.
180-
181-
* Assign the `Owner` or `Contributor` role to the service principal created in the previous step. These roles must be assigned on the Playwright Testing workspace. For more details, refer to [How to manage access](./how-to-manage-access-tokens.md).
182-
183-
* [Configure a federated identity credential on a Microsoft Entra application](/entra/workload-id/workload-identity-federation-create-trust) to trust tokens issued by GitHub Actions to your GitHub repository.
179+
* Copy the values for **Client ID**, **Subscription ID**, and **Directory (tenant) ID** to use later in your GitHub Actions workflow.
184180

185-
**Option 2: User-assigned managed identity**
181+
* Assign the `Owner` or `Contributor` role to the service principal created in the previous step. These roles must be assigned on the Playwright Testing workspace. For more details, see [how to manage access](./how-to-manage-access-tokens.md).
186182

187-
* [Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity).
183+
* [Configure a federated identity credential on a Microsoft Entra application](/entra/workload-id/workload-identity-federation-create-trust) to trust tokens issued by GitHub Actions to your GitHub repository.
188184

189-
* Copy the values for **Client ID**, **Subscription ID**, and **Directory (tenant) ID** to use later in your GitHub Actions workflow.
190-
191-
* Assign the `Owner` or `Contributor` role to the user-assigned managed identity created in the previous step. These roles must be assigned on the Playwright Testing workspace. For more details, refer to [How to manage access](./how-to-manage-access-tokens.md).
192-
193-
* [Configure a federated identity credential on a user-assigned managed identity](/entra/workload-id/workload-identity-federation-create-trust-user-assigned-managed-identity) to trust tokens issued by GitHub Actions to your GitHub repository.
185+
**Option 2: User-assigned managed identity**
194186

195-
##### Create GitHub secrets
187+
* [Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity).
196188

197-
1. Add the values you got in the previous step as secrets to your GitHub repository. See [set up GitHub Action Secret](/azure/developer/github/connect-from-azure-openid-connect?branch=main#create-github-secrets). These variables will be used in the GitHub Action workflow in subsequest steps.
189+
* Copy the values for **Client ID**, **Subscription ID**, and **Directory (tenant) ID** to use later in your GitHub Actions workflow.
198190

199-
| GitHub Secret | Source (Microsoft Entra Application or Managed Identity) |
200-
|---------------------|----------------------------------------------------------|
201-
| `AZURE_CLIENT_ID` | Client ID |
202-
| `AZURE_SUBSCRIPTION_ID` | Subscription ID |
203-
| `AZURE_TENANT_ID` | Directory (Tenant) ID |
191+
* Assign the `Owner` or `Contributor` role to the user-assigned managed identity created in the previous step. These roles must be assigned on the Playwright Testing workspace. For more details, see [how to manage access](./how-to-manage-access-tokens.md).
204192

205-
> **Note:**
206-
> For enhanced security, it is strongly recommended to use GitHub Secrets to store sensitive values rather than including them directly in your workflow file.
193+
* [Configure a federated identity credential on a user-assigned managed identity](/entra/workload-id/workload-identity-federation-create-trust-user-assigned-managed-identity) to trust tokens issued by GitHub Actions to your GitHub repository.
207194

208-
# [Azure Pipelines](#tab/pipelines)
195+
##### Create GitHub secrets
209196

210-
If you are using Azure Pipelines, you can connect to the service using Service Connections. Follow the steps below to set up the integration:
197+
1. Add the values you got in the previous step as secrets to your GitHub repository. See [set up GitHub Action Secret](/azure/developer/github/connect-from-azure-openid-connect?branch=main#create-github-secrets). These variables are used in the GitHub Action workflow in subsequent steps.
211198

212-
1. [Create an app registration with workload identity federation](/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-app-registration-with-workload-identity-federation-automatic). Select the subscription and resource group associated with your Playwright Testing workspace. Typically, the resource group has the same name as the Playwright Testing workspace.
199+
| GitHub Secret | Source (Microsoft Entra Application or Managed Identity) |
200+
|---------------------|----------------------------------------------------------|
201+
| `AZURE_CLIENT_ID` | Client ID |
202+
| `AZURE_SUBSCRIPTION_ID` | Subscription ID |
203+
| `AZURE_TENANT_ID` | Directory (Tenant) ID |
213204

214-
2. Use this service connection in Azure Pipeline yaml file as shown in subsequent steps.
205+
> **Note:**
206+
> For enhanced security, it is strongly recommended to use GitHub Secrets to store sensitive values rather than including them directly in your workflow file.
215207
216-
#### Set up authentication using access tokens
208+
# [Azure Pipelines](#tab/pipelines)
217209

218-
> [!CAUTION]
219-
> We strongly recommend using Microsoft Entra ID for authentication to the service. If you are using access tokens, see [How to Manage Access Tokens](./how-to-manage-access-tokens.md)
210+
If you're using Azure Pipelines, you can connect to the service using Service Connections. Follow the steps to set up the integration:
220211

221-
You can generate an access token from your Playwright Testing workspace and use it in your setup. However, we strongly recommend Microsoft Entra ID for authentication due to its enhanced security. Access tokens, while convenient, function like long-lived passwords and are more susceptible to being compromised.
212+
1. [Create an app registration with workload identity federation](https://learn.microsoft.com//azure/devops/pipelines/library/connect-to-azure#create-an-app-registration-with-workload-identity-federation-automatic). Select the subscription and resource group associated with your Playwright Testing workspace. Typically, the resource group has the same name as the Playwright Testing workspace.
222213

223-
1. Authentication using access tokens is disabled by default. To use, [Enable access-token based authentication](./how-to-manage-authentication.md#enable-authentication-using-access-tokens)
214+
2. Use this service connection in Azure Pipeline yaml file as shown in subsequent steps.
224215

225-
2. [Set up authentication using access tokens](./how-to-manage-authentication.md#set-up-authentication-using-access-tokens)
216+
#### Set up authentication using access tokens
226217

227-
3. Store the access token in a CI workflow secret and use it in the GitHub Actions workflow or Azure Pipeline yaml file.
218+
> [!CAUTION]
219+
> We strongly recommend using Microsoft Entra ID for authentication to the service. If you're using access tokens, see [How to Manage Access Tokens](./how-to-manage-access-tokens.md)
228220
229-
| Secret name | Value |
230-
| ----------- | ------------ |
231-
| *PLAYWRIGHT_SERVICE_ACCESS_TOKEN* | Paste the value of Access Token you created previously. |
221+
You can generate an access token from your Playwright Testing workspace and use it in your setup. However, we strongly recommend Microsoft Entra ID for authentication due to its enhanced security. Access tokens, while convenient, function like long-lived passwords and are more susceptible to being compromised.
222+
223+
1. Authentication using access tokens is disabled by default. To use, [Enable access-token based authentication](./how-to-manage-authentication.md#enable-authentication-using-access-tokens)
224+
225+
2. [Set up authentication using access tokens](./how-to-manage-authentication.md#set-up-authentication-using-access-tokens)
226+
227+
3. Store the access token in a CI workflow secret and use it in the GitHub Actions workflow or Azure Pipeline yaml file.
228+
229+
| Secret name | Value |
230+
| ----------- | ------------ |
231+
| *PLAYWRIGHT_SERVICE_ACCESS_TOKEN* | Paste the value of Access Token you created previously. |
232232

233233

234234
## Update the workflow definition

0 commit comments

Comments
 (0)