html-reporter 9.10.2 → 9.11.0
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.js +2 -2
- package/build/hermione.js.map +1 -1
- package/build/lib/cli-commands/gui.js +2 -1
- package/build/lib/cli-commands/gui.js.map +1 -1
- package/build/lib/cli-commands/index.d.ts +5 -3
- package/build/lib/cli-commands/index.js +4 -2
- package/build/lib/cli-commands/index.js.map +1 -1
- package/build/lib/cli-commands/merge-reports.js +2 -1
- package/build/lib/cli-commands/merge-reports.js.map +1 -1
- package/build/lib/cli-commands/remove-unused-screens/index.js +2 -1
- package/build/lib/cli-commands/remove-unused-screens/index.js.map +1 -1
- package/build/lib/common-utils.d.ts +9 -8
- package/build/lib/common-utils.js +11 -11
- package/build/lib/common-utils.js.map +1 -1
- package/build/lib/config/custom-gui-asserts.d.ts +1 -1
- package/build/lib/config/custom-gui-asserts.js +28 -22
- package/build/lib/config/custom-gui-asserts.js.map +1 -1
- package/build/lib/config/index.d.ts +2 -21
- package/build/lib/config/index.js +84 -80
- package/build/lib/config/index.js.map +1 -1
- package/build/lib/constants/browser.d.ts +2 -2
- package/build/lib/constants/browser.js +6 -3
- package/build/lib/constants/browser.js.map +1 -1
- package/build/lib/constants/database.d.ts +32 -25
- package/build/lib/constants/database.js +29 -30
- package/build/lib/constants/database.js.map +1 -1
- package/build/lib/constants/defaults.d.ts +3 -18
- package/build/lib/constants/defaults.js +25 -21
- package/build/lib/constants/defaults.js.map +1 -1
- package/build/lib/constants/diff-modes.d.ts +41 -53
- package/build/lib/constants/diff-modes.js +3 -1
- package/build/lib/constants/diff-modes.js.map +1 -1
- package/build/lib/constants/index.d.ts +9 -0
- package/build/lib/constants/index.js +26 -0
- package/build/lib/constants/index.js.map +1 -0
- package/build/lib/constants/paths.d.ts +2 -2
- package/build/lib/constants/paths.js +5 -5
- package/build/lib/constants/paths.js.map +1 -1
- package/build/lib/constants/plugin-events.d.ts +5 -5
- package/build/lib/constants/plugin-events.js +9 -9
- package/build/lib/constants/plugin-events.js.map +1 -1
- package/build/lib/constants/save-formats.d.ts +3 -1
- package/build/lib/constants/save-formats.js +7 -4
- package/build/lib/constants/save-formats.js.map +1 -1
- package/build/lib/constants/test-statuses.d.ts +18 -8
- package/build/lib/constants/test-statuses.js +22 -11
- package/build/lib/constants/test-statuses.js.map +1 -1
- package/build/lib/constants/view-modes.d.ts +7 -5
- package/build/lib/constants/view-modes.js +11 -8
- package/build/lib/constants/view-modes.js.map +1 -1
- package/build/lib/db-utils/client.d.ts +6 -19
- package/build/lib/db-utils/client.js +1 -0
- package/build/lib/db-utils/client.js.map +1 -1
- package/build/lib/db-utils/common.d.ts +28 -10
- package/build/lib/db-utils/common.js +29 -20
- package/build/lib/db-utils/common.js.map +1 -1
- package/build/lib/db-utils/server.d.ts +6 -16
- package/build/lib/db-utils/server.js +73 -44
- package/build/lib/db-utils/server.js.map +1 -1
- package/build/lib/errors/db-not-initialized-error.d.ts +3 -0
- package/build/lib/errors/db-not-initialized-error.js +10 -0
- package/build/lib/errors/db-not-initialized-error.js.map +1 -0
- package/build/lib/gui/app.d.ts +32 -30
- package/build/lib/gui/index.js +26 -2
- package/build/lib/gui/index.js.map +1 -1
- package/build/lib/gui/tool-runner/index.d.ts +46 -60
- package/build/lib/gui/tool-runner/report-subscriber.js +2 -2
- package/build/lib/gui/tool-runner/report-subscriber.js.map +1 -1
- package/build/lib/local-images-saver.d.ts +2 -4
- package/build/lib/local-images-saver.js +6 -4
- package/build/lib/local-images-saver.js.map +1 -1
- package/build/lib/plugin-adapter.d.ts +14 -29
- package/build/lib/plugin-adapter.js +44 -15
- package/build/lib/plugin-adapter.js.map +1 -1
- package/build/lib/plugin-api.d.ts +31 -55
- package/build/lib/plugin-api.js +20 -12
- package/build/lib/plugin-api.js.map +1 -1
- package/build/lib/plugin-utils.d.ts +2 -3
- package/build/lib/plugin-utils.js +7 -4
- package/build/lib/plugin-utils.js.map +1 -1
- package/build/lib/report-builder/gui.d.ts +49 -34
- package/build/lib/report-builder/gui.js +1 -1
- package/build/lib/report-builder/gui.js.map +1 -1
- package/build/lib/report-builder/static.d.ts +31 -28
- package/build/lib/report-builder/static.js +47 -42
- package/build/lib/report-builder/static.js.map +1 -1
- package/build/lib/reporter-helpers.d.ts +2 -2
- package/build/lib/reporter-helpers.js +4 -4
- package/build/lib/reporter-helpers.js.map +1 -1
- package/build/lib/server-utils.d.ts +57 -40
- package/build/lib/server-utils.js +100 -102
- package/build/lib/server-utils.js.map +1 -1
- package/build/lib/sqlite-adapter.d.ts +66 -76
- package/build/lib/sqlite-adapter.js +59 -58
- package/build/lib/sqlite-adapter.js.map +1 -1
- package/build/lib/static/gui.min.css +1 -1
- package/build/lib/static/gui.min.js +16 -16
- package/build/lib/static/modules/utils.js +5 -5
- package/build/lib/static/modules/utils.js.map +1 -1
- package/build/lib/static/report.min.css +1 -1
- package/build/lib/static/report.min.js +16 -16
- package/build/lib/suite-adapter.d.ts +14 -13
- package/build/lib/suite-adapter.js +24 -19
- package/build/lib/suite-adapter.js.map +1 -1
- package/build/lib/test-adapter.d.ts +75 -109
- package/build/lib/test-adapter.js +105 -69
- package/build/lib/test-adapter.js.map +1 -1
- package/build/lib/tests-tree-builder/base.d.ts +81 -64
- package/build/lib/tests-tree-builder/base.js +22 -16
- package/build/lib/tests-tree-builder/base.js.map +1 -1
- package/build/lib/tests-tree-builder/gui.d.ts +35 -13
- package/build/lib/tests-tree-builder/gui.js +1 -1
- package/build/lib/tests-tree-builder/gui.js.map +1 -1
- package/build/lib/tests-tree-builder/static.d.ts +45 -51
- package/build/lib/tests-tree-builder/static.js +33 -30
- package/build/lib/tests-tree-builder/static.js.map +1 -1
- package/build/lib/types.d.ts +195 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/build/lib/workers/create-workers.d.ts +14 -2
- package/build/lib/workers/create-workers.js +5 -2
- package/build/lib/workers/create-workers.js.map +1 -1
- package/build/lib/workers/worker.d.ts +2 -1
- package/build/lib/workers/worker.js +11 -11
- package/build/lib/workers/worker.js.map +1 -1
- package/build/package.json +11 -4
- package/package.json +11 -4
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
exports.StaticReportBuilder = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const sqlite_adapter_1 = require("../sqlite-adapter");
|
|
12
|
+
const test_adapter_1 = require("../test-adapter");
|
|
13
|
+
const utils_1 = require("../static/modules/utils");
|
|
14
|
+
const server_utils_1 = require("../server-utils");
|
|
15
|
+
const ignoredStatuses = [constants_1.RUNNING, constants_1.IDLE];
|
|
16
|
+
class StaticReportBuilder {
|
|
17
|
+
static create(hermione, pluginConfig, options) {
|
|
18
|
+
return new this(hermione, pluginConfig, options);
|
|
15
19
|
}
|
|
16
20
|
constructor(hermione, pluginConfig, { reuse = false } = {}) {
|
|
17
21
|
this._hermione = hermione;
|
|
18
22
|
this._pluginConfig = pluginConfig;
|
|
19
|
-
this._sqliteAdapter = SqliteAdapter.create({
|
|
23
|
+
this._sqliteAdapter = sqlite_adapter_1.SqliteAdapter.create({
|
|
20
24
|
hermione: this._hermione,
|
|
21
25
|
reportPath: this._pluginConfig.path,
|
|
22
26
|
reuse
|
|
@@ -27,9 +31,9 @@ module.exports = class StaticReportBuilder {
|
|
|
27
31
|
}
|
|
28
32
|
format(result, status) {
|
|
29
33
|
result.timestamp = Date.now();
|
|
30
|
-
return result instanceof TestAdapter
|
|
34
|
+
return result instanceof test_adapter_1.TestAdapter
|
|
31
35
|
? result
|
|
32
|
-
: TestAdapter.create(result, {
|
|
36
|
+
: test_adapter_1.TestAdapter.create(result, {
|
|
33
37
|
hermione: this._hermione,
|
|
34
38
|
sqliteAdapter: this._sqliteAdapter,
|
|
35
39
|
status
|
|
@@ -38,28 +42,28 @@ module.exports = class StaticReportBuilder {
|
|
|
38
42
|
async saveStaticFiles() {
|
|
39
43
|
const destPath = this._pluginConfig.path;
|
|
40
44
|
await Promise.all([
|
|
41
|
-
saveStaticFilesToReportDir(this._hermione, this._pluginConfig, destPath),
|
|
42
|
-
writeDatabaseUrlsFile(destPath, [LOCAL_DATABASE_NAME])
|
|
45
|
+
(0, server_utils_1.saveStaticFilesToReportDir)(this._hermione, this._pluginConfig, destPath),
|
|
46
|
+
(0, server_utils_1.writeDatabaseUrlsFile)(destPath, [constants_1.LOCAL_DATABASE_NAME])
|
|
43
47
|
]);
|
|
44
48
|
}
|
|
45
49
|
addSkipped(result) {
|
|
46
|
-
const formattedResult = this.format(result);
|
|
50
|
+
const formattedResult = this.format(result, constants_1.SKIPPED);
|
|
47
51
|
return this._addTestResult(formattedResult, {
|
|
48
|
-
status: SKIPPED,
|
|
52
|
+
status: constants_1.SKIPPED,
|
|
49
53
|
skipReason: formattedResult.suite.skipComment
|
|
50
54
|
});
|
|
51
55
|
}
|
|
52
56
|
addSuccess(result) {
|
|
53
|
-
return this._addTestResult(this.format(result), { status: SUCCESS });
|
|
57
|
+
return this._addTestResult(this.format(result, constants_1.SUCCESS), { status: constants_1.SUCCESS });
|
|
54
58
|
}
|
|
55
59
|
addFail(result) {
|
|
56
|
-
return this._addFailResult(this.format(result));
|
|
60
|
+
return this._addFailResult(this.format(result, constants_1.FAIL));
|
|
57
61
|
}
|
|
58
62
|
addError(result) {
|
|
59
|
-
return this._addErrorResult(this.format(result));
|
|
63
|
+
return this._addErrorResult(this.format(result, constants_1.ERROR));
|
|
60
64
|
}
|
|
61
65
|
addRetry(result) {
|
|
62
|
-
const formattedResult = this.format(result);
|
|
66
|
+
const formattedResult = this.format(result, constants_1.FAIL);
|
|
63
67
|
if (formattedResult.hasDiff()) {
|
|
64
68
|
return this._addFailResult(formattedResult);
|
|
65
69
|
}
|
|
@@ -68,18 +72,18 @@ module.exports = class StaticReportBuilder {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
_addFailResult(formattedResult) {
|
|
71
|
-
return this._addTestResult(formattedResult, { status: FAIL });
|
|
75
|
+
return this._addTestResult(formattedResult, { status: constants_1.FAIL });
|
|
72
76
|
}
|
|
73
77
|
_addErrorResult(formattedResult) {
|
|
74
|
-
return this._addTestResult(formattedResult, { status: ERROR, error: formattedResult.error });
|
|
78
|
+
return this._addTestResult(formattedResult, { status: constants_1.ERROR, error: formattedResult.error });
|
|
75
79
|
}
|
|
76
80
|
_addTestResult(formattedResult, props) {
|
|
77
|
-
formattedResult.image = hasImage(formattedResult);
|
|
78
|
-
const testResult = this._createTestResult(formattedResult,
|
|
81
|
+
formattedResult.image = (0, server_utils_1.hasImage)(formattedResult);
|
|
82
|
+
const testResult = this._createTestResult(formattedResult, lodash_1.default.extend(props, {
|
|
79
83
|
timestamp: formattedResult.timestamp
|
|
80
84
|
}));
|
|
81
|
-
if (hasNoRefImageErrors(formattedResult)) {
|
|
82
|
-
testResult.status = FAIL;
|
|
85
|
+
if ((0, utils_1.hasNoRefImageErrors)(formattedResult)) {
|
|
86
|
+
testResult.status = constants_1.FAIL;
|
|
83
87
|
}
|
|
84
88
|
if (!ignoredStatuses.includes(testResult.status)) {
|
|
85
89
|
this._writeTestResultToDb(testResult, formattedResult);
|
|
@@ -87,16 +91,16 @@ module.exports = class StaticReportBuilder {
|
|
|
87
91
|
return formattedResult;
|
|
88
92
|
}
|
|
89
93
|
_createTestResult(result, props) {
|
|
90
|
-
const { browserId, suite, sessionId, description, history, imagesInfo, screenshot, multipleTabs, errorDetails } = result;
|
|
94
|
+
const { browserId, suite, sessionId, description, history, imagesInfo = [], screenshot, multipleTabs, errorDetails } = result;
|
|
91
95
|
const { baseHost, saveErrorDetails } = this._pluginConfig;
|
|
92
|
-
const suiteUrl = suite.getUrl({
|
|
93
|
-
const metaInfo =
|
|
96
|
+
const suiteUrl = suite.getUrl({ baseHost });
|
|
97
|
+
const metaInfo = lodash_1.default.merge(lodash_1.default.cloneDeep(result.meta), { url: suite.fullUrl, file: suite.file, sessionId });
|
|
94
98
|
const testResult = Object.assign({
|
|
95
99
|
suiteUrl, name: browserId, metaInfo, description, history,
|
|
96
100
|
imagesInfo, screenshot: Boolean(screenshot), multipleTabs
|
|
97
101
|
}, props);
|
|
98
102
|
if (saveErrorDetails && errorDetails) {
|
|
99
|
-
testResult.errorDetails =
|
|
103
|
+
testResult.errorDetails = lodash_1.default.pick(errorDetails, ['title', 'filePath']);
|
|
100
104
|
}
|
|
101
105
|
return testResult;
|
|
102
106
|
}
|
|
@@ -106,19 +110,20 @@ module.exports = class StaticReportBuilder {
|
|
|
106
110
|
const suitePath = suite.path.concat(suiteName);
|
|
107
111
|
this._sqliteAdapter.write({ testResult, suitePath, suiteName });
|
|
108
112
|
}
|
|
109
|
-
_deleteTestResultFromDb(
|
|
110
|
-
this._sqliteAdapter.delete(
|
|
113
|
+
_deleteTestResultFromDb(...args) {
|
|
114
|
+
this._sqliteAdapter.delete(...args);
|
|
111
115
|
}
|
|
112
116
|
async finalize() {
|
|
113
117
|
this._sqliteAdapter.close();
|
|
114
118
|
const reportsSaver = this._hermione.htmlReporter.reportsSaver;
|
|
115
119
|
if (reportsSaver) {
|
|
116
120
|
const reportDir = this._pluginConfig.path;
|
|
117
|
-
const src =
|
|
118
|
-
const dbPath = await reportsSaver.saveReportData(src, { destPath: LOCAL_DATABASE_NAME, reportDir: reportDir });
|
|
119
|
-
await writeDatabaseUrlsFile(reportDir, [dbPath]);
|
|
120
|
-
await
|
|
121
|
+
const src = path_1.default.join(reportDir, constants_1.LOCAL_DATABASE_NAME);
|
|
122
|
+
const dbPath = await reportsSaver.saveReportData(src, { destPath: constants_1.LOCAL_DATABASE_NAME, reportDir: reportDir });
|
|
123
|
+
await (0, server_utils_1.writeDatabaseUrlsFile)(reportDir, [dbPath]);
|
|
124
|
+
await fs_extra_1.default.remove(src);
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
|
-
}
|
|
127
|
+
}
|
|
128
|
+
exports.StaticReportBuilder = StaticReportBuilder;
|
|
124
129
|
//# sourceMappingURL=static.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../../lib/report-builder/static.
|
|
1
|
+
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../../lib/report-builder/static.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,gDAAwB;AACxB,wDAA0B;AAG1B,4CAA2G;AAC3G,sDAAoE;AACpE,kDAA4C;AAC5C,mDAA4D;AAC5D,kDAA4F;AAG5F,MAAM,eAAe,GAAG,CAAC,mBAAO,EAAE,gBAAI,CAAC,CAAC;AAMxC,MAAa,mBAAmB;IAK5B,MAAM,CAAC,MAAM,CAET,QAAoC,EACpC,YAA4B,EAC5B,OAA6C;QAE7C,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,QAAoC,EAAE,YAA4B,EAAE,EAAC,KAAK,GAAG,KAAK,KAAyC,EAAE;QACrI,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAElC,IAAI,CAAC,cAAc,GAAG,8BAAa,CAAC,MAAM,CAAC;YACvC,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,UAAU,EAAE,IAAI,CAAC,aAAa,C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,IAAI,CAAC;QAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAE/C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC,CAAC;IAClE,CAAC;IAED,uBAAuB,CAAC,GAAG,IAAmD;QAC1E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAE5B,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC;QAE9D,IAAI,YAAY,EAAE;YACd,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC1C,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,+BAAmB,CAAC,CAAC;YACtD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,CAAC,GAAG,EAAE,EAAC,QAAQ,EAAE,+BAAmB,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC,CAAC;YAC7G,MAAM,IAAA,oCAAqB,EAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;YACjD,MAAM,kBAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACxB;IACL,CAAC;CACJ;AA1JD,kDA0JC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export function updateReferenceImage(testResult: any, reportPath: any, stateName: any): Promise<any>;
|
|
2
|
-
export function revertReferenceImage(testResult: any, stateName: any):
|
|
3
|
-
export function removeReferenceImage(testResult: any, stateName: any): Promise<
|
|
2
|
+
export function revertReferenceImage(testResult: any, stateName: any): Promise<void>;
|
|
3
|
+
export function removeReferenceImage(testResult: any, stateName: any): Promise<void>;
|
|
@@ -6,11 +6,11 @@ const { getShortMD5 } = require('./common-utils');
|
|
|
6
6
|
const utils = require('./server-utils');
|
|
7
7
|
const mkReferenceId = (testId, stateName) => getShortMD5(`${testId}#${stateName}`);
|
|
8
8
|
exports.updateReferenceImage = async (testResult, reportPath, stateName) => {
|
|
9
|
-
const currImg = testResult.getCurrImg(stateName);
|
|
9
|
+
const currImg = testResult.getCurrImg(stateName) ?? {};
|
|
10
10
|
const src = currImg.path
|
|
11
11
|
? path.resolve(reportPath, currImg.path)
|
|
12
12
|
: utils.getCurrentAbsolutePath(testResult, reportPath, stateName);
|
|
13
|
-
const referencePath = testResult.getRefImg(stateName)
|
|
13
|
+
const referencePath = testResult.getRefImg(stateName)?.path;
|
|
14
14
|
if (utils.fileExists(referencePath)) {
|
|
15
15
|
const referenceId = mkReferenceId(testResult.id, stateName);
|
|
16
16
|
const oldReferencePath = path.resolve(tmp.tmpdir, referenceId);
|
|
@@ -24,10 +24,10 @@ exports.updateReferenceImage = async (testResult, reportPath, stateName) => {
|
|
|
24
24
|
exports.revertReferenceImage = (testResult, stateName) => {
|
|
25
25
|
const referenceId = mkReferenceId(testResult.id, stateName);
|
|
26
26
|
const oldReferencePath = path.resolve(tmp.tmpdir, referenceId);
|
|
27
|
-
const referencePath = testResult.getRefImg(stateName)
|
|
27
|
+
const referencePath = testResult.getRefImg(stateName)?.path;
|
|
28
28
|
return utils.copyFileAsync(oldReferencePath, referencePath);
|
|
29
29
|
};
|
|
30
30
|
exports.removeReferenceImage = (testResult, stateName) => {
|
|
31
|
-
return utils.deleteFile(testResult.getRefImg(stateName)
|
|
31
|
+
return utils.deleteFile(testResult.getRefImg(stateName)?.path);
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=reporter-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter-helpers.js","sourceRoot":"","sources":["../../lib/reporter-helpers.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CA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G,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE;IACrD,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;AACnE,CAAC,CAAC"}
|
|
@@ -1,42 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}): any;
|
|
1
|
+
import { TestStatus } from './constants';
|
|
2
|
+
import type { HtmlReporter } from './plugin-api';
|
|
3
|
+
import type { TestAdapter } from './test-adapter';
|
|
4
|
+
import { HtmlReporterApi, ReporterConfig } from './types';
|
|
5
|
+
import type Hermione from 'hermione';
|
|
6
|
+
export declare const getReferencePath: (testResult: TestAdapter, stateName?: string) => string;
|
|
7
|
+
export declare const getCurrentPath: (testResult: TestAdapter, stateName?: string) => string;
|
|
8
|
+
export declare const getDiffPath: (testResult: TestAdapter, stateName?: string) => string;
|
|
9
|
+
export declare const getReferenceAbsolutePath: (testResult: TestAdapter, reportDir: string, stateName: string) => string;
|
|
10
|
+
export declare const getCurrentAbsolutePath: (testResult: TestAdapter, reportDir: string, stateName: string) => string;
|
|
11
|
+
export declare const getDiffAbsolutePath: (testResult: TestAdapter, reportDir: string, stateName: string) => string;
|
|
13
12
|
/**
|
|
14
|
-
* @param {String}
|
|
15
|
-
* @
|
|
13
|
+
* @param {String} kind - одно из значений 'ref', 'current', 'diff'
|
|
14
|
+
* @param {TestAdapter} result
|
|
15
|
+
* @param {String} stateName - имя стэйта для теста
|
|
16
|
+
* @returns {String}
|
|
16
17
|
*/
|
|
17
|
-
export function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export function
|
|
23
|
-
export function
|
|
24
|
-
export function
|
|
25
|
-
export function
|
|
26
|
-
export function
|
|
27
|
-
export function
|
|
28
|
-
export function
|
|
29
|
-
export function
|
|
30
|
-
export function
|
|
31
|
-
export function
|
|
32
|
-
export function
|
|
33
|
-
export function
|
|
34
|
-
export function
|
|
35
|
-
export function
|
|
36
|
-
export function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
export declare function createPath(kind: string, result: TestAdapter, stateName?: string): string;
|
|
19
|
+
export interface CopyFileAsyncOptions {
|
|
20
|
+
reportDir: string;
|
|
21
|
+
overwrite: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function copyFileAsync(srcPath: string, destPath: string, { reportDir, overwrite }?: Partial<CopyFileAsyncOptions>): Promise<void>;
|
|
24
|
+
export declare function deleteFile(filePath: string): Promise<void>;
|
|
25
|
+
export declare function makeDirFor(destPath: string): Promise<void>;
|
|
26
|
+
export declare function fileExists(path: string): boolean;
|
|
27
|
+
export declare function logPathToHtmlReport(pluginConfig: ReporterConfig): void;
|
|
28
|
+
export declare function logError(e: Error): void;
|
|
29
|
+
export declare function hasImage(formattedResult: TestAdapter): boolean;
|
|
30
|
+
export declare function prepareCommonJSData(data: unknown): string;
|
|
31
|
+
export declare function shouldUpdateAttempt(status: TestStatus): boolean;
|
|
32
|
+
export declare function getDetailsFileName(testId: string, browserId: string, attempt: number): string;
|
|
33
|
+
export declare function saveStaticFilesToReportDir(hermione: Hermione & HtmlReporterApi, pluginConfig: ReporterConfig, destPath: string): Promise<void>;
|
|
34
|
+
export declare function copyPlugins({ plugins, pluginsEnabled }: ReporterConfig, destPath: string): Promise<void>;
|
|
35
|
+
export declare function copyPlugin(pluginName: string, pluginsPath: string): Promise<void>;
|
|
36
|
+
export declare function urlPathNameEndsWith(currentUrl: string, searchString: string): boolean;
|
|
37
|
+
export declare function writeDatabaseUrlsFile(destPath: string, srcPaths: string[]): Promise<void>;
|
|
38
|
+
export declare function copyToReportDir(destPath: string, files: string[], sourceDirectory: string): Promise<void[]>;
|
|
39
|
+
export type ConfigForStaticFile = Pick<ReporterConfig, 'defaultView' | 'diffMode' | 'baseHost' | 'errorPatterns' | 'metaInfoBaseUrls' | 'customScripts' | 'yandexMetrika' | 'pluginsEnabled' | 'plugins'>;
|
|
40
|
+
export declare function getConfigForStaticFile(pluginConfig: ReporterConfig): ConfigForStaticFile;
|
|
41
|
+
export interface DataForStaticFile {
|
|
42
|
+
skips: object[];
|
|
43
|
+
config: ConfigForStaticFile;
|
|
44
|
+
apiValues: HtmlReporter['values'];
|
|
45
|
+
date: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function getDataForStaticFile(hermione: Hermione & HtmlReporterApi, pluginConfig: ReporterConfig): DataForStaticFile;
|
|
48
|
+
export declare function initializeCustomGui(hermione: Hermione, { customGui }: ReporterConfig): Promise<void>;
|
|
49
|
+
export interface CustomGuiActionPayload {
|
|
50
|
+
sectionName: string;
|
|
51
|
+
groupIndex: number;
|
|
52
|
+
controlIndex: number;
|
|
53
|
+
}
|
|
54
|
+
export declare function runCustomGuiAction(hermione: Hermione, { customGui }: ReporterConfig, payload: CustomGuiActionPayload): Promise<void>;
|
|
55
|
+
export declare function getPluginClientScriptPath(pluginName: string): string | null;
|
|
56
|
+
export declare function getPluginMiddleware(pluginName: string): unknown | null;
|
|
57
|
+
export declare function isUnexpectedPlugin(plugins: ReporterConfig['plugins'], pluginName: string): boolean;
|
|
58
|
+
export declare function forEachPlugin(plugins: ReporterConfig['plugins'], callback: (name: string) => void): void;
|
|
59
|
+
export declare function mapPlugins<T>(plugins: ReporterConfig['plugins'], callback: (name: string) => T): T[];
|