Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dc61c0d
feat(reporter): Add github actions reporter
sidharthv96 Sep 26, 2021
4accc81
chore: Remove unnecessary exports
sidharthv96 Sep 26, 2021
edeed6f
chore(reporter): Change interface to type
sidharthv96 Sep 28, 2021
38c01c4
Merge remote-tracking branch 'upstream/master' into feat/githubAction…
sidharthv96 Sep 28, 2021
de95d31
chore(github-reporter): Make members private
sidharthv96 Sep 28, 2021
8bc0a50
feat(reporters): Add github action reporter
sidharthv96 Sep 28, 2021
65aa52e
chore(reporters): Remove unused exports
sidharthv96 Sep 28, 2021
2841db4
fix(reporters): Export formatTestTitle
sidharthv96 Sep 28, 2021
38e8bc0
fix(reporters): Use tokens in raw reporter
sidharthv96 Sep 28, 2021
db5e345
chore(reporter): Fix formatting comments
sidharthv96 Sep 29, 2021
492ca95
chore(reporter): Fix formatting comments
sidharthv96 Sep 29, 2021
f0838b7
chore(reporter): Remove ts-ignore from list
sidharthv96 Sep 29, 2021
e8fafa0
chore(reporter): Remove extra line
sidharthv96 Sep 29, 2021
4882d0b
fix: Remove base -> github calls.
sidharthv96 Sep 29, 2021
42f4525
fix: Formatting
sidharthv96 Sep 29, 2021
47c2465
fix: Formatting github
sidharthv96 Sep 29, 2021
3dec7e7
chore(github-reporter): Rename identifiers
sidharthv96 Sep 30, 2021
e153aef
test(github-reporter): Add Unit tests
sidharthv96 Sep 30, 2021
e07820d
docs: Add github reporter docs
sidharthv96 Sep 30, 2021
4529cbc
test(github-reporter): Remove only
sidharthv96 Sep 30, 2021
b1314e8
test(github-reporter): Fix test in CI
sidharthv96 Sep 30, 2021
029bdd2
Merge remote-tracking branch 'upstream/master' into feat/actionAnnota…
sidharthv96 Oct 1, 2021
fcf5de1
Merge remote-tracking branch 'upstream/master' into feat/actionAnnota…
sidharthv96 Oct 2, 2021
70785cc
fix(reporter): Path issue on windows
sidharthv96 Oct 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/test-advanced-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ These options would be typically different between local development and CI oper
- `'failures-only'` - only preserve output for failed tests.
- `projects: Project[]` - Multiple [projects](#projects) configuration.
- `quiet: boolean` - Whether to suppress stdout and stderr from the tests.
- `reporter: 'list' | 'line' | 'dot' | 'json' | 'junit'` - The reporter to use. See [reporters](./test-reporters.md) for details.
- `reporter: 'list' | 'line' | 'dot' | 'json' | 'junit' | 'github'` - The reporter to use. See [reporters](./test-reporters.md) for details.
- `reportSlowTests: { max: number, threshold: number } | null` - Whether to report slow tests. When `null`, slow tests are not reported. Otherwise, tests that took more than `threshold` milliseconds are reported as slow, but no more than `max` number of them. Passing zero as `max` reports all slow tests that exceed the threshold.
- `shard: { total: number, current: number } | null` - [Shard](./test-parallel.md#shard-tests-between-multiple-machines) information.
- `updateSnapshots: boolean` - Whether to update expected snapshots with the actual results produced by the test run.
Expand Down
28 changes: 28 additions & 0 deletions docs/src/test-reporters-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,34 @@ const config: PlaywrightTestConfig = {
export default config;
```

### Reporter for GitHub Actions

You can use the built in `github` reporter to get automatic failure annotations when running in GitHub actions.

```js js-flavor=js
// playwright.config.js
// @ts-check

/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
// 'github' for GitHub Actions CI to generate annotations, default 'list' when running locally
reporter: process.env.CI ? 'github' : 'list',
};

module.exports = config;
```

```js js-flavor=ts
// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
// 'github' for GitHub Actions CI to generate annotations, default 'list' when running locally
reporter: process.env.CI ? 'github' : 'list',
};
export default config;
```

## Built-in reporters

All built-in reporters show detailed information about failures, and mostly differ in verbosity for successful runs.
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@types/extract-zip": "^1.6.2",
"@types/mime": "^2.0.3",
"@types/minimatch": "^3.0.3",
"@types/ms": "^0.7.31",
"@types/node": "^14.17.15",
"@types/pixelmatch": "^5.2.1",
"@types/pngjs": "^3.4.2",
Expand Down Expand Up @@ -136,4 +137,4 @@
"xml2js": "^0.4.23",
"yaml": "^1.10.0"
}
}
}
Loading