html-reporter 9.11.0 → 9.11.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.js +9 -5
- package/build/hermione.js.map +1 -1
- package/build/lib/common-utils.d.ts +10 -0
- package/build/lib/common-utils.js +50 -1
- package/build/lib/common-utils.js.map +1 -1
- package/build/lib/constants/performance-marks.d.ts +9 -0
- package/build/lib/constants/performance-marks.js +11 -0
- package/build/lib/constants/performance-marks.js.map +1 -0
- package/build/lib/constants/plugin-events.d.ts +2 -1
- package/build/lib/constants/plugin-events.js +1 -0
- package/build/lib/constants/plugin-events.js.map +1 -1
- package/build/lib/csv-adapter.d.ts +68 -0
- package/build/lib/csv-adapter.js +154 -0
- package/build/lib/csv-adapter.js.map +1 -0
- package/build/lib/db-utils/server.d.ts +3 -0
- package/build/lib/db-utils/server.js +11 -1
- package/build/lib/db-utils/server.js.map +1 -1
- package/build/lib/errors/index.d.ts +28 -0
- package/build/lib/errors/index.js +8 -0
- package/build/lib/errors/index.js.map +1 -0
- package/build/lib/gui/tool-runner/index.js +9 -8
- package/build/lib/gui/tool-runner/index.js.map +1 -1
- package/build/lib/gui/tool-runner/report-subscriber.js +19 -15
- package/build/lib/gui/tool-runner/report-subscriber.js.map +1 -1
- package/build/lib/image-cache.d.ts +3 -0
- package/build/lib/image-cache.js +7 -0
- package/build/lib/image-cache.js.map +1 -0
- package/build/lib/image-handler.d.ts +33 -0
- package/build/lib/image-handler.js +248 -0
- package/build/lib/image-handler.js.map +1 -0
- package/build/lib/image-store.d.ts +11 -0
- package/build/lib/image-store.js +24 -0
- package/build/lib/image-store.js.map +1 -0
- package/build/lib/plugin-adapter.js +1 -1
- package/build/lib/plugin-adapter.js.map +1 -1
- package/build/lib/plugin-api.js +1 -0
- package/build/lib/plugin-api.js.map +1 -1
- package/build/lib/plugin-utils.d.ts +2 -2
- package/build/lib/plugin-utils.js +3 -0
- package/build/lib/plugin-utils.js.map +1 -1
- package/build/lib/report-builder/gui.js +5 -9
- package/build/lib/report-builder/gui.js.map +1 -1
- package/build/lib/report-builder/static.d.ts +21 -19
- package/build/lib/report-builder/static.js +37 -36
- package/build/lib/report-builder/static.js.map +1 -1
- package/build/lib/reporter-helpers.js +5 -4
- package/build/lib/reporter-helpers.js.map +1 -1
- package/build/lib/server-utils.d.ts +28 -18
- package/build/lib/server-utils.js +30 -23
- package/build/lib/server-utils.js.map +1 -1
- package/build/lib/sqlite-adapter.d.ts +5 -5
- package/build/lib/sqlite-adapter.js +3 -3
- package/build/lib/sqlite-adapter.js.map +1 -1
- package/build/lib/static/gui.min.js +15 -15
- package/build/lib/static/gui.min.js.gz +0 -0
- package/build/lib/static/report.min.js +15 -15
- package/build/lib/static/report.min.js.gz +0 -0
- package/build/lib/test-adapter/cache/hermione.d.ts +1 -0
- package/build/lib/test-adapter/cache/hermione.js +5 -0
- package/build/lib/test-adapter/cache/hermione.js.map +1 -0
- package/build/lib/test-adapter/hermione.d.ts +50 -0
- package/build/lib/test-adapter/hermione.js +183 -0
- package/build/lib/test-adapter/hermione.js.map +1 -0
- package/build/lib/test-adapter/index.d.ts +31 -0
- package/build/lib/test-adapter/index.js +18 -0
- package/build/lib/test-adapter/index.js.map +1 -0
- package/build/lib/test-adapter.d.ts +9 -33
- package/build/lib/test-adapter.js +12 -235
- package/build/lib/test-adapter.js.map +1 -1
- package/build/lib/tests-tree-builder/base.d.ts +2 -2
- package/build/lib/tests-tree-builder/base.js.map +1 -1
- package/build/lib/types.d.ts +19 -40
- package/build/lib/workers/create-workers.d.ts +1 -1
- package/build/lib/workers/worker.d.ts +1 -1
- package/build/package.json +6 -3
- package/package.json +6 -3
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const testsAttempts: Map<string, number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermione.js","sourceRoot":"","sources":["../../../../lib/test-adapter/cache/hermione.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAwB,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TestStatus } from '../constants';
|
|
2
|
+
import { AssertViewResult, ErrorDetails, ImageBase64, ImageInfoFull, HermioneTestResult, TestError } from '../types';
|
|
3
|
+
import { ImagesInfoFormatter } from '../image-handler';
|
|
4
|
+
import { ReporterTestResult } from './index';
|
|
5
|
+
export interface HermioneTestAdapterOptions {
|
|
6
|
+
status: TestStatus;
|
|
7
|
+
imagesInfoFormatter: ImagesInfoFormatter;
|
|
8
|
+
}
|
|
9
|
+
export declare class HermioneTestAdapter implements ReporterTestResult {
|
|
10
|
+
private _imagesInfoFormatter;
|
|
11
|
+
private _testResult;
|
|
12
|
+
private _testId;
|
|
13
|
+
private _errorDetails;
|
|
14
|
+
private _timestamp;
|
|
15
|
+
private _attempt;
|
|
16
|
+
private _status;
|
|
17
|
+
static create<T extends HermioneTestAdapter>(this: new (testResult: HermioneTestResult, options: HermioneTestAdapterOptions) => T, testResult: HermioneTestResult, options: HermioneTestAdapterOptions): T;
|
|
18
|
+
constructor(testResult: HermioneTestResult, { status, imagesInfoFormatter }: HermioneTestAdapterOptions);
|
|
19
|
+
image?: boolean;
|
|
20
|
+
get fullName(): string;
|
|
21
|
+
get skipReason(): string;
|
|
22
|
+
get status(): TestStatus;
|
|
23
|
+
get sessionId(): string;
|
|
24
|
+
get browserId(): string;
|
|
25
|
+
get imagesInfo(): ImageInfoFull[] | undefined;
|
|
26
|
+
get origAttempt(): number | undefined;
|
|
27
|
+
get attempt(): number;
|
|
28
|
+
set attempt(attemptNum: number);
|
|
29
|
+
get assertViewResults(): AssertViewResult[];
|
|
30
|
+
get history(): string[];
|
|
31
|
+
get error(): undefined | TestError;
|
|
32
|
+
get imageDir(): string;
|
|
33
|
+
get state(): {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
get testPath(): string[];
|
|
37
|
+
get id(): string;
|
|
38
|
+
get isUpdated(): boolean | undefined;
|
|
39
|
+
get screenshot(): ImageBase64 | undefined;
|
|
40
|
+
get description(): string | undefined;
|
|
41
|
+
get meta(): Record<string, unknown>;
|
|
42
|
+
get errorDetails(): ErrorDetails | null;
|
|
43
|
+
get file(): string;
|
|
44
|
+
get url(): string | undefined;
|
|
45
|
+
get multipleTabs(): boolean;
|
|
46
|
+
get timestamp(): number | undefined;
|
|
47
|
+
set timestamp(timestamp: number | undefined);
|
|
48
|
+
saveErrorDetails(reportPath: string): Promise<void>;
|
|
49
|
+
decreaseAttemptNumber(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.HermioneTestAdapter = void 0;
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const history_utils_1 = require("../history-utils");
|
|
34
|
+
const constants_1 = require("../constants");
|
|
35
|
+
const common_utils_1 = require("../common-utils");
|
|
36
|
+
const utils = __importStar(require("../server-utils"));
|
|
37
|
+
const plugin_utils_1 = require("../plugin-utils");
|
|
38
|
+
const hermione_1 = require("./cache/hermione");
|
|
39
|
+
const getSkipComment = (suite) => {
|
|
40
|
+
return suite.skipReason || suite.parent && getSkipComment(suite.parent);
|
|
41
|
+
};
|
|
42
|
+
const wrapSkipComment = (skipComment) => {
|
|
43
|
+
return skipComment ? (0, common_utils_1.wrapLinkByTag)(skipComment) : 'Unknown reason';
|
|
44
|
+
};
|
|
45
|
+
class HermioneTestAdapter {
|
|
46
|
+
static create(testResult, options) {
|
|
47
|
+
return new this(testResult, options);
|
|
48
|
+
}
|
|
49
|
+
constructor(testResult, { status, imagesInfoFormatter }) {
|
|
50
|
+
this._imagesInfoFormatter = imagesInfoFormatter;
|
|
51
|
+
this._testResult = testResult;
|
|
52
|
+
this._testId = (0, common_utils_1.mkTestId)(testResult.fullTitle(), testResult.browserId);
|
|
53
|
+
this._errorDetails = null;
|
|
54
|
+
this._timestamp = this._testResult.timestamp;
|
|
55
|
+
this._status = status;
|
|
56
|
+
const browserVersion = lodash_1.default.get(this._testResult, 'meta.browserVersion', this._testResult.browserVersion);
|
|
57
|
+
lodash_1.default.set(this._testResult, 'meta.browserVersion', browserVersion);
|
|
58
|
+
if (utils.shouldUpdateAttempt(status)) {
|
|
59
|
+
hermione_1.testsAttempts.set(this._testId, lodash_1.default.isUndefined(hermione_1.testsAttempts.get(this._testId)) ? 0 : hermione_1.testsAttempts.get(this._testId) + 1);
|
|
60
|
+
}
|
|
61
|
+
this._attempt = hermione_1.testsAttempts.get(this._testId) || 0;
|
|
62
|
+
}
|
|
63
|
+
get fullName() {
|
|
64
|
+
return this._testResult.fullTitle();
|
|
65
|
+
}
|
|
66
|
+
get skipReason() {
|
|
67
|
+
return wrapSkipComment(getSkipComment(this._testResult));
|
|
68
|
+
}
|
|
69
|
+
get status() {
|
|
70
|
+
return this._status;
|
|
71
|
+
}
|
|
72
|
+
get sessionId() {
|
|
73
|
+
return this._testResult.sessionId || 'unknown session id';
|
|
74
|
+
}
|
|
75
|
+
get browserId() {
|
|
76
|
+
return this._testResult.browserId;
|
|
77
|
+
}
|
|
78
|
+
get imagesInfo() {
|
|
79
|
+
return this._imagesInfoFormatter.getImagesInfo(this);
|
|
80
|
+
}
|
|
81
|
+
get origAttempt() {
|
|
82
|
+
return this._testResult.origAttempt;
|
|
83
|
+
}
|
|
84
|
+
get attempt() {
|
|
85
|
+
return this._attempt;
|
|
86
|
+
}
|
|
87
|
+
set attempt(attemptNum) {
|
|
88
|
+
hermione_1.testsAttempts.set(this._testId, attemptNum);
|
|
89
|
+
this._attempt = attemptNum;
|
|
90
|
+
}
|
|
91
|
+
get assertViewResults() {
|
|
92
|
+
return this._testResult.assertViewResults || [];
|
|
93
|
+
}
|
|
94
|
+
get history() {
|
|
95
|
+
return (0, history_utils_1.getCommandsHistory)(this._testResult.history);
|
|
96
|
+
}
|
|
97
|
+
get error() {
|
|
98
|
+
return this._testResult.err;
|
|
99
|
+
}
|
|
100
|
+
get imageDir() {
|
|
101
|
+
// TODO: remove toString after publish major version
|
|
102
|
+
return this._testResult.id.toString();
|
|
103
|
+
}
|
|
104
|
+
get state() {
|
|
105
|
+
return { name: this._testResult.title };
|
|
106
|
+
}
|
|
107
|
+
get testPath() {
|
|
108
|
+
return (0, plugin_utils_1.getSuitePath)(this._testResult.parent).concat(this._testResult.title);
|
|
109
|
+
}
|
|
110
|
+
get id() {
|
|
111
|
+
return this.testPath.concat(this.browserId, this.attempt.toString()).join(' ');
|
|
112
|
+
}
|
|
113
|
+
get isUpdated() {
|
|
114
|
+
return this._testResult.updated;
|
|
115
|
+
}
|
|
116
|
+
get screenshot() {
|
|
117
|
+
return lodash_1.default.get(this._testResult, 'err.screenshot');
|
|
118
|
+
}
|
|
119
|
+
get description() {
|
|
120
|
+
return this._testResult.description;
|
|
121
|
+
}
|
|
122
|
+
get meta() {
|
|
123
|
+
return this._testResult.meta;
|
|
124
|
+
}
|
|
125
|
+
get errorDetails() {
|
|
126
|
+
if (!lodash_1.default.isNil(this._errorDetails)) {
|
|
127
|
+
return this._errorDetails;
|
|
128
|
+
}
|
|
129
|
+
const details = lodash_1.default.get(this._testResult, 'err.details', null);
|
|
130
|
+
if (details) {
|
|
131
|
+
this._errorDetails = {
|
|
132
|
+
title: details.title || 'error details',
|
|
133
|
+
data: details.data,
|
|
134
|
+
filePath: `${constants_1.ERROR_DETAILS_PATH}/${utils.getDetailsFileName(this._testResult.id, this._testResult.browserId, this.attempt)}`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this._errorDetails = null;
|
|
139
|
+
}
|
|
140
|
+
return this._errorDetails;
|
|
141
|
+
}
|
|
142
|
+
get file() {
|
|
143
|
+
return path_1.default.relative(process.cwd(), this._testResult.file);
|
|
144
|
+
}
|
|
145
|
+
get url() {
|
|
146
|
+
return this._testResult.meta.url;
|
|
147
|
+
}
|
|
148
|
+
get multipleTabs() {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
get timestamp() {
|
|
152
|
+
return this._timestamp;
|
|
153
|
+
}
|
|
154
|
+
set timestamp(timestamp) {
|
|
155
|
+
if (!lodash_1.default.isNumber(this._timestamp)) {
|
|
156
|
+
this._timestamp = timestamp;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async saveErrorDetails(reportPath) {
|
|
160
|
+
if (!this.errorDetails) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const detailsFilePath = path_1.default.resolve(reportPath, this.errorDetails.filePath);
|
|
164
|
+
const detailsData = lodash_1.default.isObject(this.errorDetails.data)
|
|
165
|
+
? JSON.stringify(this.errorDetails.data, null, 2)
|
|
166
|
+
: this.errorDetails.data;
|
|
167
|
+
await utils.makeDirFor(detailsFilePath);
|
|
168
|
+
await fs_extra_1.default.writeFile(detailsFilePath, detailsData);
|
|
169
|
+
}
|
|
170
|
+
decreaseAttemptNumber() {
|
|
171
|
+
const testId = (0, common_utils_1.mkTestId)(this._testResult.fullTitle(), this.browserId);
|
|
172
|
+
const currentTestAttempt = hermione_1.testsAttempts.get(testId);
|
|
173
|
+
const previousTestAttempt = currentTestAttempt - 1;
|
|
174
|
+
if (previousTestAttempt) {
|
|
175
|
+
hermione_1.testsAttempts.set(testId, previousTestAttempt);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
hermione_1.testsAttempts.delete(testId);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
exports.HermioneTestAdapter = HermioneTestAdapter;
|
|
183
|
+
//# sourceMappingURL=hermione.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermione.js","sourceRoot":"","sources":["../../../lib/test-adapter/hermione.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,wDAA0B;AAC1B,gDAAwB;AAExB,oDAAoD;AACpD,4CAA4D;AAC5D,kDAAwD;AACxD,uDAAyC;AAUzC,kDAA6C;AAC7C,+CAA+C;AAE/C,MAAM,cAAc,GAAG,CAAC,KAAyC,EAA6B,EAAE;IAC5F,OAAO,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,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,IAAI,CAAC;QAE7B,MAAM,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QACxC,MAAM,kBAAE,CAAC,SAAS,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,qBAAqB;QACjB,MAAM,MAAM,GAAG,IAAA,uBAAQ,EAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACtE,MAAM,kBAAkB,GAAG,wBAAa,CAAC,GAAG,CAAC,MAAM,CAAW,CAAC;QAC/D,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,CAAC,CAAC;QAEnD,IAAI,mBAAmB,EAAE;YACrB,wBAAa,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;SAClD;aAAM;YACH,wBAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAChC;IACL,CAAC;CACJ;AAzLD,kDAyLC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TestStatus } from '../constants';
|
|
2
|
+
import { AssertViewResult, ErrorDetails, ImageBase64, ImageInfoFull, TestError } from '../types';
|
|
3
|
+
export * from './hermione';
|
|
4
|
+
export interface ReporterTestResult {
|
|
5
|
+
readonly assertViewResults: AssertViewResult[];
|
|
6
|
+
attempt: number;
|
|
7
|
+
readonly browserId: string;
|
|
8
|
+
readonly description: string | undefined;
|
|
9
|
+
error: undefined | TestError;
|
|
10
|
+
readonly errorDetails: ErrorDetails | null;
|
|
11
|
+
readonly file: string;
|
|
12
|
+
readonly fullName: string;
|
|
13
|
+
readonly history: string[];
|
|
14
|
+
readonly id: string;
|
|
15
|
+
image?: boolean;
|
|
16
|
+
readonly imageDir: string;
|
|
17
|
+
readonly imagesInfo: ImageInfoFull[] | undefined;
|
|
18
|
+
readonly isUpdated?: boolean;
|
|
19
|
+
readonly meta: Record<string, unknown>;
|
|
20
|
+
readonly multipleTabs: boolean;
|
|
21
|
+
readonly screenshot: ImageBase64 | undefined;
|
|
22
|
+
readonly sessionId: string;
|
|
23
|
+
readonly skipReason?: string;
|
|
24
|
+
readonly state: {
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
readonly status: TestStatus;
|
|
28
|
+
readonly testPath: string[];
|
|
29
|
+
readonly timestamp: number | undefined;
|
|
30
|
+
readonly url?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hermione"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/test-adapter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,6CAA2B"}
|
|
@@ -1,55 +1,36 @@
|
|
|
1
|
-
import type { default as Hermione } from 'hermione';
|
|
2
1
|
import { SuiteAdapter } from './suite-adapter';
|
|
3
2
|
import { TestStatus } from './constants';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import type * as Workers from './workers/worker';
|
|
3
|
+
import { AssertViewResult, ErrorDetails, ImageBase64, ImageData, ImageInfoFull, TestResult } from './types';
|
|
4
|
+
import { ImagesInfoFormatter } from './image-handler';
|
|
7
5
|
interface PrepareTestResultData {
|
|
8
6
|
name: string;
|
|
9
7
|
suitePath: string[];
|
|
10
8
|
browserId: string;
|
|
11
9
|
}
|
|
12
10
|
export interface TestAdapterOptions {
|
|
13
|
-
hermione: Hermione & HtmlReporterApi;
|
|
14
|
-
sqliteAdapter: SqliteAdapter;
|
|
15
11
|
status: TestStatus;
|
|
12
|
+
imagesInfoFormatter: ImagesInfoFormatter;
|
|
16
13
|
}
|
|
17
14
|
export declare class TestAdapter {
|
|
15
|
+
private _imagesInfoFormatter;
|
|
18
16
|
private _testResult;
|
|
19
|
-
private _hermione;
|
|
20
|
-
private _sqliteAdapter;
|
|
21
|
-
private _errors;
|
|
22
17
|
private _suite;
|
|
23
|
-
private _imagesSaver;
|
|
24
18
|
private _testId;
|
|
25
19
|
private _errorDetails;
|
|
26
20
|
private _timestamp;
|
|
27
21
|
private _attempt;
|
|
28
|
-
static create<T extends TestAdapter>(this: new (testResult: TestResult, options: TestAdapterOptions) => T, testResult: TestResult,
|
|
29
|
-
constructor(testResult: TestResult, {
|
|
22
|
+
static create<T extends TestAdapter>(this: new (testResult: TestResult, options: TestAdapterOptions) => T, testResult: TestResult, options: TestAdapterOptions): T;
|
|
23
|
+
constructor(testResult: TestResult, { status, imagesInfoFormatter }: TestAdapterOptions);
|
|
30
24
|
image?: boolean;
|
|
31
25
|
get suite(): SuiteAdapter;
|
|
32
26
|
get sessionId(): string;
|
|
33
27
|
get browserId(): string;
|
|
34
28
|
get imagesInfo(): ImageInfoFull[] | undefined;
|
|
35
|
-
set imagesInfo(imagesInfo: ImageInfoFull[]);
|
|
36
|
-
protected _getImgFromStorage(imgPath: string): string;
|
|
37
|
-
protected _getLastImageInfoFromDb(stateName?: string): ImageInfo | undefined;
|
|
38
|
-
protected _getExpectedPath(stateName: string | undefined, status: TestStatus | undefined, cacheExpectedPaths: Map<string, string>): {
|
|
39
|
-
path: string;
|
|
40
|
-
reused: boolean;
|
|
41
|
-
};
|
|
42
|
-
getImagesFor(status: TestStatus, stateName?: string): ImageInfo | undefined;
|
|
43
|
-
protected _saveErrorScreenshot(reportPath: string): Promise<void>;
|
|
44
|
-
protected _saveImg(localPath: string | undefined, destPath: string, reportDir: string): Promise<string | undefined>;
|
|
45
29
|
get origAttempt(): number | undefined;
|
|
46
30
|
get attempt(): number;
|
|
47
31
|
set attempt(attemptNum: number);
|
|
48
32
|
hasDiff(): boolean;
|
|
49
33
|
get assertViewResults(): AssertViewResult[];
|
|
50
|
-
isImageDiffError(assertResult: AssertViewResult): boolean;
|
|
51
|
-
isNoRefImageError(assertResult: AssertViewResult): boolean;
|
|
52
|
-
getImagesInfo(): ImageInfoFull[];
|
|
53
34
|
get history(): string[];
|
|
54
35
|
get error(): undefined | {
|
|
55
36
|
message?: string;
|
|
@@ -66,19 +47,14 @@ export declare class TestAdapter {
|
|
|
66
47
|
get description(): string | undefined;
|
|
67
48
|
get meta(): Record<string, unknown>;
|
|
68
49
|
get errorDetails(): ErrorDetails | null;
|
|
69
|
-
getRefImg(stateName?: string): ImageData |
|
|
70
|
-
getCurrImg(stateName?: string): ImageData |
|
|
71
|
-
getErrImg(): ImageBase64 |
|
|
50
|
+
getRefImg(stateName?: string): ImageData | undefined;
|
|
51
|
+
getCurrImg(stateName?: string): ImageData | undefined;
|
|
52
|
+
getErrImg(): ImageBase64 | undefined;
|
|
72
53
|
prepareTestResult(): PrepareTestResultData;
|
|
73
54
|
get multipleTabs(): boolean;
|
|
74
55
|
get timestamp(): number;
|
|
75
56
|
set timestamp(timestamp: number);
|
|
76
57
|
saveErrorDetails(reportPath: string): Promise<void>;
|
|
77
|
-
saveTestImages(reportPath: string, workers: typeof Workers, cacheExpectedPaths?: Map<string, string>): Promise<unknown[]>;
|
|
78
|
-
updateCacheExpectedPath(stateName: string, expectedPath: string): void;
|
|
79
58
|
decreaseAttemptNumber(): void;
|
|
80
|
-
protected _mkTestId(): string;
|
|
81
|
-
protected _getExpectedKey(stateName?: string): string;
|
|
82
|
-
protected _saveDiffInWorker(imageDiffError: ImageDiffError, destPath: string, workers: typeof Workers, cacheDiffImages?: Map<string, string>): Promise<void>;
|
|
83
59
|
}
|
|
84
60
|
export {};
|