playwright-reborn 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +49 -10
- package/dist/context.d.ts +4 -0
- package/dist/context.js +16 -0
- package/dist/context.js.map +1 -0
- package/dist/fixture.d.ts +1 -1
- package/dist/fixture.js +31 -19
- package/dist/fixture.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/info.d.ts +7 -0
- package/dist/info.js +45 -0
- package/dist/info.js.map +1 -0
- package/dist/model.d.ts +6 -0
- package/dist/options.d.ts +14 -0
- package/dist/options.js +42 -5
- package/dist/options.js.map +1 -1
- package/dist/render.d.ts +9 -2
- package/dist/render.js +79 -9
- package/dist/render.js.map +1 -1
- package/dist/serialize.d.ts +2 -1
- package/dist/serialize.js +5 -2
- package/dist/serialize.js.map +1 -1
- package/dist/ui/report.css +44 -1
- package/dist/ui/report.js +94 -4
- package/package.json +11 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- The Timeline view no longer keeps the duration chart on screen.
|
|
6
|
+
- Run info lines up to the left.
|
|
7
|
+
- A file row names the kind once and links the file.
|
|
8
|
+
- Font license files are written to `assets/fonts/` even when the HTML file is self-contained.
|
|
9
|
+
|
|
10
|
+
## 0.2.0
|
|
11
|
+
|
|
12
|
+
- `step()` returns the value of its body.
|
|
13
|
+
- Screenshots stay on the test that took them when tests run in parallel.
|
|
14
|
+
- The report is one HTML file by default. CSS, the page script, fonts, and screenshots are inside it.
|
|
15
|
+
- The overview lists run metadata: suite, user, environment, state, defects, base URL, branch, commit, projects, workers, shard, and Playwright version.
|
|
16
|
+
- Tests can be filtered by tag and by project.
|
|
17
|
+
- `steps: 'user'` leaves hooks and Playwright's own API calls out of the step tree.
|
|
18
|
+
- The company title is the name you pass. If you omit it, the title is the project folder name.
|
|
19
|
+
- `showLogs` and `showFiles` still default to on. Set either to `false` to leave that page out.
|
|
20
|
+
|
|
21
|
+
## 0.1.0
|
|
22
|
+
|
|
23
|
+
- First npm release of the end-of-run HTML reporter.
|
package/README.md
CHANGED
|
@@ -37,29 +37,45 @@ Pass any of these next to the reporter. Omitted settings use the default.
|
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
39
|
['playwright-reborn', {
|
|
40
|
-
company: '
|
|
40
|
+
company: 'Your company',
|
|
41
41
|
accent: 'green',
|
|
42
|
-
open: 'on-failure',
|
|
43
|
-
outputFolder: 'reborn-report',
|
|
42
|
+
open: process.env.CI ? 'never' : 'on-failure',
|
|
43
|
+
outputFolder: 'reborn-report/qa',
|
|
44
|
+
reportFileName: 'index.html',
|
|
45
|
+
inline: true,
|
|
44
46
|
overview: 'chart',
|
|
45
47
|
screenshots: 'failure',
|
|
46
48
|
steps: 'user',
|
|
47
49
|
showLogs: true,
|
|
48
50
|
showFiles: true,
|
|
51
|
+
suite: 'Checkout',
|
|
52
|
+
environment: 'qa',
|
|
53
|
+
user: 'ada',
|
|
54
|
+
state: 'CA',
|
|
55
|
+
defects: ['PAY-14'],
|
|
49
56
|
}]
|
|
50
57
|
```
|
|
51
58
|
|
|
52
59
|
| Setting | Default | Allowed |
|
|
53
60
|
|---|---|---|
|
|
54
|
-
| `company` |
|
|
61
|
+
| `company` | Project folder name | Any name. This is the large title. It does not change when a run fails. |
|
|
55
62
|
| `accent` | `green` | `green`, `red`, `blue`, `amber`, `violet`. Colors the light field, failure marks, and links. |
|
|
56
|
-
| `open` | `on-failure` | `always`, `never`, `on-failure`. When to open the HTML file after the run. |
|
|
63
|
+
| `open` | `on-failure` | `always`, `never`, `on-failure`. When to open the HTML file after the run. Use `never` when `CI` is set. |
|
|
57
64
|
| `outputFolder` | `reborn-report` | A folder path. Each run replaces that folder. If you leave this unset, a sharded run writes `reborn-report-shard-1` and so on. |
|
|
65
|
+
| `reportFileName` | `index.html` | One `.html` file name, with no folders. Jenkins HTML Publisher can point at this file. |
|
|
66
|
+
| `inline` | `true` | `true` or `false`. `true` writes one HTML file with the CSS, script, and fonts inside it, and embeds screenshots. Traces and other files stay as relative links in the report folder. |
|
|
58
67
|
| `overview` | `chart` | `chart` or `timeline`. Which view the overview opens on. The buttons on the page can still switch it. |
|
|
59
|
-
| `screenshots` | `failure` | `off`, `failure`, `last`, or `steps`. When the fixture takes a picture. The Screenshots page stays in the report either way. |
|
|
60
|
-
| `steps` | `user` | `user` or `all`. `user` keeps the steps you wrote and the expectations
|
|
68
|
+
| `screenshots` | `failure` | `off`, `failure`, `last`, or `steps`. When the fixture takes a picture. The reporter sets `REBORN_SCREENSHOTS` in `onBegin`. Do not set that variable yourself. The Screenshots page stays in the report either way. |
|
|
69
|
+
| `steps` | `user` | `user` or `all`. `user` keeps the steps you wrote and the expectations, and leaves hooks and Playwright's own API calls out. `all` keeps those calls too. |
|
|
61
70
|
| `showLogs` | `true` | `true` or `false`. `false` leaves the Logs page out. |
|
|
62
71
|
| `showFiles` | `true` | `true` or `false`. `false` leaves the Files page out. |
|
|
72
|
+
| `suite` | empty | Suite name shown on the overview. |
|
|
73
|
+
| `user` | `USER` when set | Who ran the suite. A reporter option wins over `BUILD_USER`, `GITHUB_ACTOR`, and `USER`. |
|
|
74
|
+
| `environment` | `TEST_ENV` when set | For example `qa`. |
|
|
75
|
+
| `state` | `TEST_STATE` when set | A region or tenant, when the suite has one. |
|
|
76
|
+
| `defects` | empty | One defect id, or a list. Playwright `metadata.defects` and `metadata.jira` are added too. |
|
|
77
|
+
|
|
78
|
+
The overview also shows base URL, git branch, commit, projects, workers, shard, and the Playwright version when those values are present. Set them with the options above or with `metadata` in `playwright.config.ts`. `metadata.baseURL` wins over the project `baseURL`. Branch and commit are read from `GITHUB_REF_NAME`, `GIT_BRANCH`, `BRANCH_NAME`, `GITHUB_SHA`, `GIT_COMMIT`, and `COMMIT_SHA`.
|
|
63
79
|
|
|
64
80
|
## Screenshots
|
|
65
81
|
|
|
@@ -68,17 +84,40 @@ The reporter cannot photograph the page. Import the fixture in the tests that sh
|
|
|
68
84
|
```ts
|
|
69
85
|
import { test, expect, step } from 'playwright-reborn/fixture';
|
|
70
86
|
|
|
71
|
-
await step('read the receipt', async () => {
|
|
72
|
-
|
|
87
|
+
const order = await step('read the receipt', async () => {
|
|
88
|
+
return page.locator('#order').textContent();
|
|
73
89
|
});
|
|
90
|
+
await expect(order).toBe('1842');
|
|
74
91
|
```
|
|
75
92
|
|
|
93
|
+
`step` returns the value of its body, the same way `test.step` does. `test` is a normal Playwright test object, so a suite can `test.extend(...)` with its own fixtures.
|
|
94
|
+
|
|
95
|
+
The page fixture keeps each screenshot on the test that is running, including when tests run in parallel.
|
|
96
|
+
|
|
76
97
|
`failure` and `last` take one picture at the end of an attempt, for tests that use `page`. `steps` also takes a picture after each `step()`. A plain `test.step` is not photographed. Turn Playwright's own `screenshot` option off if you do not want a second copy of the same picture.
|
|
77
98
|
|
|
78
99
|
Files larger than 25MB are listed and not copied.
|
|
79
100
|
|
|
101
|
+
## Jenkins
|
|
102
|
+
|
|
103
|
+
Publish the report folder. The HTML Publisher index is `index.html`. The JUnit file stays separate for the JUnit plugin.
|
|
104
|
+
|
|
105
|
+
```groovy
|
|
106
|
+
publishHTML([
|
|
107
|
+
reportDir: 'reborn-report/qa',
|
|
108
|
+
reportFiles: 'index.html',
|
|
109
|
+
reportName: 'Reborn Report',
|
|
110
|
+
])
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`inline: true` is the default, so that HTML file opens from a Jenkins artifact or from disk without a CDN and without `assets/report.css`. Keep the report folder together if the Files page should still download traces and video. Those links are relative paths inside the folder.
|
|
114
|
+
|
|
115
|
+
Set `open: 'never'` when `CI` is set so the reporter does not launch a browser on the agent.
|
|
116
|
+
|
|
80
117
|
## License
|
|
81
118
|
|
|
82
119
|
Open source by World of Z. The code is MIT.
|
|
83
120
|
|
|
84
|
-
Geist and JetBrains Mono are included under the SIL Open Font License.
|
|
121
|
+
Geist and JetBrains Mono are included under the SIL Open Font License. With `inline: true`, the fonts are embedded in the HTML file. The license files are still written to `assets/fonts/` in the report folder.
|
|
122
|
+
|
|
123
|
+
Release notes are in `CHANGELOG.md`.
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rememberPage = rememberPage;
|
|
4
|
+
exports.forgetPage = forgetPage;
|
|
5
|
+
exports.pageFor = pageFor;
|
|
6
|
+
const pages = new WeakMap();
|
|
7
|
+
function rememberPage(testInfo, page) {
|
|
8
|
+
pages.set(testInfo, page);
|
|
9
|
+
}
|
|
10
|
+
function forgetPage(testInfo) {
|
|
11
|
+
pages.delete(testInfo);
|
|
12
|
+
}
|
|
13
|
+
function pageFor(testInfo) {
|
|
14
|
+
return pages.get(testInfo);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;AAIA,oCAEC;AAED,gCAEC;AAED,0BAEC;AAZD,MAAM,KAAK,GAAG,IAAI,OAAO,EAAkB,CAAC;AAE5C,SAAgB,YAAY,CAAC,QAAkB,EAAE,IAAU;IACzD,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,SAAgB,UAAU,CAAC,QAAkB;IAC3C,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED,SAAgB,OAAO,CAAC,QAAkB;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/fixture.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { expect } from '@playwright/test';
|
|
2
2
|
export declare const test: import("playwright/test").TestType<import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions, import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions>;
|
|
3
3
|
export { expect };
|
|
4
|
-
export declare function step(title: string, body: () => Promise<
|
|
4
|
+
export declare function step<T>(title: string, body: () => Promise<T> | T): Promise<T>;
|
package/dist/fixture.js
CHANGED
|
@@ -4,50 +4,62 @@ exports.expect = exports.test = void 0;
|
|
|
4
4
|
exports.step = step;
|
|
5
5
|
const test_1 = require("@playwright/test");
|
|
6
6
|
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return test_1.expect; } });
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (!
|
|
7
|
+
const context_1 = require("./context");
|
|
8
|
+
async function shot(name, testInfo) {
|
|
9
|
+
let info = testInfo;
|
|
10
|
+
if (!info) {
|
|
11
|
+
try {
|
|
12
|
+
info = exports.test.info();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const page = (0, context_1.pageFor)(info);
|
|
19
|
+
if (!page)
|
|
11
20
|
return;
|
|
12
21
|
try {
|
|
13
|
-
const body = await
|
|
14
|
-
await
|
|
22
|
+
const body = await page.screenshot({ timeout: 5_000 });
|
|
23
|
+
await info.attach(name, { body, contentType: 'image/png' });
|
|
15
24
|
}
|
|
16
25
|
catch {
|
|
17
26
|
// A closed page should not hide the test result.
|
|
18
27
|
}
|
|
19
28
|
}
|
|
29
|
+
function screenshotMode() {
|
|
30
|
+
return process.env.REBORN_SCREENSHOTS || 'failure';
|
|
31
|
+
}
|
|
20
32
|
exports.test = test_1.test.extend({
|
|
21
33
|
page: async ({ page }, use, testInfo) => {
|
|
22
|
-
|
|
23
|
-
activeInfo = testInfo;
|
|
34
|
+
(0, context_1.rememberPage)(testInfo, page);
|
|
24
35
|
try {
|
|
25
36
|
await use(page);
|
|
26
|
-
const mode =
|
|
37
|
+
const mode = screenshotMode();
|
|
27
38
|
const failed = testInfo.status === 'failed' || testInfo.status === 'timedOut';
|
|
28
39
|
if (mode === 'last' || (mode === 'steps' && !failed))
|
|
29
|
-
await shot('reborn:last');
|
|
40
|
+
await shot('reborn:last', testInfo);
|
|
30
41
|
if ((mode === 'failure' || mode === 'steps') && failed)
|
|
31
|
-
await shot('reborn:failure');
|
|
42
|
+
await shot('reborn:failure', testInfo);
|
|
32
43
|
}
|
|
33
44
|
finally {
|
|
34
|
-
|
|
35
|
-
activeInfo = undefined;
|
|
45
|
+
(0, context_1.forgetPage)(testInfo);
|
|
36
46
|
}
|
|
37
47
|
},
|
|
38
48
|
});
|
|
39
49
|
async function step(title, body) {
|
|
40
|
-
|
|
50
|
+
const testInfo = exports.test.info();
|
|
51
|
+
return exports.test.step(title, async () => {
|
|
41
52
|
try {
|
|
42
|
-
await body();
|
|
53
|
+
const value = await body();
|
|
54
|
+
if (screenshotMode() === 'steps')
|
|
55
|
+
await shot(`reborn:step:${title}`, testInfo);
|
|
56
|
+
return value;
|
|
43
57
|
}
|
|
44
58
|
catch (error) {
|
|
45
|
-
if (
|
|
46
|
-
await shot(`reborn:step:${title}
|
|
59
|
+
if (screenshotMode() === 'steps')
|
|
60
|
+
await shot(`reborn:step:${title}`, testInfo);
|
|
47
61
|
throw error;
|
|
48
62
|
}
|
|
49
|
-
if (process.env.REBORN_SCREENSHOTS === 'steps')
|
|
50
|
-
await shot(`reborn:step:${title}`);
|
|
51
63
|
});
|
|
52
64
|
}
|
|
53
65
|
//# sourceMappingURL=fixture.js.map
|
package/dist/fixture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../src/fixture.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../src/fixture.ts"],"names":[],"mappings":";;;AA2CA,oBAYC;AAvDD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,IAAI,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YAC1F,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,IAAI,MAAM;gBAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACjG,CAAC;gBAAS,CAAC;YACT,IAAA,oBAAU,EAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAII,KAAK,UAAU,IAAI,CAAI,KAAa,EAAE,IAA0B;IACrE,MAAM,QAAQ,GAAG,YAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,YAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;QACjC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,EAAE,CAAC;YAC3B,IAAI,cAAc,EAAE,KAAK,OAAO;gBAAE,MAAM,IAAI,CAAC,eAAe,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC/E,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,cAAc,EAAE,KAAK,OAAO;gBAAE,MAAM,IAAI,CAAC,eAAe,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC/E,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const paths_1 = require("./paths");
|
|
|
10
10
|
const render_1 = require("./render");
|
|
11
11
|
const serialize_1 = require("./serialize");
|
|
12
12
|
const format_1 = require("./format");
|
|
13
|
+
const info_1 = require("./info");
|
|
13
14
|
class RebornReporter {
|
|
14
15
|
parsed;
|
|
15
16
|
suite;
|
|
@@ -48,6 +49,33 @@ class RebornReporter {
|
|
|
48
49
|
return node_path_1.default.dirname(this.config.configFile);
|
|
49
50
|
return process.cwd();
|
|
50
51
|
}
|
|
52
|
+
metadata(key) {
|
|
53
|
+
const metadata = this.config?.metadata;
|
|
54
|
+
return metadata ? metadata[key] : undefined;
|
|
55
|
+
}
|
|
56
|
+
runInfo() {
|
|
57
|
+
const config = this.config;
|
|
58
|
+
const baseURL = (0, info_1.textValue)(this.metadata('baseURL')) || config?.projects.map((project) => (0, info_1.textValue)(project.use.baseURL)).find(Boolean) || '';
|
|
59
|
+
const defects = [
|
|
60
|
+
...this.parsed.defects,
|
|
61
|
+
...(0, info_1.listValue)(this.metadata('defects')),
|
|
62
|
+
...(0, info_1.listValue)(this.metadata('jira')),
|
|
63
|
+
];
|
|
64
|
+
return (0, info_1.infoRows)({
|
|
65
|
+
suite: this.parsed.suite || (0, info_1.textValue)(this.metadata('suite')) || (0, info_1.textValue)(this.metadata('suiteName')),
|
|
66
|
+
user: this.parsed.user || (0, info_1.textValue)(this.metadata('user')) || process.env.BUILD_USER || process.env.GITHUB_ACTOR || process.env.USER || '',
|
|
67
|
+
environment: this.parsed.environment || (0, info_1.textValue)(this.metadata('environment')) || process.env.TEST_ENV || '',
|
|
68
|
+
state: this.parsed.state || (0, info_1.textValue)(this.metadata('state')) || process.env.TEST_STATE || '',
|
|
69
|
+
defects: [...new Set(defects)].join(', '),
|
|
70
|
+
baseURL,
|
|
71
|
+
branch: (0, info_1.textValue)(this.metadata('branch')) || process.env.GITHUB_REF_NAME || process.env.GIT_BRANCH || process.env.BRANCH_NAME || '',
|
|
72
|
+
sha: (0, info_1.textValue)(this.metadata('sha')) || process.env.GITHUB_SHA || process.env.GIT_COMMIT || process.env.COMMIT_SHA || '',
|
|
73
|
+
projects: config?.projects.map((project) => project.name).filter(Boolean).join(', ') || '',
|
|
74
|
+
workers: config ? String(config.workers) : '',
|
|
75
|
+
shard: config?.shard ? `${config.shard.current}/${config.shard.total}` : '',
|
|
76
|
+
playwright: config?.version || '',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
51
79
|
folderFor(config) {
|
|
52
80
|
if (this.parsed.outputExplicit || !config.shard)
|
|
53
81
|
return this.parsed.outputFolder;
|
|
@@ -78,8 +106,12 @@ class RebornReporter {
|
|
|
78
106
|
showLogs: this.parsed.showLogs,
|
|
79
107
|
showFiles: this.parsed.showFiles,
|
|
80
108
|
overview: this.parsed.overview,
|
|
109
|
+
info: this.runInfo(),
|
|
110
|
+
});
|
|
111
|
+
const indexPath = await (0, render_1.writeReport)(outputDir, report, files, node_path_1.default.join(__dirname, 'ui'), {
|
|
112
|
+
inline: this.parsed.inline,
|
|
113
|
+
reportFileName: this.parsed.reportFileName,
|
|
81
114
|
});
|
|
82
|
-
const indexPath = await (0, render_1.writeReport)(outputDir, report, files, node_path_1.default.join(__dirname, 'ui'));
|
|
83
115
|
process.stdout.write(`\nReborn report: ${indexPath}\n`);
|
|
84
116
|
const failed = status !== 'passed';
|
|
85
117
|
if (this.parsed.open === 'always' || (this.parsed.open === 'on-failure' && failed)) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAG7B,iCAAoC;AACpC,uCAA6D;AAC7D,mCAA8C;AAC9C,qCAAuC;AACvC,2CAA0C;AAC1C,qCAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAG7B,iCAAoC;AACpC,uCAA6D;AAC7D,mCAA8C;AAC9C,qCAAuC;AACvC,2CAA0C;AAC1C,qCAA8C;AAC9C,iCAAwD;AAExD,MAAM,cAAc;IACD,MAAM,CAAkC;IACjD,KAAK,CAAoB;IACzB,MAAM,CAAyB;IACtB,MAAM,GAAkB,EAAE,CAAC;IAE5C,YAAY,UAAyB,EAAE;QACrC,IAAI,CAAC,MAAM,GAAG,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;IACtC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AAI,KAAK,YAAY,IAAI,MAAM,CAAC,EAAE,CAAC;YACnF,IAAA,iBAAU,EAAC,SAAS,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;CACF;AAED,kBAAe,cAAc,CAAC"}
|
package/dist/info.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type InfoRow = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function infoRows(fields: Record<string, string | undefined>): InfoRow[];
|
|
6
|
+
export declare function textValue(value: unknown): string;
|
|
7
|
+
export declare function listValue(value: unknown): string[];
|
package/dist/info.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.infoRows = infoRows;
|
|
4
|
+
exports.textValue = textValue;
|
|
5
|
+
exports.listValue = listValue;
|
|
6
|
+
const FIELDS = [
|
|
7
|
+
['suite', 'Suite'],
|
|
8
|
+
['user', 'User'],
|
|
9
|
+
['environment', 'Environment'],
|
|
10
|
+
['state', 'State'],
|
|
11
|
+
['defects', 'Defects'],
|
|
12
|
+
['baseURL', 'Base URL'],
|
|
13
|
+
['branch', 'Branch'],
|
|
14
|
+
['sha', 'Commit'],
|
|
15
|
+
['projects', 'Projects'],
|
|
16
|
+
['workers', 'Workers'],
|
|
17
|
+
['shard', 'Shard'],
|
|
18
|
+
['playwright', 'Playwright'],
|
|
19
|
+
];
|
|
20
|
+
function infoRows(fields) {
|
|
21
|
+
const rows = [];
|
|
22
|
+
for (const [key, label] of FIELDS) {
|
|
23
|
+
const value = fields[key]?.trim();
|
|
24
|
+
if (!value)
|
|
25
|
+
continue;
|
|
26
|
+
rows.push({ label, value });
|
|
27
|
+
}
|
|
28
|
+
return rows;
|
|
29
|
+
}
|
|
30
|
+
function textValue(value) {
|
|
31
|
+
if (typeof value === 'string')
|
|
32
|
+
return value.trim();
|
|
33
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
34
|
+
return String(value);
|
|
35
|
+
return '';
|
|
36
|
+
}
|
|
37
|
+
function listValue(value) {
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value.flatMap((item) => listValue(item));
|
|
40
|
+
}
|
|
41
|
+
if (typeof value !== 'string')
|
|
42
|
+
return [];
|
|
43
|
+
return value.split(',').map((item) => item.trim()).filter(Boolean);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=info.js.map
|
package/dist/info.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../src/info.ts"],"names":[],"mappings":";;AAiBA,4BAQC;AAED,8BAIC;AAED,8BAMC;AArCD,MAAM,MAAM,GAA4B;IACtC,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,UAAU,CAAC;IACvB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,KAAK,EAAE,QAAQ,CAAC;IACjB,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,YAAY,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,SAAgB,QAAQ,CAAC,MAA0C;IACjE,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9E,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/model.d.ts
CHANGED
|
@@ -69,6 +69,10 @@ export type ReportTest = {
|
|
|
69
69
|
order: number;
|
|
70
70
|
attempts: Attempt[];
|
|
71
71
|
};
|
|
72
|
+
export type InfoRow = {
|
|
73
|
+
label: string;
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
72
76
|
export type Report = {
|
|
73
77
|
version: 2;
|
|
74
78
|
screenshots: ShotMode;
|
|
@@ -86,6 +90,7 @@ export type Report = {
|
|
|
86
90
|
startTime: string;
|
|
87
91
|
duration: number;
|
|
88
92
|
projectName: string;
|
|
93
|
+
info: InfoRow[];
|
|
89
94
|
projects: string[];
|
|
90
95
|
workers: number;
|
|
91
96
|
shard: string | null;
|
|
@@ -97,6 +102,7 @@ export type Report = {
|
|
|
97
102
|
export type PendingFile = {
|
|
98
103
|
name: string;
|
|
99
104
|
target: string;
|
|
105
|
+
contentType?: string;
|
|
100
106
|
sourcePath?: string;
|
|
101
107
|
body?: Buffer;
|
|
102
108
|
};
|
package/dist/options.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Accent, OverviewMode, ShotMode, StepDetail } from './model';
|
|
|
2
2
|
export type RebornOpen = 'always' | 'never' | 'on-failure';
|
|
3
3
|
export type RebornOptions = {
|
|
4
4
|
outputFolder?: string;
|
|
5
|
+
reportFileName?: string;
|
|
5
6
|
open?: RebornOpen;
|
|
6
7
|
screenshots?: ShotMode;
|
|
7
8
|
steps?: StepDetail;
|
|
@@ -10,10 +11,17 @@ export type RebornOptions = {
|
|
|
10
11
|
showLogs?: boolean;
|
|
11
12
|
showFiles?: boolean;
|
|
12
13
|
overview?: OverviewMode;
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
suite?: string;
|
|
16
|
+
user?: string;
|
|
17
|
+
environment?: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
defects?: string | string[];
|
|
13
20
|
};
|
|
14
21
|
export type ParsedOptions = {
|
|
15
22
|
outputFolder: string;
|
|
16
23
|
outputExplicit: boolean;
|
|
24
|
+
reportFileName: string;
|
|
17
25
|
open: RebornOpen;
|
|
18
26
|
screenshots: ShotMode;
|
|
19
27
|
steps: StepDetail;
|
|
@@ -22,5 +30,11 @@ export type ParsedOptions = {
|
|
|
22
30
|
showLogs: boolean;
|
|
23
31
|
showFiles: boolean;
|
|
24
32
|
overview: OverviewMode;
|
|
33
|
+
inline: boolean;
|
|
34
|
+
suite: string;
|
|
35
|
+
user: string;
|
|
36
|
+
environment: string;
|
|
37
|
+
state: string;
|
|
38
|
+
defects: string[];
|
|
25
39
|
};
|
|
26
40
|
export declare function parseOptions(options?: RebornOptions): ParsedOptions;
|
package/dist/options.js
CHANGED
|
@@ -22,16 +22,14 @@ function parseOptions(options = {}) {
|
|
|
22
22
|
if (!STEP_DETAILS.has(steps)) {
|
|
23
23
|
throw new Error('Reborn steps must be "user" or "all".');
|
|
24
24
|
}
|
|
25
|
-
const company = options.company
|
|
26
|
-
if (typeof company !== 'string' || !company.trim()) {
|
|
27
|
-
throw new Error('Reborn company must be a non-empty name.');
|
|
28
|
-
}
|
|
25
|
+
const company = optionalText(options.company, 'company');
|
|
29
26
|
const accent = options.accent ?? 'green';
|
|
30
27
|
if (!ACCENTS.has(accent)) {
|
|
31
28
|
throw new Error('Reborn accent must be "green", "red", "blue", "amber", or "violet".');
|
|
32
29
|
}
|
|
33
30
|
const showLogs = flag(options.showLogs, 'showLogs');
|
|
34
31
|
const showFiles = flag(options.showFiles, 'showFiles');
|
|
32
|
+
const inline = flag(options.inline, 'inline');
|
|
35
33
|
const overview = options.overview ?? 'chart';
|
|
36
34
|
if (!OVERVIEWS.has(overview)) {
|
|
37
35
|
throw new Error('Reborn overview must be "chart" or "timeline".');
|
|
@@ -41,7 +39,46 @@ function parseOptions(options = {}) {
|
|
|
41
39
|
if (typeof outputFolder !== 'string' || !outputFolder.trim()) {
|
|
42
40
|
throw new Error('Reborn outputFolder must be a non-empty path.');
|
|
43
41
|
}
|
|
44
|
-
|
|
42
|
+
const reportFileName = options.reportFileName ?? 'index.html';
|
|
43
|
+
if (!/^[A-Za-z0-9._-]+\.html$/.test(reportFileName)) {
|
|
44
|
+
throw new Error('Reborn reportFileName must be a single .html file name.');
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
outputFolder,
|
|
48
|
+
outputExplicit,
|
|
49
|
+
reportFileName,
|
|
50
|
+
open,
|
|
51
|
+
screenshots,
|
|
52
|
+
steps,
|
|
53
|
+
company,
|
|
54
|
+
accent,
|
|
55
|
+
showLogs,
|
|
56
|
+
showFiles,
|
|
57
|
+
overview,
|
|
58
|
+
inline,
|
|
59
|
+
suite: optionalText(options.suite, 'suite'),
|
|
60
|
+
user: optionalText(options.user, 'user'),
|
|
61
|
+
environment: optionalText(options.environment, 'environment'),
|
|
62
|
+
state: optionalText(options.state, 'state'),
|
|
63
|
+
defects: defectsOf(options.defects),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function optionalText(value, name) {
|
|
67
|
+
if (value === undefined)
|
|
68
|
+
return '';
|
|
69
|
+
if (typeof value !== 'string' || !value.trim()) {
|
|
70
|
+
throw new Error(`Reborn ${name} must be a non-empty name.`);
|
|
71
|
+
}
|
|
72
|
+
return value.trim();
|
|
73
|
+
}
|
|
74
|
+
function defectsOf(value) {
|
|
75
|
+
if (value === undefined)
|
|
76
|
+
return [];
|
|
77
|
+
const items = Array.isArray(value) ? value : [value];
|
|
78
|
+
if (items.some((item) => typeof item !== 'string' || !item.trim())) {
|
|
79
|
+
throw new Error('Reborn defects must be a name or a list of names.');
|
|
80
|
+
}
|
|
81
|
+
return items.map((item) => item.trim());
|
|
45
82
|
}
|
|
46
83
|
function flag(value, name) {
|
|
47
84
|
if (value === undefined)
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;AAiDA,oCAwDC;AA9DD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACrE,MAAM,KAAK,GAAG,IAAI,GAAG,CAAW,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7E,MAAM,SAAS,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2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function embedFontUrls(css: string, dataUri: (file: string) => string): string;
|
|
3
|
+
export declare function renderHtml(json: string, assets?: {
|
|
4
|
+
css: string;
|
|
5
|
+
js: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function writeReport(outputDir: string, report: Report, files: PendingFile[], uiDir: string, output?: {
|
|
8
|
+
inline: boolean;
|
|
9
|
+
reportFileName: string;
|
|
10
|
+
}): Promise<string>;
|
package/dist/render.js
CHANGED
|
@@ -3,13 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.embedFontUrls = embedFontUrls;
|
|
6
7
|
exports.renderHtml = renderHtml;
|
|
7
8
|
exports.writeReport = writeReport;
|
|
8
9
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
11
|
const format_1 = require("./format");
|
|
11
12
|
const paths_1 = require("./paths");
|
|
12
|
-
function
|
|
13
|
+
function embedFontUrls(css, dataUri) {
|
|
14
|
+
return css.replace(/url\("fonts\/([^"]+)"\)/g, (_match, file) => `url("${dataUri(file)}")`);
|
|
15
|
+
}
|
|
16
|
+
function escapeStyle(css) {
|
|
17
|
+
return css.replace(/<\/style/gi, '<\\/style');
|
|
18
|
+
}
|
|
19
|
+
function escapeScript(source) {
|
|
20
|
+
return source.replace(/<\/script/gi, '<\\/script');
|
|
21
|
+
}
|
|
22
|
+
function renderHtml(json, assets) {
|
|
23
|
+
const style = assets
|
|
24
|
+
? `<style>${escapeStyle(assets.css)}</style>`
|
|
25
|
+
: '<link rel="stylesheet" href="assets/report.css">';
|
|
26
|
+
const script = assets
|
|
27
|
+
? `<script>${escapeScript(assets.js)}</script>`
|
|
28
|
+
: '<script src="assets/report.js"></script>';
|
|
13
29
|
return `<!DOCTYPE html>
|
|
14
30
|
<html lang="en">
|
|
15
31
|
<head>
|
|
@@ -17,14 +33,14 @@ function renderHtml(json) {
|
|
|
17
33
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
18
34
|
<meta name="robots" content="noindex">
|
|
19
35
|
<title>Report</title>
|
|
20
|
-
|
|
36
|
+
${style}
|
|
21
37
|
</head>
|
|
22
38
|
<body style="margin:0;background:#080808;color:#f0f0f0">
|
|
23
39
|
<div class="light"></div>
|
|
24
40
|
<a class="skip" href="#tests">Skip to tests</a>
|
|
25
41
|
<main class="page" id="app"></main>
|
|
26
42
|
<script id="reborn-data" type="application/json">${json}</script>
|
|
27
|
-
|
|
43
|
+
${script}
|
|
28
44
|
</body>
|
|
29
45
|
</html>
|
|
30
46
|
`;
|
|
@@ -75,7 +91,43 @@ async function writePending(outputDir, file) {
|
|
|
75
91
|
}
|
|
76
92
|
throw new Error('Attachment had no file and no body.');
|
|
77
93
|
}
|
|
78
|
-
async function
|
|
94
|
+
async function fileBody(file) {
|
|
95
|
+
if (file.body)
|
|
96
|
+
return file.body;
|
|
97
|
+
if (file.sourcePath)
|
|
98
|
+
return promises_1.default.readFile(file.sourcePath);
|
|
99
|
+
throw new Error('Attachment had no file and no body.');
|
|
100
|
+
}
|
|
101
|
+
function replacePath(report, target, next) {
|
|
102
|
+
for (const test of report.tests) {
|
|
103
|
+
for (const attempt of test.attempts) {
|
|
104
|
+
for (const attachment of attempt.attachments) {
|
|
105
|
+
if (attachment.path === target)
|
|
106
|
+
attachment.path = next;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function isImage(file) {
|
|
112
|
+
return (file.contentType || '').toLowerCase().startsWith('image/');
|
|
113
|
+
}
|
|
114
|
+
async function inlineDocument(uiDir) {
|
|
115
|
+
const css = await promises_1.default.readFile(node_path_1.default.join(uiDir, 'report.css'), 'utf8');
|
|
116
|
+
const js = await promises_1.default.readFile(node_path_1.default.join(uiDir, 'report.js'), 'utf8');
|
|
117
|
+
return { css: await replaceFontFiles(css, node_path_1.default.join(uiDir, 'fonts')), js };
|
|
118
|
+
}
|
|
119
|
+
async function replaceFontFiles(css, fontDir) {
|
|
120
|
+
const names = new Set();
|
|
121
|
+
for (const match of css.matchAll(/url\("fonts\/([^"]+)"\)/g))
|
|
122
|
+
names.add(match[1]);
|
|
123
|
+
const uris = new Map();
|
|
124
|
+
for (const name of names) {
|
|
125
|
+
const body = await promises_1.default.readFile(node_path_1.default.join(fontDir, name));
|
|
126
|
+
uris.set(name, `data:font/woff2;base64,${body.toString('base64')}`);
|
|
127
|
+
}
|
|
128
|
+
return embedFontUrls(css, (file) => uris.get(file) || `fonts/${file}`);
|
|
129
|
+
}
|
|
130
|
+
async function writeReport(outputDir, report, files, uiDir, output = { inline: true, reportFileName: 'index.html' }) {
|
|
79
131
|
const stylesheet = node_path_1.default.join(uiDir, 'report.css');
|
|
80
132
|
const script = node_path_1.default.join(uiDir, 'report.js');
|
|
81
133
|
try {
|
|
@@ -88,9 +140,15 @@ async function writeReport(outputDir, report, files, uiDir) {
|
|
|
88
140
|
await (0, paths_1.prepareOutput)(outputDir);
|
|
89
141
|
const assets = node_path_1.default.join(outputDir, 'assets');
|
|
90
142
|
await promises_1.default.mkdir(node_path_1.default.join(assets, 'attachments'), { recursive: true });
|
|
91
|
-
await promises_1.default.
|
|
92
|
-
|
|
93
|
-
|
|
143
|
+
await promises_1.default.mkdir(node_path_1.default.join(assets, 'fonts'), { recursive: true });
|
|
144
|
+
for (const license of ['Geist-OFL.txt', 'JetBrainsMono-OFL.txt']) {
|
|
145
|
+
await promises_1.default.copyFile(node_path_1.default.join(uiDir, 'fonts', license), node_path_1.default.join(assets, 'fonts', license));
|
|
146
|
+
}
|
|
147
|
+
if (!output.inline) {
|
|
148
|
+
await promises_1.default.copyFile(stylesheet, node_path_1.default.join(assets, 'report.css'));
|
|
149
|
+
await promises_1.default.copyFile(script, node_path_1.default.join(assets, 'report.js'));
|
|
150
|
+
await promises_1.default.cp(node_path_1.default.join(uiDir, 'fonts'), node_path_1.default.join(assets, 'fonts'), { recursive: true });
|
|
151
|
+
}
|
|
94
152
|
for (const file of files) {
|
|
95
153
|
if (await tooLarge(file)) {
|
|
96
154
|
markOmitted(report, file.target);
|
|
@@ -98,6 +156,12 @@ async function writeReport(outputDir, report, files, uiDir) {
|
|
|
98
156
|
continue;
|
|
99
157
|
}
|
|
100
158
|
try {
|
|
159
|
+
if (output.inline && isImage(file)) {
|
|
160
|
+
const body = await fileBody(file);
|
|
161
|
+
const type = file.contentType || 'image/png';
|
|
162
|
+
replacePath(report, file.target, `data:${type};base64,${body.toString('base64')}`);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
101
165
|
await writePending(outputDir, file);
|
|
102
166
|
}
|
|
103
167
|
catch {
|
|
@@ -105,8 +169,14 @@ async function writeReport(outputDir, report, files, uiDir) {
|
|
|
105
169
|
removeAttachment(report, file.target);
|
|
106
170
|
}
|
|
107
171
|
}
|
|
108
|
-
const indexPath = node_path_1.default.join(outputDir,
|
|
109
|
-
|
|
172
|
+
const indexPath = node_path_1.default.join(outputDir, output.reportFileName);
|
|
173
|
+
const json = (0, format_1.embedJson)(report);
|
|
174
|
+
if (!output.inline) {
|
|
175
|
+
await promises_1.default.writeFile(indexPath, renderHtml(json), 'utf8');
|
|
176
|
+
return indexPath;
|
|
177
|
+
}
|
|
178
|
+
const documentAssets = await inlineDocument(uiDir);
|
|
179
|
+
await promises_1.default.writeFile(indexPath, renderHtml(json, documentAssets), 'utf8');
|
|
110
180
|
return indexPath;
|
|
111
181
|
}
|
|
112
182
|
//# sourceMappingURL=render.js.map
|
package/dist/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":";;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings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,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,kBAAE,CAAC,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,kBAAE,CAAC,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;IACxE,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/serialize.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TestError } from '@playwright/test/reporter';
|
|
2
|
-
import type { Accent, Attempt, PendingFile, Report, ReportError, RunStatus, ShotMode, StepDetail } from './model';
|
|
2
|
+
import type { Accent, Attempt, InfoRow, PendingFile, Report, ReportError, RunStatus, ShotMode, StepDetail } from './model';
|
|
3
3
|
export type SourceSuite = {
|
|
4
4
|
title: string;
|
|
5
5
|
type: 'root' | 'project' | 'file' | 'describe';
|
|
@@ -80,6 +80,7 @@ export type BuildInput = {
|
|
|
80
80
|
showLogs?: boolean;
|
|
81
81
|
showFiles?: boolean;
|
|
82
82
|
overview?: 'chart' | 'timeline';
|
|
83
|
+
info?: InfoRow[];
|
|
83
84
|
};
|
|
84
85
|
export declare function buildReport(input: BuildInput): {
|
|
85
86
|
report: Report;
|
package/dist/serialize.js
CHANGED
|
@@ -62,7 +62,8 @@ function mapSteps(steps, rootDir, depth, detail) {
|
|
|
62
62
|
for (const step of steps) {
|
|
63
63
|
const kids = mapSteps(step.steps, rootDir, depth + 1, detail);
|
|
64
64
|
const hide = detail === 'user' && (step.category === 'pw:api' || step.category === 'fixture');
|
|
65
|
-
|
|
65
|
+
const quietHook = detail === 'user' && step.category === 'hook' && !step.error;
|
|
66
|
+
if (hide || quietHook) {
|
|
66
67
|
mapped.push(...kids);
|
|
67
68
|
continue;
|
|
68
69
|
}
|
|
@@ -147,6 +148,7 @@ function buildReport(input) {
|
|
|
147
148
|
files.push({
|
|
148
149
|
name: parsed.name,
|
|
149
150
|
target,
|
|
151
|
+
contentType: attachment.contentType,
|
|
150
152
|
sourcePath: attachment.path,
|
|
151
153
|
body: attachment.body,
|
|
152
154
|
});
|
|
@@ -208,7 +210,7 @@ function buildReport(input) {
|
|
|
208
210
|
playwrightVersion: input.playwrightVersion,
|
|
209
211
|
status: input.status,
|
|
210
212
|
word: (0, status_1.outcomeWord)(input.status),
|
|
211
|
-
company: (input.company || '
|
|
213
|
+
company: (input.company || input.projectName || 'Report').trim() || 'Report',
|
|
212
214
|
accent: input.accent || 'green',
|
|
213
215
|
showLogs: input.showLogs !== false,
|
|
214
216
|
showFiles: input.showFiles !== false,
|
|
@@ -217,6 +219,7 @@ function buildReport(input) {
|
|
|
217
219
|
startTime: input.startTime.toISOString(),
|
|
218
220
|
duration: input.duration,
|
|
219
221
|
projectName: input.projectName,
|
|
222
|
+
info: input.info || [],
|
|
220
223
|
projects: input.projects,
|
|
221
224
|
workers: input.workers,
|
|
222
225
|
shard: input.shard,
|
package/dist/serialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":";;;;;AA6LA,kCAoHC;AAjTD,0DAA6B;AAE7B,qCAQkB;AAElB,mCAAwC;AACxC,qCAAkG;AA2ElG,SAAS,UAAU,CAAC,IAAgB;IAClC,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,IAAI,KAAK,GAA4B,IAAI,CAAC,MAAM,CAAC;IACjD,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,8 @@ body[data-accent="violet"] {
|
|
|
87
87
|
|
|
88
88
|
* { box-sizing: border-box; }
|
|
89
89
|
|
|
90
|
+
[hidden] { display: none !important; }
|
|
91
|
+
|
|
90
92
|
body {
|
|
91
93
|
margin: 0;
|
|
92
94
|
background: #050806;
|
|
@@ -244,6 +246,47 @@ button { cursor: pointer; }
|
|
|
244
246
|
font-weight: 400;
|
|
245
247
|
}
|
|
246
248
|
|
|
249
|
+
.info {
|
|
250
|
+
display: grid;
|
|
251
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
252
|
+
gap: 10px 18px;
|
|
253
|
+
margin: 0 0 8px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.info-row {
|
|
257
|
+
display: flex;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
align-items: flex-start;
|
|
260
|
+
margin: 0;
|
|
261
|
+
text-align: left;
|
|
262
|
+
}
|
|
263
|
+
.info dt { color: var(--subtle); font-size: 12px; }
|
|
264
|
+
.info dd { margin: 2px 0 0; font-size: 14px; }
|
|
265
|
+
|
|
266
|
+
.tags {
|
|
267
|
+
display: flex;
|
|
268
|
+
flex-wrap: wrap;
|
|
269
|
+
gap: 8px 14px;
|
|
270
|
+
align-items: baseline;
|
|
271
|
+
margin-top: 12px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.tag-btn,
|
|
275
|
+
.project-btn {
|
|
276
|
+
background: none;
|
|
277
|
+
border: 0;
|
|
278
|
+
padding: 0;
|
|
279
|
+
color: var(--subtle);
|
|
280
|
+
font-size: 14px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.tag-btn[aria-pressed="true"],
|
|
284
|
+
.project-btn[aria-pressed="true"] {
|
|
285
|
+
color: var(--text);
|
|
286
|
+
font-weight: 500;
|
|
287
|
+
box-shadow: inset 0 -1px 0 var(--accent);
|
|
288
|
+
}
|
|
289
|
+
|
|
247
290
|
.banner {
|
|
248
291
|
margin-top: 22px;
|
|
249
292
|
border-left: 1px solid var(--accent);
|
|
@@ -975,7 +1018,7 @@ dialog::backdrop { background: rgba(8, 8, 8, 0.92); }
|
|
|
975
1018
|
pointer-events: none;
|
|
976
1019
|
}
|
|
977
1020
|
|
|
978
|
-
.rail .meta { margin: 0 0 0 auto; flex-direction: row; gap: 16px; }
|
|
1021
|
+
.rail .meta { margin: 0 0 0 auto; flex-direction: row; gap: 16px; justify-content: flex-end; max-width: 46%; text-align: right; }
|
|
979
1022
|
|
|
980
1023
|
.rail .tabbar {
|
|
981
1024
|
flex-direction: row;
|
package/dist/ui/report.js
CHANGED
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
listLimit: 200,
|
|
30
30
|
shotFilter: 'all',
|
|
31
31
|
logQuery: '',
|
|
32
|
+
tag: 'all',
|
|
33
|
+
projectFilter: 'all',
|
|
32
34
|
overview: data.overview === 'timeline' ? 'timeline' : 'chart',
|
|
33
35
|
order: 'grouped',
|
|
34
36
|
band: 'all',
|
|
@@ -163,7 +165,7 @@
|
|
|
163
165
|
|
|
164
166
|
function companyName() {
|
|
165
167
|
var name = typeof data.company === 'string' ? data.company.trim() : '';
|
|
166
|
-
return name || '
|
|
168
|
+
return name || 'Report';
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
function accentName() {
|
|
@@ -250,6 +252,7 @@
|
|
|
250
252
|
'<p class="time" id="time"></p>',
|
|
251
253
|
'</header>',
|
|
252
254
|
'<div id="errors"></div>',
|
|
255
|
+
'<dl class="info" id="info"></dl>',
|
|
253
256
|
'<section class="console">',
|
|
254
257
|
'<div class="console-body">',
|
|
255
258
|
'<p class="section-label">Results</p>',
|
|
@@ -272,6 +275,7 @@
|
|
|
272
275
|
document.getElementById('summary').textContent = data.summary || '';
|
|
273
276
|
countUp(document.getElementById('time'), data.duration || 0, formatDuration);
|
|
274
277
|
paintErrors();
|
|
278
|
+
paintInfo();
|
|
275
279
|
paintCounts(document.getElementById('legend'), false);
|
|
276
280
|
paintDuration();
|
|
277
281
|
paintStrip();
|
|
@@ -279,6 +283,22 @@
|
|
|
279
283
|
showNow(state.selectedId);
|
|
280
284
|
}
|
|
281
285
|
|
|
286
|
+
function paintInfo() {
|
|
287
|
+
var host = document.getElementById('info');
|
|
288
|
+
if (!host) return;
|
|
289
|
+
var rows = Array.isArray(data.info) ? data.info : [];
|
|
290
|
+
if (!rows.length) {
|
|
291
|
+
host.hidden = true;
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
fill(host, rows.map(function (row) {
|
|
295
|
+
return el('div', { class: 'info-row' }, [
|
|
296
|
+
el('dt', null, [row.label]),
|
|
297
|
+
el('dd', null, [row.value]),
|
|
298
|
+
]);
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
|
|
282
302
|
function bandLabel(id) {
|
|
283
303
|
var found = BANDS.find(function (band) { return band[0] === id; });
|
|
284
304
|
return found ? found[1] : '';
|
|
@@ -505,6 +525,45 @@
|
|
|
505
525
|
});
|
|
506
526
|
}
|
|
507
527
|
|
|
528
|
+
function uniqueValues(pick) {
|
|
529
|
+
var seen = {};
|
|
530
|
+
data.tests.forEach(function (test) {
|
|
531
|
+
pick(test).forEach(function (value) {
|
|
532
|
+
if (value) seen[value] = true;
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
return Object.keys(seen).sort();
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function paintTags() {
|
|
539
|
+
var host = document.getElementById('tags');
|
|
540
|
+
if (!host) return;
|
|
541
|
+
var tags = uniqueValues(function (test) { return test.tags || []; });
|
|
542
|
+
var projects = uniqueValues(function (test) { return test.project ? [test.project] : []; });
|
|
543
|
+
var nodes = [];
|
|
544
|
+
if (tags.length) {
|
|
545
|
+
nodes.push(el('span', { class: 'order-label' }, ['Tags']));
|
|
546
|
+
nodes.push(chip('tag-btn', 'all', 'All', state.tag));
|
|
547
|
+
tags.forEach(function (tag) { nodes.push(chip('tag-btn', tag, tag, state.tag)); });
|
|
548
|
+
}
|
|
549
|
+
if (projects.length > 1) {
|
|
550
|
+
nodes.push(el('span', { class: 'order-label' }, ['Project']));
|
|
551
|
+
nodes.push(chip('project-btn', 'all', 'All', state.projectFilter));
|
|
552
|
+
projects.forEach(function (project) { nodes.push(chip('project-btn', project, project, state.projectFilter)); });
|
|
553
|
+
}
|
|
554
|
+
host.hidden = nodes.length === 0;
|
|
555
|
+
fill(host, nodes);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
function chip(className, value, label, current) {
|
|
559
|
+
return el('button', {
|
|
560
|
+
class: className,
|
|
561
|
+
type: 'button',
|
|
562
|
+
'data-value': value,
|
|
563
|
+
'aria-pressed': current === value ? 'true' : 'false',
|
|
564
|
+
}, [label]);
|
|
565
|
+
}
|
|
566
|
+
|
|
508
567
|
function sortTests(tests) {
|
|
509
568
|
var copy = tests.slice();
|
|
510
569
|
if (state.order === 'fastest') {
|
|
@@ -541,8 +600,9 @@
|
|
|
541
600
|
if (built.tests) return;
|
|
542
601
|
built.tests = true;
|
|
543
602
|
var host = document.getElementById('panel-tests');
|
|
544
|
-
host.innerHTML = '<div class="legend" id="test-tools"></div><div class="order" id="order"></div><div class="split"><div id="tests"></div><section class="detail" id="detail"></section></div>';
|
|
603
|
+
host.innerHTML = '<div class="legend" id="test-tools"></div><div class="tags" id="tags"></div><div class="order" id="order"></div><div class="split"><div id="tests"></div><section class="detail" id="detail"></section></div>';
|
|
545
604
|
paintCounts(document.getElementById('test-tools'), true);
|
|
605
|
+
paintTags();
|
|
546
606
|
paintOrder();
|
|
547
607
|
paintList();
|
|
548
608
|
paintDetail();
|
|
@@ -872,7 +932,7 @@
|
|
|
872
932
|
(test.attempts || []).forEach(function (attempt, index) {
|
|
873
933
|
(attempt.attachments || []).forEach(function (file) {
|
|
874
934
|
if (file.kind === 'image') return;
|
|
875
|
-
var label = file.kind === 'trace' ? 'Trace' : file.kind === 'video' ? 'Video' :
|
|
935
|
+
var label = file.kind === 'trace' ? 'Trace' : file.kind === 'video' ? 'Video' : 'File';
|
|
876
936
|
var line = [el('span', { class: 'file-kind' }, [label])];
|
|
877
937
|
if ((test.attempts || []).length > 1) line.push(el('span', { class: 'now-file' }, ['Attempt ' + (index + 1)]));
|
|
878
938
|
if (file.omitted || !safeSrc(file.path)) {
|
|
@@ -881,7 +941,8 @@
|
|
|
881
941
|
line.push(el('video', { class: 'video', controls: 'true', preload: 'metadata', src: safeSrc(file.path) }));
|
|
882
942
|
} else {
|
|
883
943
|
var href = safeSrc(file.path);
|
|
884
|
-
|
|
944
|
+
var linkText = file.kind === 'trace' ? 'Download' : (file.name || 'Download');
|
|
945
|
+
line.push(el('a', { class: 'file-link', href: href, download: '' }, [linkText]));
|
|
885
946
|
if (file.kind === 'trace') {
|
|
886
947
|
line.push(el('span', { class: 'now-file' }, ['npx playwright show-trace ' + href]));
|
|
887
948
|
}
|
|
@@ -946,6 +1007,26 @@
|
|
|
946
1007
|
paintDetail();
|
|
947
1008
|
return;
|
|
948
1009
|
}
|
|
1010
|
+
var tag = target.closest('.tag-btn');
|
|
1011
|
+
if (tag) {
|
|
1012
|
+
state.tag = tag.dataset.value || 'all';
|
|
1013
|
+
state.listLimit = 200;
|
|
1014
|
+
keepSelectionInFilter();
|
|
1015
|
+
paintTags();
|
|
1016
|
+
paintList();
|
|
1017
|
+
paintDetail();
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
var projectButton = target.closest('.project-btn');
|
|
1021
|
+
if (projectButton) {
|
|
1022
|
+
state.projectFilter = projectButton.dataset.value || 'all';
|
|
1023
|
+
state.listLimit = 200;
|
|
1024
|
+
keepSelectionInFilter();
|
|
1025
|
+
paintTags();
|
|
1026
|
+
paintList();
|
|
1027
|
+
paintDetail();
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
949
1030
|
var order = target.closest('.order-btn');
|
|
950
1031
|
if (order) {
|
|
951
1032
|
state.order = order.dataset.order || 'grouped';
|
|
@@ -1102,6 +1183,8 @@
|
|
|
1102
1183
|
state.filter = 'all';
|
|
1103
1184
|
state.query = '';
|
|
1104
1185
|
state.band = 'all';
|
|
1186
|
+
state.tag = 'all';
|
|
1187
|
+
state.projectFilter = 'all';
|
|
1105
1188
|
var find = document.getElementById('find');
|
|
1106
1189
|
if (find) find.value = '';
|
|
1107
1190
|
}
|
|
@@ -1114,6 +1197,7 @@
|
|
|
1114
1197
|
showTab('tests');
|
|
1115
1198
|
if (built.tests) {
|
|
1116
1199
|
syncPressed();
|
|
1200
|
+
paintTags();
|
|
1117
1201
|
paintOrder();
|
|
1118
1202
|
paintList();
|
|
1119
1203
|
paintDetail();
|
|
@@ -1144,6 +1228,8 @@
|
|
|
1144
1228
|
state.filter = 'all';
|
|
1145
1229
|
state.query = '';
|
|
1146
1230
|
state.band = 'all';
|
|
1231
|
+
state.tag = 'all';
|
|
1232
|
+
state.projectFilter = 'all';
|
|
1147
1233
|
var find = document.getElementById('find');
|
|
1148
1234
|
if (find) find.value = '';
|
|
1149
1235
|
state.selectedId = id;
|
|
@@ -1151,6 +1237,7 @@
|
|
|
1151
1237
|
state.testPane = 'shots';
|
|
1152
1238
|
showTab('tests');
|
|
1153
1239
|
if (built.tests) {
|
|
1240
|
+
paintTags();
|
|
1154
1241
|
paintOrder();
|
|
1155
1242
|
paintList();
|
|
1156
1243
|
paintDetail();
|
|
@@ -1191,6 +1278,8 @@
|
|
|
1191
1278
|
var query = state.query.trim().toLowerCase();
|
|
1192
1279
|
return data.tests.filter(function (test) {
|
|
1193
1280
|
if (state.filter !== 'all' && test.status !== state.filter) return false;
|
|
1281
|
+
if (state.tag !== 'all' && (test.tags || []).indexOf(state.tag) === -1) return false;
|
|
1282
|
+
if (state.projectFilter !== 'all' && test.project !== state.projectFilter) return false;
|
|
1194
1283
|
if (state.band !== 'all' && (test.status === 'skipped' || durationBand(test.duration) !== state.band)) return false;
|
|
1195
1284
|
if (!query) return true;
|
|
1196
1285
|
var blob = [test.title, test.file, test.project].concat(test.group || [], test.tags || []).join(' ').toLowerCase();
|
|
@@ -1266,6 +1355,7 @@
|
|
|
1266
1355
|
|
|
1267
1356
|
function safeSrc(value) {
|
|
1268
1357
|
if (typeof value !== 'string' || !value) return '';
|
|
1358
|
+
if (value.indexOf('data:image/') === 0 && value.indexOf(' ') === -1) return value;
|
|
1269
1359
|
if (!value.startsWith('assets/attachments/')) return '';
|
|
1270
1360
|
if (value.indexOf('..') !== -1 || value.indexOf('\\') !== -1 || value.indexOf('://') !== -1) return '';
|
|
1271
1361
|
return value;
|
package/package.json
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-reborn",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A Playwright reporter that writes one self-contained HTML report when the run finishes.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
10
12
|
"default": "./dist/index.js"
|
|
11
13
|
},
|
|
12
14
|
"./fixture": {
|
|
13
15
|
"types": "./dist/fixture.d.ts",
|
|
16
|
+
"import": "./dist/fixture.js",
|
|
17
|
+
"require": "./dist/fixture.js",
|
|
14
18
|
"default": "./dist/fixture.js"
|
|
15
19
|
}
|
|
16
20
|
},
|
|
@@ -19,13 +23,17 @@
|
|
|
19
23
|
"!dist/**/*.test.js",
|
|
20
24
|
"!dist/**/*.test.d.ts",
|
|
21
25
|
"!dist/**/*.test.js.map",
|
|
22
|
-
"
|
|
26
|
+
"!dist/fixture-types.js",
|
|
27
|
+
"!dist/fixture-types.d.ts",
|
|
28
|
+
"!dist/fixture-types.js.map",
|
|
29
|
+
"README.md",
|
|
30
|
+
"CHANGELOG.md"
|
|
23
31
|
],
|
|
24
32
|
"scripts": {
|
|
25
33
|
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
26
34
|
"prepare": "npm run build",
|
|
27
35
|
"prepublishOnly": "npm test",
|
|
28
|
-
"test": "npm run build && node --test dist/format.test.js dist/status.test.js dist/options.test.js dist/paths.test.js dist/serialize.test.js",
|
|
36
|
+
"test": "npm run build && node --test dist/format.test.js dist/status.test.js dist/options.test.js dist/paths.test.js dist/serialize.test.js dist/info.test.js dist/context.test.js dist/render.test.js",
|
|
29
37
|
"demo": "npm run build && playwright test",
|
|
30
38
|
"verify": "npm run demo; node scripts/verify-ui.mjs"
|
|
31
39
|
},
|