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
Copy file name to clipboardExpand all lines: README.md
+45-28Lines changed: 45 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ This Playwright plugin reports each project to your Sauce Labs account.
5
5
## Installation
6
6
7
7
Install from npm:
8
+
8
9
```sh
9
10
npm install @saucelabs/playwright-reporter
10
11
```
@@ -16,21 +17,22 @@ Set the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables to allow t
16
17
## Usage
17
18
18
19
Add to the default reporter:
20
+
19
21
```sh
20
22
npx playwright test --reporter=line,@saucelabs/playwright-reporter
21
23
```
22
24
23
25
Use only `@saucelabs/playwright-reporter`:
26
+
24
27
```sh
25
28
npx playwright test --reporter=@saucelabs/playwright-reporter
26
29
```
27
30
28
31
You can also configure it using `playwright.config.js`. To do that, add `'@saucelabs/playwright-reporter'` to the reporter section of your configuration:
32
+
29
33
```js
30
34
constconfig= {
31
-
reporter: [
32
-
['@saucelabs/playwright-reporter'],
33
-
],
35
+
reporter: [['@saucelabs/playwright-reporter']],
34
36
// Rest of your config goes here
35
37
};
36
38
```
@@ -40,40 +42,49 @@ const config = {
40
42
`@saucelabs/playwright-reporter` is configurable through your `playwright.config.js` or `playwright.config.ts` file.
|`buildName`| Sets a build ID. <br> Default: `''`|`string`|
62
-
|`tags`| Tags to add to the uploaded Sauce job. <br> Default: `[]`|`string[]`|
63
-
|`region`| Sets the region. <br> Default: `us-west-1`|`us-west-1`\|`eu-central-1`|
64
-
|`upload`| Whether to upload report and assets to Sauce Labs. <br> Default: `true`|`boolean`|
65
-
|`outputFile`| The local path to write the Sauce test report. Can be set in env var `SAUCE_REPORT_OUTPUT_NAME`. |`string`|
66
-
|`mergeVideos`| Whether to merge all video files generated by Playwright. This is useful when used with the `upload` option to upload the test report to Sauce Labs since it will allow you to view the merged video in the Sauce Labs Test Results page. **Requires ffmpeg to be installed.**<br> Default: `false`|`boolean`|
|`buildName`| Sets a build ID. <br> Default: `''`|`string`|
65
+
|`tags`| Tags to add to the uploaded Sauce job. <br> Default: `[]`|`string[]`|
66
+
|`region`| Sets the region. <br> Default: `us-west-1`|`us-west-1`\|`eu-central-1`|
67
+
|`upload`| Whether to upload report and assets to Sauce Labs. <br> Default: `true`|`boolean`|
68
+
|`outputFile`| The local path to write the Sauce test report. Can be set in env var `SAUCE_REPORT_OUTPUT_NAME`. |`string`|
69
+
|`mergeVideos`| Whether to merge all video files generated by Playwright. This is useful when used with the `upload` option to upload the test report to Sauce Labs since it will allow you to view the merged video in the Sauce Labs Test Results page. **Requires ffmpeg to be installed.**<br> Default: `false`|`boolean`|
67
70
68
71
## Limitations
69
72
70
73
Some limitations apply to `@saucelabs/playwright-reporter`:
71
-
* For Playwright versions before v1.16.3, the Playwright version is not reported to Sauce Labs.
72
-
* The browser version is not reported to Sauce Labs.
74
+
75
+
- For Playwright versions before v1.16.3, the Playwright version is not reported to Sauce Labs.
76
+
- The browser version is not reported to Sauce Labs.
73
77
74
78
## Development
75
79
76
-
### Running integration tests
80
+
### Setup
81
+
82
+
1. Install dependencies: `npm ci`
83
+
2. Setup git hooks: `npm run prepare`. This setups pre-commit hooks to format
84
+
and lint staged code.
85
+
3. Build: `npm run build`
86
+
87
+
### Running Locally
77
88
78
89
There are tests included in `tests/integration` where the reporter is referenced
79
90
directly.
@@ -84,22 +95,28 @@ $ cd tests/integration
84
95
$ npx playwright test
85
96
```
86
97
87
-
### Running Locally
88
-
89
-
If you have playwright tests outside of the repo, you can link and install the
98
+
If you have playwright tests outside of the repo, you can use
99
+
[npm link](https://docs.npmjs.com/cli/v11/commands/npm-link) to install the
90
100
reporter to run in your external repo.
91
101
92
102
```sh
93
-
$ npm run build
94
-
$ npm link
95
103
$ npm link @saucelabs/playwright-reporter
96
104
$ npx playwright test --reporter=@saucelabs/playwright-reporter
97
105
```
98
106
99
107
### Debug
100
108
101
-
After linking with `npm link`, you can run your Playwright tests with the environment variable `DEBUG="@saucelabs/playwright-reporter:*"` to see additional debug output.
109
+
You can run your Playwright tests with the environment variable
110
+
`DEBUG="@saucelabs/playwright-reporter:*"` to see additional debug output.
102
111
103
112
```sh
104
113
$ DEBUG="@saucelabs/playwright-reporter:*" npx playwright test --reporter=@saucelabs/playwright-reporter
105
114
```
115
+
116
+
## Releasing
117
+
118
+
New versions are released with a manual GitHub Actions workflow.
119
+
120
+
1. Go to https://github.com/saucelabs/sauce-cypress-plugin/actions/workflows/release.yml
121
+
2. Run the workflow and specify the branch and release type (`major`, `minor`,
0 commit comments