Skip to content

Commit 8560b27

Browse files
committed
docs(playwright): fixes
1 parent 2f60894 commit 8560b27

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

docusaurus/docs/playwright/cookbook.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_LIST_
1111

1212
- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file)
1313

14-
## Test coverage
14+
## Reporters
1515

16-
Use the [blob reporter](https://playwright.dev/docs/test-reporters#blob-reporter) without specifying an `outputDir` or `outputFile`. Later, execute `playwright --merge-reports` to output coverage or any aggregated reports you need (e.g., `json`):
16+
Use the [blob reporter](https://playwright.dev/docs/test-reporters#blob-reporter) without specifying an `outputDir` or `outputFile`. Later, execute `playwright --merge-reports` to output any aggregated reports you need (e.g., `json`):
1717

1818
```bash
19-
npx @knapsack-pro/playwright --coverage --reporter=blob,@knapsack-pro/playwright/reporters/batch
20-
npx playwright merge-reports --coverage
19+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
20+
npx playwright merge-reports --reporter=list blob-report/
2121
```
2222

23-
Knapsack Pro generates one blob file per batch of tests executed named as follows: `blob-report/TODO` (e.g., `TODO`).
23+
Knapsack Pro generates one blob file per batch of tests executed named as follows: `blob-report/report-[HASH].zip` (e.g., `blob-report/report-24ad5ce.zip`).

docusaurus/docs/playwright/guide/index.mdx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Remember to configure the number of parallel CI nodes in AppVeyor.
9494
KNAPSACK_PRO_CI_NODE_TOTAL=N \
9595
KNAPSACK_PRO_CI_NODE_INDEX=0 \
9696
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
97-
npx @knapsack-pro/playwright
97+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
9898
```
9999

100100
</TabItem>
@@ -104,7 +104,7 @@ npx @knapsack-pro/playwright
104104
KNAPSACK_PRO_CI_NODE_TOTAL=N \
105105
KNAPSACK_PRO_CI_NODE_INDEX=1 \
106106
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
107-
npx @knapsack-pro/playwright
107+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
108108
```
109109

110110
</TabItem>
@@ -114,7 +114,7 @@ npx @knapsack-pro/playwright
114114
KNAPSACK_PRO_CI_NODE_TOTAL=N \
115115
KNAPSACK_PRO_CI_NODE_INDEX=N-1 \
116116
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
117-
npx @knapsack-pro/playwright
117+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
118118
```
119119

120120
</TabItem>
@@ -134,21 +134,21 @@ Remember to configure the `parallelism` parameter in your build step.
134134
<TabItem value="node-1" label="Node 1">
135135

136136
```bash
137-
npx @knapsack-pro/playwright
137+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
138138
```
139139

140140
</TabItem>
141141
<TabItem value="node-2" label="Node 2">
142142

143143
```bash
144-
npx @knapsack-pro/playwright
144+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
145145
```
146146

147147
</TabItem>
148148
<TabItem value="node-n" label="Node N">
149149

150150
```bash
151-
npx @knapsack-pro/playwright
151+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
152152
```
153153

154154
</TabItem>
@@ -164,7 +164,7 @@ steps:
164164
- docker-compose#3.0.3:
165165
run: app
166166
# highlight-next-line
167-
command: npx @knapsack-pro/playwright
167+
command: npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
168168
config: docker-compose.test.yml
169169
# highlight-start
170170
env:
@@ -210,7 +210,7 @@ jobs:
210210
# highlight-start
211211
- run:
212212
name: playwright with @knapsack-pro/playwright
213-
command: npx @knapsack-pro/playwright
213+
command: npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
214214
# highlight-end
215215
```
216216

@@ -235,7 +235,7 @@ task:
235235
name: CI Node 1
236236
name: CI Node 2
237237
test_script:
238-
- npx @knapsack-pro/playwright
238+
- npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
239239
```
240240
241241
Remember to set up the `KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT` as an [encrypted variable](https://cirrus-ci.org/guide/writing-tasks/#encrypted-variables).
@@ -263,7 +263,7 @@ For each [parallel pipeline](https://docs.cloudbees.com/docs/cloudbees-codeship/
263263
KNAPSACK_PRO_CI_NODE_TOTAL=N \
264264
KNAPSACK_PRO_CI_NODE_INDEX=0 \
265265
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
266-
npx @knapsack-pro/playwright
266+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
267267
```
268268

269269
</TabItem>
@@ -273,7 +273,7 @@ npx @knapsack-pro/playwright
273273
KNAPSACK_PRO_CI_NODE_TOTAL=N \
274274
KNAPSACK_PRO_CI_NODE_INDEX=1 \
275275
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
276-
npx @knapsack-pro/playwright
276+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
277277
```
278278

279279
</TabItem>
@@ -283,7 +283,7 @@ npx @knapsack-pro/playwright
283283
KNAPSACK_PRO_CI_NODE_TOTAL=N \
284284
KNAPSACK_PRO_CI_NODE_INDEX=N-1 \
285285
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
286-
npx @knapsack-pro/playwright
286+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
287287
```
288288

289289
</TabItem>
@@ -353,7 +353,7 @@ steps:
353353
# highlight-end
354354
commands:
355355
# highlight-start
356-
- npx @knapsack-pro/playwright
356+
- npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
357357
# highlight-end
358358
```
359359

@@ -442,7 +442,7 @@ jobs:
442442
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
443443
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
444444
run: |
445-
npx @knapsack-pro/playwright
445+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
446446
# highlight-end
447447
```
448448

@@ -461,7 +461,7 @@ test:
461461
parallel: 2
462462
463463
script:
464-
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright
464+
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
465465
```
466466

467467
See also [how to configure running parallel CI nodes in GitLab](https://docs.gitlab.com/ee/ci/yaml/#parallel).
@@ -490,15 +490,15 @@ test_ci_first_node:
490490
script:
491491
# highlight-start
492492
- export KNAPSACK_PRO_CI_NODE_INDEX=0
493-
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright
493+
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
494494
# highlight-end
495495
496496
test_ci_second_node:
497497
stage: test
498498
script:
499499
# highlight-start
500500
- export KNAPSACK_PRO_CI_NODE_INDEX=1
501-
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright
501+
- KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
502502
# highlight-end
503503
```
504504

@@ -534,7 +534,7 @@ Define in `app.json`:
534534
],
535535
// highlight-start
536536
"scripts": {
537-
"test": "npx @knapsack-pro/playwright"
537+
"test": "npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch"
538538
},
539539
"env": {
540540
"KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT": "MY_PLAYWRIGHT_API_TOKEN"
@@ -596,7 +596,7 @@ timeout(time: 60, unit: 'MINUTES') {
596596
"""
597597
598598
stage('Run tests') {
599-
sh """${knapsack_options} npx @knapsack-pro/playwright"""
599+
sh """${knapsack_options} npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch"""
600600
}
601601
// highlight-end
602602
}
@@ -653,7 +653,7 @@ blocks:
653653
- name: Run tests with Knapsack Pro
654654
parallelism: 2
655655
commands:
656-
- npx @knapsack-pro/playwright
656+
- npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
657657
# highlight-end
658658
```
659659

@@ -675,7 +675,7 @@ Define in `.travis.yml`:
675675

676676
```yaml
677677
script:
678-
- "npx @knapsack-pro/playwright"
678+
- "npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch"
679679
680680
env:
681681
global:
@@ -714,7 +714,7 @@ KNAPSACK_PRO_CI_NODE_TOTAL=N \
714714
KNAPSACK_PRO_CI_NODE_INDEX=0 \
715715
KNAPSACK_PRO_CI_NODE_BUILD_ID=MY_BUILD_ID \
716716
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
717-
npx @knapsack-pro/playwright
717+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
718718
```
719719

720720
</TabItem>
@@ -725,7 +725,7 @@ KNAPSACK_PRO_CI_NODE_TOTAL=N \
725725
KNAPSACK_PRO_CI_NODE_INDEX=1 \
726726
KNAPSACK_PRO_CI_NODE_BUILD_ID=MY_BUILD_ID \
727727
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
728-
npx @knapsack-pro/playwright
728+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
729729
```
730730

731731
</TabItem>
@@ -736,7 +736,7 @@ KNAPSACK_PRO_CI_NODE_TOTAL=N \
736736
KNAPSACK_PRO_CI_NODE_INDEX=N-1 \
737737
KNAPSACK_PRO_CI_NODE_BUILD_ID=MY_BUILD_ID \
738738
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
739-
npx @knapsack-pro/playwright
739+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
740740
```
741741

742742
</TabItem>

docusaurus/docs/playwright/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Unless specified otherwise, everything on this page is environment variables.
1818
You can pass all the [supported Playwright CLI options](https://playwright.dev/docs/test-cli) as command-line arguments:
1919

2020
```bash
21-
npx @knapsack-pro/playwright --coverage
21+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch --retries 2
2222
```
2323

2424
## `KNAPSACK_PRO_BRANCH`
@@ -152,11 +152,11 @@ Example:
152152
```bash
153153
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_PLAYWRIGHT_API_TOKEN \
154154
KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE="user_tests.txt" \
155-
npx @knapsack-pro/playwright
155+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
156156

157157
KNAPSACK_PRO_TEST_SUITE_TOKEN_PLAYWRIGHT=MY_OTHER_PLAYWRIGHT_API_TOKEN \
158158
KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE="admin_tests.txt" \
159-
npx @knapsack-pro/playwright
159+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
160160
```
161161

162162
## `KNAPSACK_PRO_USER_SEAT`

docusaurus/docs/playwright/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can increase the memory available to Node with [`--max_old_space_size`](http
1212
```bash
1313
export NODE_OPTIONS=--max_old_space_size=4096
1414

15-
npx @knapsack-pro/playwright
15+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
1616
```
1717

1818
## Debug Knapsack Pro on your development environment/machine
@@ -28,7 +28,7 @@ KNAPSACK_PRO_COMMIT_HASH=MY_COMMIT \
2828
KNAPSACK_PRO_CI_NODE_BUILD_ID=MY_BUILD_ID \
2929
KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
3030
KNAPSACK_PRO_TEST_FILE_PATTERN="**/*.{test,spec}.?(c|m)[jt]s?(x)" \
31-
npx @knapsack-pro/playwright
31+
npx @knapsack-pro/playwright --reporter=blob,@knapsack-pro/playwright/reporters/batch
3232
```
3333

3434
`KNAPSACK_PRO_CI_NODE_BUILD_ID` must be the same as the CI build you are trying to reproduce (if it helps, take a look at what Knapsack Pro uses as `ciNodeBuildId` for your [CI provider](https://github.com/KnapsackPro/knapsack-pro-js/tree/main/packages/core/src/ci-providers)).

0 commit comments

Comments
 (0)