Skip to content

Commit c7c1fa7

Browse files
committed
Merge branch 'dev' of github.com:estruyf/playwright-github-actions-reporter into dev
2 parents 0b6d355 + c136b9f commit c7c1fa7

File tree

11 files changed

+39
-20
lines changed

11 files changed

+39
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.9.1]
6+
7+
- [#20](https://github.com/estruyf/playwright-github-actions-reporter/issues/20): Add declaration file to the package
8+
59
## [1.9.0]
610

711
- [#17](https://github.com/estruyf/playwright-github-actions-reporter/issues/17): Added the ability to define which types of test results should be shown in the summary

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The reporter supports the following configuration options:
3838
| showAnnotations | Show annotations from tests | `true` |
3939
| showTags | Show tags from tests | `true` |
4040
| showError | Show error message in summary | `false` |
41-
| report | Define which types of test results should be shown in the summary | `['pass', 'skipped', 'fail', 'flaky']` |
41+
| includeResults | Define which types of test results should be shown in the summary | `['pass', 'skipped', 'fail', 'flaky']` |
4242
| quiet | Do not show any output in the console | `false` |
4343

4444
To use these option, you can update the reporter configuration:

package-lock.json

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@estruyf/github-actions-reporter",
3-
"version": "1.9.0",
3+
"version": "1.9.1",
44
"description": "GitHub Actions reporter for Playwright",
55
"main": "dist/index.js",
66
"scripts": {

playwright.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const config: PlaywrightTestConfig<{}, {}> = {
2020
useDetails: false,
2121
showError: true,
2222
quiet: false,
23-
report: ["fail", "flaky", "skipped"],
23+
includeResults: ["fail", "flaky", "skipped"],
2424
},
2525
],
2626
[
@@ -30,7 +30,7 @@ const config: PlaywrightTestConfig<{}, {}> = {
3030
useDetails: false,
3131
showError: true,
3232
quiet: false,
33-
report: ["pass", "skipped"],
33+
includeResults: ["pass", "skipped"],
3434
},
3535
],
3636
[
@@ -39,7 +39,7 @@ const config: PlaywrightTestConfig<{}, {}> = {
3939
title: "Reporter (details: true, report: fail, flaky, skipped)",
4040
useDetails: true,
4141
quiet: true,
42-
report: ["fail", "flaky", "skipped"],
42+
includeResults: ["fail", "flaky", "skipped"],
4343
},
4444
],
4545
],

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class GitHubAction implements Reporter {
3131
this.options.showTags = true;
3232
}
3333

34-
if (typeof options.report === "undefined") {
35-
this.options.report = ["fail", "flaky", "pass", "skipped"];
34+
if (typeof options.includeResults === "undefined") {
35+
this.options.includeResults = ["fail", "flaky", "pass", "skipped"];
3636
}
3737

3838
if (process.env.NODE_ENV === "development") {

src/models/GitHubActionOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export interface GitHubActionOptions {
77
showTags: boolean;
88
showError?: boolean;
99
quiet?: boolean;
10-
report?: DisplayLevel[];
10+
includeResults?: DisplayLevel[];
1111
}

src/utils/processResults.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const processResults = async (
5656
options.showAnnotations,
5757
options.showTags,
5858
!!options.showError,
59-
options.report as DisplayLevel[]
59+
options.includeResults as DisplayLevel[]
6060
);
6161

6262
if (!content) {
@@ -76,7 +76,7 @@ export const processResults = async (
7676
options.showAnnotations,
7777
options.showTags,
7878
!!options.showError,
79-
options.report as DisplayLevel[]
79+
options.includeResults as DisplayLevel[]
8080
);
8181

8282
if (tableRows.length !== 0) {

tests/fail.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ test.describe("Failing test", () => {
2222

2323
expect((await logo.allInnerTexts()).join()).toBe("PYOD");
2424
});
25+
26+
test("Make screenshot fail", async () => {
27+
await page.goto(
28+
`https://www.eliostruyf.com?playwright=margin-left:10px;%20text-transform:%20lowercase;`
29+
);
30+
31+
await expect(page).toHaveScreenshot("layout-mask.png", {
32+
mask: [page.locator(`.sidebar__content`)],
33+
});
34+
});
2535
});
195 KB
Loading

0 commit comments

Comments
 (0)