@qavajs/playwright-runner-adapter 1.0.1 → 1.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/CHANGELOG.md +7 -0
- package/adapter/cucumber.spec.js +40 -33
- package/adapter/cucumber.spec.js.map +1 -1
- package/package.json +5 -5
- package/src/cucumber.spec.ts +46 -36
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
|
|
|
10
10
|
:pencil: - chore
|
|
11
11
|
:microscope: - experimental
|
|
12
12
|
|
|
13
|
+
## [1.1.1]
|
|
14
|
+
- :beetle: fixed issue with After hooks execution in case of failed test
|
|
15
|
+
|
|
16
|
+
## [1.1.0]
|
|
17
|
+
- :rocket: improved BeforeStep/AfterStep logging
|
|
18
|
+
- :beetle: fixed BeforeAll/AfterAll behavior
|
|
19
|
+
|
|
13
20
|
## [1.0.1]
|
|
14
21
|
- :pencil: updated dependencies
|
|
15
22
|
- :rocket: renamed adapter spec to cucumber.spec.ts
|
package/adapter/cucumber.spec.js
CHANGED
|
@@ -13,14 +13,29 @@ function attach(body, details) {
|
|
|
13
13
|
}
|
|
14
14
|
const fixture = new supportCodeLibrary.World({});
|
|
15
15
|
const test = fixture.test;
|
|
16
|
+
const stepHandler = test.expect.extend({
|
|
17
|
+
async execute(fn) {
|
|
18
|
+
try {
|
|
19
|
+
await fn();
|
|
20
|
+
return {
|
|
21
|
+
pass: true,
|
|
22
|
+
message: () => ''
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
return {
|
|
27
|
+
pass: false,
|
|
28
|
+
message: () => e.message,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
for (const beforeAllHook of supportCodeLibrary.beforeTestRunHookDefinitions) {
|
|
34
|
+
test.beforeAll(() => beforeAllHook.code.apply({}));
|
|
35
|
+
}
|
|
16
36
|
for (const feature of features) {
|
|
17
37
|
const tests = feature.tests;
|
|
18
38
|
test.describe(feature.feature, async () => {
|
|
19
|
-
for (const beforeAllHook of supportCodeLibrary.beforeTestRunHookDefinitions) {
|
|
20
|
-
test.beforeAll(async () => {
|
|
21
|
-
await beforeAllHook.code.apply({});
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
39
|
const world = new supportCodeLibrary.World({
|
|
25
40
|
log,
|
|
26
41
|
attach,
|
|
@@ -31,25 +46,27 @@ for (const feature of features) {
|
|
|
31
46
|
const tag = testCase.tags.map((tag) => tag.name);
|
|
32
47
|
test(testCase.name, { tag }, async () => {
|
|
33
48
|
var _a, _b;
|
|
49
|
+
const testInfo = test.info();
|
|
34
50
|
const result = { status: 'passed' };
|
|
35
51
|
for (const beforeHook of supportCodeLibrary.beforeTestCaseHookDefinitions) {
|
|
36
52
|
if (beforeHook.appliesToTestCase(testCase)) {
|
|
37
53
|
const hookName = (_a = beforeHook.name) !== null && _a !== void 0 ? _a : 'Before';
|
|
38
|
-
await test.step(hookName,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}]);
|
|
42
|
-
});
|
|
54
|
+
await test.step(hookName, () => beforeHook.code.apply(world, [{
|
|
55
|
+
pickle: testCase
|
|
56
|
+
}]));
|
|
43
57
|
}
|
|
44
58
|
}
|
|
45
59
|
for (const pickleStep of testCase.steps) {
|
|
60
|
+
if (testInfo.error) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
46
63
|
await test.step(pickleStep.text, async () => {
|
|
47
64
|
for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
|
|
48
65
|
if (beforeStep.appliesToTestCase(testCase)) {
|
|
49
|
-
await beforeStep.code.apply(world, [{
|
|
66
|
+
await test.step('Before Step', () => beforeStep.code.apply(world, [{
|
|
50
67
|
pickle: testCase,
|
|
51
68
|
pickleStep
|
|
52
|
-
}]);
|
|
69
|
+
}]));
|
|
53
70
|
}
|
|
54
71
|
}
|
|
55
72
|
const steps = supportCodeLibrary.stepDefinitions
|
|
@@ -66,43 +83,33 @@ for (const feature of features) {
|
|
|
66
83
|
},
|
|
67
84
|
world
|
|
68
85
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
catch (err) {
|
|
73
|
-
result.status = 'failed';
|
|
74
|
-
result.error = err;
|
|
75
|
-
}
|
|
86
|
+
await stepHandler
|
|
87
|
+
.soft(() => step.code.apply(world, parameters), 'Step')
|
|
88
|
+
.execute();
|
|
76
89
|
for (const afterStep of supportCodeLibrary.afterTestStepHookDefinitions) {
|
|
77
90
|
if (afterStep.appliesToTestCase(testCase)) {
|
|
78
|
-
await afterStep.code.apply(world, [{
|
|
91
|
+
await test.step('After Step', () => afterStep.code.apply(world, [{
|
|
79
92
|
pickle: testCase,
|
|
80
93
|
pickleStep,
|
|
81
94
|
result
|
|
82
|
-
}]);
|
|
95
|
+
}]));
|
|
83
96
|
}
|
|
84
97
|
}
|
|
85
|
-
if (result.error)
|
|
86
|
-
throw result.error;
|
|
87
98
|
});
|
|
88
99
|
}
|
|
89
100
|
for (const afterHook of supportCodeLibrary.afterTestCaseHookDefinitions) {
|
|
90
101
|
if (afterHook.appliesToTestCase(testCase)) {
|
|
91
102
|
const hookName = (_b = afterHook.name) !== null && _b !== void 0 ? _b : 'After';
|
|
92
|
-
await test.step(hookName,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}]);
|
|
96
|
-
});
|
|
103
|
+
await test.step(hookName, () => afterHook.code.apply(world, [{
|
|
104
|
+
pickle: testCase, result
|
|
105
|
+
}]));
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
});
|
|
100
109
|
}
|
|
101
|
-
for (const afterAllHook of supportCodeLibrary.afterTestRunHookDefinitions) {
|
|
102
|
-
test.afterAll(async function () {
|
|
103
|
-
await afterAllHook.code.apply({});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
110
|
});
|
|
107
111
|
}
|
|
112
|
+
for (const afterAllHook of supportCodeLibrary.afterTestRunHookDefinitions) {
|
|
113
|
+
test.afterAll(() => afterAllHook.code.apply({}));
|
|
114
|
+
}
|
|
108
115
|
//# sourceMappingURL=cucumber.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cucumber.spec.js","sourceRoot":"","sources":["../src/cucumber.spec.ts"],"names":[],"mappings":";;AAAA,qCAAgC;AAEhC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"cucumber.spec.js","sourceRoot":"","sources":["../src/cucumber.spec.ts"],"names":[],"mappings":";;AAAA,qCAAgC;AAEhC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAC,GAAG,IAAA,aAAI,GAAE,CAAC;AAE/C,SAAS,GAAG,CAAC,IAAS;IAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,MAAM,CAAsB,IAAS,EAAE,OAAY;;IACxD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,YAAY,CAAC;IAClD,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,YAAY,CAAC;IACtD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACjD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAE1B,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,OAAO,CAAC,EAAsB;QAChC,IAAI,CAAC;YACD,MAAM,EAAE,EAAE,CAAC;YACX,OAAO;gBACH,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;aACpB,CAAA;QACL,CA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AAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,KAAK,MAAM,YAAY,IAAI,kBAAkB,CAAC,2BAA2B,EAAE,CAAC;IACxE,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qavajs/playwright-runner-adapter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "adapter for playwright test runner",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@cucumber/gherkin": "^30.0.4",
|
|
14
|
-
"glob": "^11.0.
|
|
14
|
+
"glob": "^11.0.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@cucumber/cucumber": "^11.
|
|
17
|
+
"@cucumber/cucumber": "^11.2.0",
|
|
18
18
|
"@playwright/test": "^1.49.1",
|
|
19
|
-
"@types/node": "^22.10.
|
|
20
|
-
"typescript": "^5.7.
|
|
19
|
+
"@types/node": "^22.10.6",
|
|
20
|
+
"typescript": "^5.7.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/src/cucumber.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { load } from './loader';
|
|
2
2
|
|
|
3
|
-
const { features, supportCodeLibrary
|
|
3
|
+
const { features, supportCodeLibrary} = load();
|
|
4
4
|
|
|
5
5
|
function log(data: any) {
|
|
6
6
|
console.log(data);
|
|
@@ -9,21 +9,36 @@ function log(data: any) {
|
|
|
9
9
|
function attach(this: { test: any }, body: any, details: any) {
|
|
10
10
|
const fileName = details.fileName ?? 'attachment';
|
|
11
11
|
const contentType = details.mediaType ?? 'text/plain';
|
|
12
|
-
this.test.info().attach(fileName, {
|
|
12
|
+
this.test.info().attach(fileName, {body, contentType});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const fixture = new supportCodeLibrary.World({});
|
|
16
16
|
const test = fixture.test;
|
|
17
17
|
|
|
18
|
+
const stepHandler = test.expect.extend({
|
|
19
|
+
async execute(fn: () => Promise<any>) {
|
|
20
|
+
try {
|
|
21
|
+
await fn();
|
|
22
|
+
return {
|
|
23
|
+
pass: true,
|
|
24
|
+
message: () => ''
|
|
25
|
+
}
|
|
26
|
+
} catch (e: any) {
|
|
27
|
+
return {
|
|
28
|
+
pass: false,
|
|
29
|
+
message: () => e.message,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
for (const beforeAllHook of supportCodeLibrary.beforeTestRunHookDefinitions) {
|
|
36
|
+
test.beforeAll(() => beforeAllHook.code.apply({}));
|
|
37
|
+
}
|
|
38
|
+
|
|
18
39
|
for (const feature of features) {
|
|
19
40
|
const tests = feature.tests;
|
|
20
41
|
test.describe(feature.feature as string, async () => {
|
|
21
|
-
for (const beforeAllHook of supportCodeLibrary.beforeTestRunHookDefinitions) {
|
|
22
|
-
test.beforeAll(async () => {
|
|
23
|
-
await beforeAllHook.code.apply({});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
42
|
const world = new supportCodeLibrary.World({
|
|
28
43
|
log,
|
|
29
44
|
attach,
|
|
@@ -34,26 +49,28 @@ for (const feature of features) {
|
|
|
34
49
|
|
|
35
50
|
for (const testCase of tests) {
|
|
36
51
|
const tag = testCase.tags.map((tag: { name: string }) => tag.name);
|
|
37
|
-
test(testCase.name, {
|
|
52
|
+
test(testCase.name, {tag}, async () => {
|
|
53
|
+
const testInfo = test.info();
|
|
38
54
|
const result: { status: string, error?: any } = { status: 'passed' };
|
|
39
55
|
for (const beforeHook of supportCodeLibrary.beforeTestCaseHookDefinitions) {
|
|
40
56
|
if (beforeHook.appliesToTestCase(testCase)) {
|
|
41
57
|
const hookName = beforeHook.name ?? 'Before';
|
|
42
|
-
await test.step(hookName,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}]);
|
|
46
|
-
});
|
|
58
|
+
await test.step(hookName, () => beforeHook.code.apply(world, [{
|
|
59
|
+
pickle: testCase
|
|
60
|
+
}]));
|
|
47
61
|
}
|
|
48
62
|
}
|
|
49
63
|
for (const pickleStep of testCase.steps) {
|
|
64
|
+
if (testInfo.error) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
50
67
|
await test.step(pickleStep.text, async () => {
|
|
51
68
|
for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
|
|
52
69
|
if (beforeStep.appliesToTestCase(testCase)) {
|
|
53
|
-
await beforeStep.code.apply(world, [{
|
|
70
|
+
await test.step('Before Step', () => beforeStep.code.apply(world, [{
|
|
54
71
|
pickle: testCase,
|
|
55
72
|
pickleStep
|
|
56
|
-
}]);
|
|
73
|
+
}]));
|
|
57
74
|
}
|
|
58
75
|
}
|
|
59
76
|
const steps = supportCodeLibrary.stepDefinitions
|
|
@@ -61,47 +78,40 @@ for (const feature of features) {
|
|
|
61
78
|
if (steps.length === 0) throw new Error(`Step '${pickleStep.text}' is not defined`);
|
|
62
79
|
if (steps.length > 1) throw new Error(`'${pickleStep.text}' matches multiple step definitions`);
|
|
63
80
|
const [step] = steps;
|
|
64
|
-
const {
|
|
81
|
+
const {parameters} = await step.getInvocationParameters({
|
|
65
82
|
step: {
|
|
66
83
|
text: pickleStep.text,
|
|
67
84
|
argument: pickleStep.argument
|
|
68
85
|
},
|
|
69
86
|
world
|
|
70
87
|
} as any);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
result.status = 'failed';
|
|
75
|
-
result.error = err;
|
|
76
|
-
}
|
|
88
|
+
await stepHandler
|
|
89
|
+
.soft(() => step.code.apply(world, parameters), 'Step')
|
|
90
|
+
.execute();
|
|
77
91
|
for (const afterStep of supportCodeLibrary.afterTestStepHookDefinitions) {
|
|
78
92
|
if (afterStep.appliesToTestCase(testCase)) {
|
|
79
|
-
await afterStep.code.apply(world, [{
|
|
93
|
+
await test.step('After Step', () => afterStep.code.apply(world, [{
|
|
80
94
|
pickle: testCase,
|
|
81
95
|
pickleStep,
|
|
82
96
|
result
|
|
83
|
-
}]);
|
|
97
|
+
}]));
|
|
84
98
|
}
|
|
85
99
|
}
|
|
86
|
-
if (result.error) throw result.error;
|
|
87
100
|
});
|
|
88
101
|
}
|
|
89
102
|
for (const afterHook of supportCodeLibrary.afterTestCaseHookDefinitions) {
|
|
90
103
|
if (afterHook.appliesToTestCase(testCase)) {
|
|
91
104
|
const hookName = afterHook.name ?? 'After';
|
|
92
|
-
await test.step(hookName,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}]);
|
|
96
|
-
});
|
|
105
|
+
await test.step(hookName, () => afterHook.code.apply(world, [{
|
|
106
|
+
pickle: testCase, result
|
|
107
|
+
}]));
|
|
97
108
|
}
|
|
98
109
|
}
|
|
99
110
|
})
|
|
100
111
|
}
|
|
101
|
-
for (const afterAllHook of supportCodeLibrary.afterTestRunHookDefinitions) {
|
|
102
|
-
test.afterAll(async function () {
|
|
103
|
-
await afterAllHook.code.apply({});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
112
|
});
|
|
107
113
|
}
|
|
114
|
+
|
|
115
|
+
for (const afterAllHook of supportCodeLibrary.afterTestRunHookDefinitions) {
|
|
116
|
+
test.afterAll(() => afterAllHook.code.apply({}));
|
|
117
|
+
}
|