You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tag or tags prepended to each test in the report. Useful for tagging your test run to differentiate between [CI environments](../test-sharding.md#merging-reports-from-multiple-environments).
543
+
544
+
Note that each tag must start with `@` symbol. Learn more about [tagging](../test-annotations.md#tag-tests).
545
+
546
+
**Usage**
547
+
548
+
```js title="playwright.config.ts"
549
+
import { defineConfig } from'@playwright/test';
550
+
551
+
exportdefaultdefineConfig({
552
+
tag:process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2"
Copy file name to clipboardExpand all lines: docs/src/test-reporters-js.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,16 +263,50 @@ Blob reports contain all the details about the test run and can be used later to
263
263
npx playwright test --reporter=blob
264
264
```
265
265
266
-
By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found). The report file name looks like `report-<hash>.zip` or `report-<hash>-<shard_number>.zip` when [sharding](./test-sharding.md) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project` and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or pass as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable.
266
+
By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found).
267
+
268
+
The report file name looks like `report-<hash>.zip` or `report-<hash>-<shard_number>.zip` when [sharding](./test-sharding.md) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project`, [`property: TestConfig.tag`] and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or passed as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable.
269
+
270
+
<Tabs
271
+
groupId="blob-report"
272
+
defaultValue="shards"
273
+
values={[
274
+
{label: 'Shards', value: 'shards'},
275
+
{label: 'Environments', value: 'environments'},
276
+
]
277
+
}>
278
+
279
+
<TabItemvalue="shards">
280
+
281
+
When using blob report to merge multiple shards, you don't have to pass any options.
282
+
283
+
```js title="playwright.config.ts"
284
+
import { defineConfig } from'@playwright/test';
285
+
286
+
exportdefaultdefineConfig({
287
+
reporter:'blob',
288
+
});
289
+
```
290
+
291
+
</TabItem>
292
+
293
+
<TabItemvalue="environments">
294
+
295
+
When running tests in different environments, you might want to use [`property: TestConfig.tag`] to add a global tag corresponding to the environment. This tag will bring clarity to the merged report, and it will be used to produce a unique blob report name.
Copy file name to clipboardExpand all lines: docs/src/test-sharding-js.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ export default defineConfig({
58
58
});
59
59
```
60
60
61
-
Blob report contains information about all the tests that were run and their results as well as all test attachments such as traces and screenshot diffs. Blob reports can be merged and converted to any other Playwright report. By default, blob report will be generated into `blob-report` directory.
61
+
Blob report contains information about all the tests that were run and their results as well as all test attachments such as traces and screenshot diffs. Blob reports can be merged and converted to any other Playwright report. By default, blob report will be generated into `blob-report` directory. You can learn about [blob report options here](./test-reporters.md#blob-reporter).
62
62
63
63
To merge reports from multiple shards, put the blob report files into a single directory, for example `all-blob-reports`. Blob report names contain shard number, so they will not clash.
64
64
@@ -164,6 +164,22 @@ You can now see the reports have been merged and a combined HTML report is avail
If you want to run the same tests in multiple environments, as opposed to shard your tests onto multiple machines, you need to differentiate these enviroments.
170
+
171
+
In this case, it is useful to specify the [`property: TestConfig.tag`] property, to tag all tests with the environment name. This tag will be automatically picked up by the blob report and later on by the merge tool.
172
+
173
+
```js title="playwright.config.ts"
174
+
import { defineConfig } from '@playwright/test';
175
+
176
+
export default defineConfig({
177
+
reporter: process.env.CI ? 'blob' : 'html',
178
+
tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2"
179
+
});
180
+
```
181
+
182
+
167
183
## Merge-reports CLI
168
184
169
185
`npx playwright merge-reports path/to/blob-reports-dir`reads all blob reports from the passed directory and merges them into a single report.
0 commit comments