testit-adapter-playwright 4.0.3-TMS-5.7 → 4.0.4
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/dist/converter.js +1 -0
- package/dist/reporter.js +1 -3
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +14 -2
- package/package.json +2 -2
package/dist/converter.js
CHANGED
|
@@ -78,6 +78,7 @@ class Converter {
|
|
|
78
78
|
return {
|
|
79
79
|
title: step.title,
|
|
80
80
|
outcome: step.error || !(0, utils_1.isAllStepsWithPassedOutcome)(steps) ? Status.FAILED : Status.PASSED,
|
|
81
|
+
info: JSON.stringify(step.error),
|
|
81
82
|
steps: steps,
|
|
82
83
|
attachments: [...attachmentsMap.keys()].filter((attachmentId) => attachmentsMap.get(attachmentId) === step),
|
|
83
84
|
};
|
package/dist/reporter.js
CHANGED
|
@@ -228,9 +228,7 @@ class TmsReporter {
|
|
|
228
228
|
? result.steps
|
|
229
229
|
: [...this.stepsMap.keys()].filter((step) => this.stepsMap.get(step) === test);
|
|
230
230
|
const stepResults = converter_1.Converter.convertTestStepsToSteps(rawSteps, this.attachmentsMap);
|
|
231
|
-
|
|
232
|
-
result.status = "failed";
|
|
233
|
-
}
|
|
231
|
+
result.status = (0, utils_1.getTestStatus)(test);
|
|
234
232
|
autotest.steps = converter_1.Converter.convertTestStepsToShortSteps(rawSteps);
|
|
235
233
|
await this.strategy.loadAutotest(autotest, converter_1.Converter.convertStatus(result.status, test.expectedStatus));
|
|
236
234
|
const autotestResult = converter_1.Converter.convertAutotestPostToAutotestResult(autotestData, test, result);
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TestError, TestStep } from "@playwright/test/reporter";
|
|
1
|
+
import { TestCase, TestError, TestStatus, TestStep } from "@playwright/test/reporter";
|
|
2
2
|
import { Step } from "testit-js-commons";
|
|
3
3
|
import { ResultAttachment } from "./models/result";
|
|
4
4
|
export type StatusDetails = {
|
|
@@ -7,6 +7,7 @@ export type StatusDetails = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function getStatusDetails(error: TestError): StatusDetails;
|
|
9
9
|
export declare function isAllStepsWithPassedOutcome(steps: Step[]): boolean;
|
|
10
|
+
export declare function getTestStatus(test: TestCase): TestStatus;
|
|
10
11
|
export declare function isStep(step: TestStep): boolean;
|
|
11
12
|
export declare function stripAscii(str: string): string;
|
|
12
13
|
export declare const stepAttachRegexp: RegExp;
|
package/dist/utils.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.stepAttachRegexp = void 0;
|
|
4
4
|
exports.getStatusDetails = getStatusDetails;
|
|
5
5
|
exports.isAllStepsWithPassedOutcome = isAllStepsWithPassedOutcome;
|
|
6
|
+
exports.getTestStatus = getTestStatus;
|
|
6
7
|
exports.isStep = isStep;
|
|
7
8
|
exports.stripAscii = stripAscii;
|
|
8
9
|
exports.processAttachmentExtensions = processAttachmentExtensions;
|
|
9
10
|
exports.processAttachmentNameExtensions = processAttachmentNameExtensions;
|
|
10
|
-
const converter_1 = require("./converter");
|
|
11
11
|
const labels_1 = require("./labels");
|
|
12
12
|
function getStatusDetails(error) {
|
|
13
13
|
const message = error.message && stripAscii(error.message);
|
|
@@ -23,7 +23,19 @@ function getStatusDetails(error) {
|
|
|
23
23
|
}
|
|
24
24
|
;
|
|
25
25
|
function isAllStepsWithPassedOutcome(steps) {
|
|
26
|
-
return !steps.find((step) => step.
|
|
26
|
+
return !steps.find((step) => step.info !== undefined);
|
|
27
|
+
}
|
|
28
|
+
const statusMap = {
|
|
29
|
+
["expected"]: "passed",
|
|
30
|
+
["unexpected"]: "failed",
|
|
31
|
+
["flaky"]: "failed",
|
|
32
|
+
["skipped"]: "skipped",
|
|
33
|
+
};
|
|
34
|
+
function getTestStatus(test) {
|
|
35
|
+
if (!test.ok()) {
|
|
36
|
+
return "failed";
|
|
37
|
+
}
|
|
38
|
+
return statusMap[test.outcome()];
|
|
27
39
|
}
|
|
28
40
|
function isStep(step) {
|
|
29
41
|
return step.category === "test.step" && !step.title.match(exports.stepAttachRegexp);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testit-adapter-playwright",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Playwright adapter for Test IT",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prettier": "^3.0.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"testit-js-commons": "4.0.
|
|
43
|
+
"testit-js-commons": "4.0.4"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist"
|