html-reporter 9.17.2 → 9.18.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/build/hermione.d.ts +2 -4
- package/build/hermione.js +2 -103
- package/build/hermione.js.map +1 -1
- package/build/lib/cli-commands/gui.d.ts +1 -1
- package/build/lib/cli-commands/gui.js +4 -4
- package/build/lib/cli-commands/gui.js.map +1 -1
- package/build/lib/cli-commands/merge-reports.d.ts +1 -1
- package/build/lib/cli-commands/merge-reports.js +2 -2
- package/build/lib/cli-commands/merge-reports.js.map +1 -1
- package/build/lib/cli-commands/remove-unused-screens/index.d.ts +1 -1
- package/build/lib/cli-commands/remove-unused-screens/index.js +18 -17
- package/build/lib/cli-commands/remove-unused-screens/index.js.map +1 -1
- package/build/lib/cli-commands/remove-unused-screens/utils.d.ts +3 -3
- package/build/lib/cli-commands/remove-unused-screens/utils.js +5 -5
- package/build/lib/cli-commands/remove-unused-screens/utils.js.map +1 -1
- package/build/lib/common-utils.js +1 -9
- package/build/lib/common-utils.js.map +1 -1
- package/build/lib/constants/tests.d.ts +1 -1
- package/build/lib/constants/tests.js +2 -2
- package/build/lib/constants/tests.js.map +1 -1
- package/build/lib/constants/tool-names.d.ts +1 -1
- package/build/lib/constants/tool-names.js +1 -1
- package/build/lib/constants/tool-names.js.map +1 -1
- package/build/lib/gui/api/index.d.ts +4 -4
- package/build/lib/gui/api/index.js +4 -4
- package/build/lib/gui/api/index.js.map +1 -1
- package/build/lib/gui/app.d.ts +3 -3
- package/build/lib/gui/app.js +2 -2
- package/build/lib/gui/app.js.map +1 -1
- package/build/lib/gui/index.d.ts +2 -2
- package/build/lib/gui/server.d.ts +1 -1
- package/build/lib/gui/server.js +6 -6
- package/build/lib/gui/server.js.map +1 -1
- package/build/lib/gui/tool-runner/index.d.ts +9 -9
- package/build/lib/gui/tool-runner/index.js +23 -23
- package/build/lib/gui/tool-runner/index.js.map +1 -1
- package/build/lib/gui/tool-runner/report-subscriber.d.ts +2 -2
- package/build/lib/gui/tool-runner/report-subscriber.js +12 -12
- package/build/lib/gui/tool-runner/report-subscriber.js.map +1 -1
- package/build/lib/gui/tool-runner/runner/all-test-runner.d.ts +1 -1
- package/build/lib/gui/tool-runner/runner/index.d.ts +1 -1
- package/build/lib/gui/tool-runner/runner/runner.d.ts +1 -1
- package/build/lib/gui/tool-runner/runner/specific-test-runner.d.ts +1 -1
- package/build/lib/merge-reports/index.d.ts +1 -1
- package/build/lib/merge-reports/index.js +3 -3
- package/build/lib/merge-reports/index.js.map +1 -1
- package/build/lib/plugin-api.js +1 -1
- package/build/lib/plugin-api.js.map +1 -1
- package/build/lib/plugin-utils.d.ts +2 -2
- package/build/lib/plugin-utils.js.map +1 -1
- package/build/lib/report-builder/gui.js +2 -2
- package/build/lib/report-builder/gui.js.map +1 -1
- package/build/lib/server-utils.d.ts +6 -5
- package/build/lib/server-utils.js +6 -6
- package/build/lib/server-utils.js.map +1 -1
- package/build/lib/static/gui.min.js +1 -1
- package/build/lib/static/report.min.js +1 -1
- package/build/lib/test-adapter/hermione.d.ts +1 -43
- package/build/lib/test-adapter/hermione.js +4 -175
- package/build/lib/test-adapter/hermione.js.map +1 -1
- package/build/lib/test-adapter/testplane.d.ts +44 -0
- package/build/lib/test-adapter/testplane.js +178 -0
- package/build/lib/test-adapter/testplane.js.map +1 -0
- package/build/lib/tests-tree-builder/base.js +1 -4
- package/build/lib/tests-tree-builder/base.js.map +1 -1
- package/build/lib/types.d.ts +15 -5
- package/build/package.json +15 -5
- package/build/testplane.d.ts +4 -0
- package/build/testplane.js +109 -0
- package/build/testplane.js.map +1 -0
- package/package.json +15 -5
- package/build/gemini.d.ts +0 -2
- package/build/gemini.js +0 -5
- package/build/gemini.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const os_1 = __importDefault(require("os"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const p_queue_1 = __importDefault(require("p-queue"));
|
|
10
|
+
const cli_commands_1 = require("./lib/cli-commands");
|
|
11
|
+
const config_1 = require("./lib/config");
|
|
12
|
+
const constants_1 = require("./lib/constants");
|
|
13
|
+
const plugin_api_1 = require("./lib/plugin-api");
|
|
14
|
+
const static_1 = require("./lib/report-builder/static");
|
|
15
|
+
const server_utils_1 = require("./lib/server-utils");
|
|
16
|
+
const sqlite_client_1 = require("./lib/sqlite-client");
|
|
17
|
+
const create_workers_1 = require("./lib/workers/create-workers");
|
|
18
|
+
const image_store_1 = require("./lib/image-store");
|
|
19
|
+
const cache_1 = require("./lib/cache");
|
|
20
|
+
const images_info_saver_1 = require("./lib/images-info-saver");
|
|
21
|
+
const testplane_1 = require("./lib/test-adapter/testplane");
|
|
22
|
+
exports.default = (testplane, opts) => {
|
|
23
|
+
if (testplane.isWorker()) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const config = (0, config_1.parseConfig)(opts);
|
|
27
|
+
if (!config.enabled) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const htmlReporter = plugin_api_1.HtmlReporter.create(config, { toolName: constants_1.ToolName.Testplane });
|
|
31
|
+
testplane.htmlReporter = htmlReporter;
|
|
32
|
+
let isCliCommandLaunched = false;
|
|
33
|
+
let handlingTestResults;
|
|
34
|
+
let staticReportBuilder;
|
|
35
|
+
const withMiddleware = (fn) => {
|
|
36
|
+
return (...args) => {
|
|
37
|
+
// If any CLI command was launched, e.g. merge-reports, we need to interrupt regular flow
|
|
38
|
+
if (isCliCommandLaunched) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
return fn.call(undefined, ...args);
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
testplane.on(testplane.events.CLI, (commander) => {
|
|
45
|
+
lodash_1.default.values(cli_commands_1.cliCommands).forEach((command) => {
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
47
|
+
require(path_1.default.resolve(__dirname, 'lib/cli-commands', command))(commander, config, testplane);
|
|
48
|
+
commander.prependListener(`command:${command}`, () => {
|
|
49
|
+
isCliCommandLaunched = true;
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
testplane.on(testplane.events.INIT, withMiddleware(async () => {
|
|
54
|
+
const dbClient = await sqlite_client_1.SqliteClient.create({ htmlReporter, reportPath: config.path });
|
|
55
|
+
const imageStore = new image_store_1.SqliteImageStore(dbClient);
|
|
56
|
+
const expectedPathsCache = new cache_1.Cache(server_utils_1.getExpectedCacheKey);
|
|
57
|
+
const imagesInfoSaver = new images_info_saver_1.ImagesInfoSaver({
|
|
58
|
+
imageFileSaver: htmlReporter.imagesSaver,
|
|
59
|
+
expectedPathsCache,
|
|
60
|
+
imageStore,
|
|
61
|
+
reportPath: htmlReporter.config.path
|
|
62
|
+
});
|
|
63
|
+
staticReportBuilder = static_1.StaticReportBuilder.create(htmlReporter, config, { dbClient, imagesInfoSaver });
|
|
64
|
+
handlingTestResults = Promise.all([
|
|
65
|
+
staticReportBuilder.saveStaticFiles(),
|
|
66
|
+
handleTestResults(testplane, staticReportBuilder)
|
|
67
|
+
]).then(async () => {
|
|
68
|
+
await staticReportBuilder.finalize();
|
|
69
|
+
}).then(async () => {
|
|
70
|
+
await htmlReporter.emitAsync(htmlReporter.events.REPORT_SAVED, { reportPath: config.path });
|
|
71
|
+
});
|
|
72
|
+
htmlReporter.emit(htmlReporter.events.DATABASE_CREATED, dbClient.getRawConnection());
|
|
73
|
+
}));
|
|
74
|
+
testplane.on(testplane.events.RUNNER_START, withMiddleware((runner) => {
|
|
75
|
+
staticReportBuilder.registerWorkers((0, create_workers_1.createWorkers)(runner));
|
|
76
|
+
}));
|
|
77
|
+
testplane.on(testplane.events.RUNNER_END, withMiddleware(async () => {
|
|
78
|
+
try {
|
|
79
|
+
await handlingTestResults;
|
|
80
|
+
(0, server_utils_1.logPathToHtmlReport)(config);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
(0, server_utils_1.logError)(e);
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
87
|
+
async function handleTestResults(testplane, reportBuilder) {
|
|
88
|
+
return new Promise((resolve, reject) => {
|
|
89
|
+
const queue = new p_queue_1.default({ concurrency: os_1.default.cpus().length });
|
|
90
|
+
const promises = [];
|
|
91
|
+
[
|
|
92
|
+
{ eventName: testplane.events.TEST_PASS },
|
|
93
|
+
{ eventName: testplane.events.RETRY },
|
|
94
|
+
{ eventName: testplane.events.TEST_FAIL },
|
|
95
|
+
{ eventName: testplane.events.TEST_PENDING }
|
|
96
|
+
].forEach(({ eventName }) => {
|
|
97
|
+
testplane.on(eventName, (testResult) => {
|
|
98
|
+
promises.push(queue.add(async () => {
|
|
99
|
+
const formattedResult = (0, server_utils_1.formatTestResult)(testResult, (0, testplane_1.getStatus)(eventName, testplane.events, testResult));
|
|
100
|
+
await reportBuilder.addTestResult(formattedResult);
|
|
101
|
+
}).catch(reject));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
testplane.on(testplane.events.RUNNER_END, () => {
|
|
105
|
+
return Promise.all(promises).then(() => resolve(), reject);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=testplane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testplane.js","sourceRoot":"","sources":["../testplane.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,oDAAuB;AACvB,sDAA6B;AAG7B,qDAA+C;AAC/C,yCAAyC;AACzC,+CAAyC;AACzC,iDAA8C;AAC9C,wDAAgE;AAChE,qDAAwG;AACxG,uDAA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BACjF,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;oBAC/B,MAAM,eAAe,GAAG,IAAA,+BAAgB,EAAC,UAAU,EAAE,IAAA,qBAAS,EAAC,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;oBAEzG,MAAM,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;gBACvD,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE;YAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-reporter",
|
|
3
|
-
"version": "9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "9.18.1",
|
|
4
|
+
"description": "Html-reporter and GUI for viewing and managing results of a tests run. Currently supports Testplane and Hermione.",
|
|
5
5
|
"files": [
|
|
6
6
|
"build"
|
|
7
7
|
],
|
|
8
8
|
"exports": {
|
|
9
|
-
"./
|
|
9
|
+
"./testplane": "./build/testplane.js",
|
|
10
10
|
"./hermione": "./build/hermione.js",
|
|
11
11
|
"./playwright": "./build/playwright.js"
|
|
12
12
|
},
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"node": ">= 14"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
|
+
"testplane",
|
|
54
55
|
"hermione",
|
|
55
56
|
"plugin",
|
|
56
57
|
"html-reporter"
|
|
@@ -58,7 +59,16 @@
|
|
|
58
59
|
"homepage": "https://github.com/gemini-testing/html-reporter#readme",
|
|
59
60
|
"license": "MIT",
|
|
60
61
|
"peerDependencies": {
|
|
61
|
-
"hermione": ">=6.0.0"
|
|
62
|
+
"hermione": ">=6.0.0",
|
|
63
|
+
"testplane": "*"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"hermione": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"testplane": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
62
72
|
},
|
|
63
73
|
"dependencies": {
|
|
64
74
|
"@babel/runtime": "^7.22.5",
|
|
@@ -138,7 +148,6 @@
|
|
|
138
148
|
"eslint-plugin-react": "^7.32.2",
|
|
139
149
|
"events": "^3.3.0",
|
|
140
150
|
"fork-ts-checker-webpack-plugin": "^9.0.0",
|
|
141
|
-
"hermione": "^8.2.1",
|
|
142
151
|
"hermione-global-hook": "^1.0.1",
|
|
143
152
|
"hermione-test-repeater": "^0.0.8",
|
|
144
153
|
"html-react-parser": "^0.4.0",
|
|
@@ -193,6 +202,7 @@
|
|
|
193
202
|
"stylus": "^0.57.0",
|
|
194
203
|
"stylus-loader": "^7.1.3",
|
|
195
204
|
"terser-webpack-plugin": "^5.3.9",
|
|
205
|
+
"testplane": "^0.1.0-rc.0",
|
|
196
206
|
"tree-kill": "^1.2.2",
|
|
197
207
|
"ts-node": "^10.9.1",
|
|
198
208
|
"type-fest": "^3.13.1",
|
package/build/gemini.d.ts
DELETED
package/build/gemini.js
DELETED
package/build/gemini.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../gemini.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;IAClB,MAAM,IAAI,KAAK,CAAC,oJAAoJ,CAAC,CAAC;AAC1K,CAAC,CAAC"}
|