testit-adapter-playwright 2.0.2 → 2.1.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/README.md +1 -1
- package/dist/reporter.d.ts +4 -2
- package/dist/reporter.js +14 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ test('All annotations', async () => {
|
|
|
124
124
|
|
|
125
125
|
testit.addAttachment('file01.txt', 'Content', {contentType: "text/markdown",});
|
|
126
126
|
|
|
127
|
-
testit.step("step with title", async () => {
|
|
127
|
+
await testit.step("step with title", async () => {
|
|
128
128
|
});
|
|
129
129
|
});
|
|
130
130
|
```
|
package/dist/reporter.d.ts
CHANGED
|
@@ -18,15 +18,17 @@ declare class TmsReporter implements Reporter {
|
|
|
18
18
|
private stepCache;
|
|
19
19
|
private attachmentSteps;
|
|
20
20
|
private globalStartTime;
|
|
21
|
+
private loadTestPromises;
|
|
21
22
|
constructor(options: ReporterOptions);
|
|
22
23
|
onBegin(config: FullConfig, suite: Suite): void;
|
|
23
24
|
onTestBegin(test: TestCase): void;
|
|
24
|
-
onTestEnd(test: TestCase, result: TestResult):
|
|
25
|
+
onTestEnd(test: TestCase, result: TestResult): void;
|
|
25
26
|
onStepBegin(test: TestCase, _result: TestResult, step: TestStep): void;
|
|
26
|
-
onEnd(): void
|
|
27
|
+
onEnd(): Promise<void>;
|
|
27
28
|
addSkippedResults(): void;
|
|
28
29
|
printsToStdio(): boolean;
|
|
29
30
|
private getAutotestData;
|
|
31
|
+
private loadTest;
|
|
30
32
|
}
|
|
31
33
|
export default TmsReporter;
|
|
32
34
|
export * from "./labels";
|
package/dist/reporter.js
CHANGED
|
@@ -23,6 +23,7 @@ class TmsReporter {
|
|
|
23
23
|
this.stepCache = new Map();
|
|
24
24
|
this.attachmentSteps = new Map();
|
|
25
25
|
this.globalStartTime = new Date();
|
|
26
|
+
this.loadTestPromises = new Array();
|
|
26
27
|
this.options = { suiteTitle: true, detail: true, ...options };
|
|
27
28
|
const config = new testit_js_commons_1.ConfigComposer().compose();
|
|
28
29
|
const client = new testit_js_commons_1.Client(config);
|
|
@@ -36,14 +37,8 @@ class TmsReporter {
|
|
|
36
37
|
onTestBegin(test) {
|
|
37
38
|
this.testCache.push(test);
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const steps = [...this.stepCache.keys()].filter((step) => this.stepCache.get(step) === test);
|
|
42
|
-
autotest.steps = converter_1.Converter.convertTestStepsToShortSteps(steps);
|
|
43
|
-
await this.strategy.loadAutotest(autotest, converter_1.Converter.convertStatus(result.status, test.expectedStatus) == "Passed");
|
|
44
|
-
const autotestResult = converter_1.Converter.convertAutotestPostToAutotestResult(await this.getAutotestData(test, result), test, result);
|
|
45
|
-
autotestResult.stepResults = converter_1.Converter.convertTestStepsToSteps(steps, this.attachmentSteps);
|
|
46
|
-
await this.strategy.loadTestRun([autotestResult]);
|
|
40
|
+
onTestEnd(test, result) {
|
|
41
|
+
this.loadTestPromises.push(this.loadTest(test, result));
|
|
47
42
|
}
|
|
48
43
|
onStepBegin(test, _result, step) {
|
|
49
44
|
if (!this.testCache.includes(test)) {
|
|
@@ -57,7 +52,8 @@ class TmsReporter {
|
|
|
57
52
|
}
|
|
58
53
|
this.stepCache.set(step, test);
|
|
59
54
|
}
|
|
60
|
-
onEnd() {
|
|
55
|
+
async onEnd() {
|
|
56
|
+
await Promise.all(this.loadTestPromises);
|
|
61
57
|
this.addSkippedResults();
|
|
62
58
|
}
|
|
63
59
|
addSkippedResults() {
|
|
@@ -146,6 +142,15 @@ class TmsReporter {
|
|
|
146
142
|
}
|
|
147
143
|
return autotestData;
|
|
148
144
|
}
|
|
145
|
+
async loadTest(test, result) {
|
|
146
|
+
const autotest = converter_1.Converter.convertTestCaseToAutotestPost(await this.getAutotestData(test, result));
|
|
147
|
+
const steps = [...this.stepCache.keys()].filter((step) => this.stepCache.get(step) === test);
|
|
148
|
+
autotest.steps = converter_1.Converter.convertTestStepsToShortSteps(steps);
|
|
149
|
+
await this.strategy.loadAutotest(autotest, converter_1.Converter.convertStatus(result.status, test.expectedStatus) == "Passed");
|
|
150
|
+
const autotestResult = converter_1.Converter.convertAutotestPostToAutotestResult(await this.getAutotestData(test, result), test, result);
|
|
151
|
+
autotestResult.stepResults = converter_1.Converter.convertTestStepsToSteps(steps, this.attachmentSteps);
|
|
152
|
+
await this.strategy.loadTestRun([autotestResult]);
|
|
153
|
+
}
|
|
149
154
|
}
|
|
150
155
|
exports.default = TmsReporter;
|
|
151
156
|
__exportStar(require("./labels"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testit-adapter-playwright",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Playwright adapter for Test IT",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"prettier": "^3.0.1"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"testit-js-commons": "^2.
|
|
42
|
+
"testit-js-commons": "^2.1.1"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"dist"
|