@azure/playwright 1.0.1-alpha.20260105.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Azure Playwright
|
|
2
2
|
|
|
3
|
-
Azure Playwright is a fully managed Azure service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. With Playwright
|
|
3
|
+
Azure Playwright is a fully managed Azure service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. The service also includes integrated reporting capabilities that automatically upload test results and related artifacts to Azure storage and view them in the service portal, enabling faster and easier troubleshooting. With Playwright Workspaces, you can release features faster and more confidently.
|
|
4
4
|
|
|
5
5
|
Ready to get started? Jump into our [quickstart guide](#get-started)!
|
|
6
6
|
|
|
@@ -46,6 +46,8 @@ Follow these steps to run your existing Playwright test suite with the service.
|
|
|
46
46
|
| **Resource group** | Select an existing resource group. Or select **Create new**, and then enter a unique name for the new resource group. |
|
|
47
47
|
| **Name** | Enter a unique name to identify your workspace.<br/>The name can only consist of alphanumerical characters, and have a length between 3 and 64 characters. |
|
|
48
48
|
| **Location** | Select a geographic location to host your workspace.<br/>This location also determines where the test execution results are stored. |
|
|
49
|
+
| **Reporting** | Toggle is set to “Enabled” by default to enable users to save and view their test run reports from Playwright Workspace. If you want to turn off reporting, toggle the setting to "Disabled". |
|
|
50
|
+
| **Storage account** | New storage account is created and selected by default to store the Playwright Workspaces reporting artifacts. To select an existing storage account, select from the dropdown or click on "Create new" to create a new storage account of your choice. |
|
|
49
51
|
|
|
50
52
|
> [!NOTE]
|
|
51
53
|
> Optionally, you can configure more details on the **Tags** tab. Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.
|
|
@@ -73,6 +75,7 @@ Installing the service package will create a service config file named `playwrig
|
|
|
73
75
|
The service configuration serves to:
|
|
74
76
|
|
|
75
77
|
- Direct and authenticate Playwright to the Playwright Workspaces.
|
|
78
|
+
- Add Playwright Workspaces reporting to your config.
|
|
76
79
|
- Override timeouts for service operations, if needed.
|
|
77
80
|
|
|
78
81
|
> Make sure your project uses @playwright/test version 1.47 or above.
|
|
@@ -141,6 +144,93 @@ Run Playwright tests against browsers managed by the service using the configura
|
|
|
141
144
|
npx playwright test --config=playwright.service.config.ts --workers=20
|
|
142
145
|
```
|
|
143
146
|
|
|
147
|
+
## Azure Playwright Reporter
|
|
148
|
+
|
|
149
|
+
Azure Playwright includes a custom reporter that automatically uploads your Playwright HTML test reports to Azure Storage, making them accessible directly through the Azure portal for easier debugging and result sharing.
|
|
150
|
+
|
|
151
|
+
### Features
|
|
152
|
+
|
|
153
|
+
- **Automatic Report Upload**: Seamlessly uploads Playwright HTML reports to your Azure Storage account
|
|
154
|
+
- **Portal Integration**: View test results directly in the Azure Playwright portal
|
|
155
|
+
- **Enhanced Debugging**: Access detailed test artifacts, traces, and screenshots
|
|
156
|
+
|
|
157
|
+
### Setup and Configuration
|
|
158
|
+
|
|
159
|
+
The Azure Playwright reporter is included with the `@azure/playwright` package and works alongside Playwright's built-in HTML reporter.
|
|
160
|
+
|
|
161
|
+
#### 1. Configure Reporters in Playwright Config
|
|
162
|
+
|
|
163
|
+
Add both the HTML reporter and Azure Playwright reporter to your `playwright.service.config.ts`:
|
|
164
|
+
|
|
165
|
+
```typescript snippet:configure_reporters
|
|
166
|
+
import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
|
|
167
|
+
import { defineConfig } from "@playwright/test";
|
|
168
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
169
|
+
|
|
170
|
+
// <snippet_configure_reporters>
|
|
171
|
+
import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
|
|
172
|
+
import { defineConfig } from "@playwright/test";
|
|
173
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
174
|
+
export default defineConfig(
|
|
175
|
+
getServiceConfig({
|
|
176
|
+
// Your existing configuration
|
|
177
|
+
credential: new DefaultAzureCredential(),
|
|
178
|
+
}),
|
|
179
|
+
{
|
|
180
|
+
reporter: [
|
|
181
|
+
["html", { open: "never" }], // HTML reporter must come first
|
|
182
|
+
["@azure/playwright/reporter"], // Azure reporter uploads HTML report
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### 2. Prerequisites for Reporting
|
|
189
|
+
|
|
190
|
+
Before using the Azure Playwright reporter, ensure your workspace is properly configured:
|
|
191
|
+
|
|
192
|
+
##### Workspace Configuration
|
|
193
|
+
|
|
194
|
+
**Enable Reporting and Configure Storage:**
|
|
195
|
+
1. Go to your Playwright Workspace in the Azure portal
|
|
196
|
+
2. Navigate to the **Storage configuration** tab
|
|
197
|
+
3. Toggle **Reporting** to **Enabled**
|
|
198
|
+
4. Create new or select existing storage account
|
|
199
|
+
5. Click **Save**
|
|
200
|
+
|
|
201
|
+
**Configure RBAC for Storage Access:**
|
|
202
|
+
1. Open the linked storage account
|
|
203
|
+
2. Go to **Access Control (IAM)** tab
|
|
204
|
+
3. Click **Add role assignment**
|
|
205
|
+
4. Search for and select **Storage Blob Data Contributor** role, then click **Next**
|
|
206
|
+
5. Select and add all members who will be running tests
|
|
207
|
+
6. Click **Review + assign**
|
|
208
|
+
|
|
209
|
+
**Configure CORS for Trace Viewer:**
|
|
210
|
+
1. Open the linked storage account
|
|
211
|
+
2. Go to **Settings** → **Resource sharing (CORS)**
|
|
212
|
+
3. Under **Blob service**, add a new record:
|
|
213
|
+
- **Allowed origins**: `https://trace.playwright.dev`
|
|
214
|
+
- **Allowed methods**: `GET, OPTIONS`
|
|
215
|
+
- **Max age**: Enter a value between 0 and 2147483647
|
|
216
|
+
4. Click **Save**
|
|
217
|
+
|
|
218
|
+
##### Client Requirements
|
|
219
|
+
|
|
220
|
+
- **Authentication**: Microsoft Entra ID authentication is required (access tokens are not supported for reporting)
|
|
221
|
+
- **Playwright Version**: Requires Playwright version 1.57 or higher
|
|
222
|
+
- **Service Configuration**: Must use the service configuration (playwright.service.config.ts)
|
|
223
|
+
- **Workspace Settings**: Reporting must be enabled on your Azure Playwright workspace
|
|
224
|
+
|
|
225
|
+
### How It Works
|
|
226
|
+
|
|
227
|
+
1. **Test Execution**: Tests run normally using Azure Playwright service browsers
|
|
228
|
+
2. **HTML Report Generation**: Playwright's HTML reporter generates the standard test report
|
|
229
|
+
3. **Automatic Upload**: Azure reporter uploads the HTML report folder to your workspace's Azure Storage
|
|
230
|
+
4. **Portal Access**: View results in the Azure portal via the provided URL
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
144
234
|
## Next steps
|
|
145
235
|
|
|
146
236
|
- Run tests in a [CI/CD pipeline.](https://aka.ms/pww/docs/configure-pipeline)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/playwright",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Package to integrate your Playwright test suite with Azure Playwright service",
|
|
5
5
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/playwright/README.md",
|
|
6
6
|
"sdk-type": "client",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"LICENSE"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@azure/core-auth": "
|
|
72
|
-
"@azure/core-rest-pipeline": "
|
|
73
|
-
"@azure/logger": "
|
|
71
|
+
"@azure/core-auth": "^1.9.0",
|
|
72
|
+
"@azure/core-rest-pipeline": "^1.18.0",
|
|
73
|
+
"@azure/logger": "^1.1.4",
|
|
74
74
|
"@azure/storage-blob": "^12.24.0",
|
|
75
75
|
"tslib": "^2.8.1"
|
|
76
76
|
},
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"typescript": "~5.9.3",
|
|
91
91
|
"vitest": "^4.0.8",
|
|
92
92
|
"@azure-tools/test-utils-vitest": "^2.0.1",
|
|
93
|
-
"@azure/
|
|
94
|
-
"@azure/
|
|
93
|
+
"@azure/dev-tool": "^1.0.0",
|
|
94
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@playwright/test": "^1.47.0"
|