@qavajs/playwright-runner-adapter 1.9.1 → 2.0.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/CHANGELOG.md +28 -0
- package/README.md +9 -9
- package/adapter/PlaywrightWorld.d.ts +1 -0
- package/adapter/PlaywrightWorld.js +1 -0
- package/adapter/PlaywrightWorld.js.map +1 -1
- package/adapter/cucumberAdapter.d.ts +4 -0
- package/adapter/cucumberAdapter.js +297 -0
- package/adapter/cucumberAdapter.js.map +1 -0
- package/adapter/index.d.ts +1 -1
- package/adapter/index.js +1 -1
- package/adapter/index.js.map +1 -1
- package/adapter/loader.d.ts +2 -1
- package/adapter/loader.js +6 -8
- package/adapter/loader.js.map +1 -1
- package/package.json +7 -7
- package/src/PlaywrightWorld.ts +1 -0
- package/src/cucumberAdapter.ts +407 -0
- package/src/index.ts +1 -1
- package/src/loader.ts +8 -10
- package/adapter/cucumber.spec.d.ts +0 -1
- package/adapter/cucumber.spec.js +0 -174
- package/adapter/cucumber.spec.js.map +0 -1
- package/adapter/defineCucumber.d.ts +0 -19
- package/adapter/defineCucumber.js +0 -22
- package/adapter/defineCucumber.js.map +0 -1
- package/src/cucumber.spec.ts +0 -211
- package/src/defineCucumber.ts +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,34 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
|
|
|
14
14
|
|
|
15
15
|
:microscope: - experimental
|
|
16
16
|
|
|
17
|
+
## [2.0.0]
|
|
18
|
+
Breaking Change:
|
|
19
|
+
- :rocket: reworked cucumber-playwright connection mechanism
|
|
20
|
+
|
|
21
|
+
#### Create cucumber config file
|
|
22
|
+
Set `paths` and `require` properties
|
|
23
|
+
```typescript
|
|
24
|
+
// cucumber.config.ts
|
|
25
|
+
import { defineConfig } from '@qavajs/playwright-runner-adapter';
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
paths: ['test/features/*.feature'],
|
|
29
|
+
require: ['test/step_definitions/*.ts']
|
|
30
|
+
})
|
|
31
|
+
```
|
|
32
|
+
#### Set testMatch property
|
|
33
|
+
Set `testMatch` to adapter
|
|
34
|
+
```typescript
|
|
35
|
+
import { defineConfig } from '@playwright/test';
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
testMatch: 'cucumber.config.ts'
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## [1.10.0]
|
|
43
|
+
- :rocket: improved multi line and data table step logging
|
|
44
|
+
|
|
17
45
|
## [1.9.1]
|
|
18
46
|
- :beetle: fixed bug with custom fixture assignment
|
|
19
47
|
|
package/README.md
CHANGED
|
@@ -14,21 +14,21 @@ npm install @qavajs/playwright-runner-adapter
|
|
|
14
14
|
### Create cucumber config file
|
|
15
15
|
Set `paths` and `require` properties
|
|
16
16
|
```typescript
|
|
17
|
-
|
|
17
|
+
// cucumber.config.ts
|
|
18
|
+
import { defineConfig } from '@qavajs/playwright-runner-adapter';
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
18
21
|
paths: ['test/features/*.feature'],
|
|
19
22
|
require: ['test/step_definitions/*.ts']
|
|
20
|
-
}
|
|
23
|
+
})
|
|
21
24
|
```
|
|
22
|
-
### Set
|
|
23
|
-
Set
|
|
25
|
+
### Set testMatch property
|
|
26
|
+
Set `testMatch` to adapter
|
|
24
27
|
```typescript
|
|
25
|
-
import {
|
|
28
|
+
import { defineConfig } from '@playwright/test';
|
|
26
29
|
|
|
27
30
|
export default defineConfig({
|
|
28
|
-
|
|
29
|
-
config: 'test/cucumber.ts',
|
|
30
|
-
profile: 'default'
|
|
31
|
-
})
|
|
31
|
+
testMatch: 'cucumber.config.ts'
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -9,6 +9,7 @@ export declare class TestWorld {
|
|
|
9
9
|
mediaType: string;
|
|
10
10
|
}) => void;
|
|
11
11
|
parameters: string;
|
|
12
|
+
config: any;
|
|
12
13
|
supportCodeLibrary: any;
|
|
13
14
|
test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
14
15
|
expect: import("@playwright/test").Expect<{}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightWorld.js","sourceRoot":"","sources":["../src/PlaywrightWorld.ts"],"names":[],"mappings":";;;AAAA,2CAAkG;AAElG;;GAEG;AACH,MAAa,SAAS;IAClB,GAAG,CAAuB;IAC1B,MAAM,CAA2E;IACjF,UAAU,CAAU;IACpB,kBAAkB,CAAO;IACzB,IAAI,GAAG,WAAI,CAAC;IACZ,MAAM,GAAG,aAAM,CAAC;IAEhB,YAAY,OAAY;QACpB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,WAAW,CAAY,IAAY,EAAE,UAAgB;QACvD,MAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAClG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,kBAAkB,CAAC,CAAC;QACzE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,qCAAqC,CAAC,CAAC;QAC1F,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAS,CAAC;QAChC,MAAM,EA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kBAAkB,CAAC,CAAC;QACzE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,qCAAqC,CAAC,CAAC;QAC1F,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAS,CAAC;QAChC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAS,CAAC,CAAC;QAClG,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;QACvC,CAAC;IACL,CAAC;CACJ;AA5BD,8BA4BC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,SAAS;IAC1C,IAAI,CAAQ;IACZ,OAAO,CAAkB;IACzB,OAAO,CAAW;IAClB,WAAW,CAAU;IACrB,OAAO,CAAqB;IAE5B,IAAI,GAAiC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAA6D,EAAE,EAAE;QAC3H,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC,CAAA;CACJ;AAZD,0CAYC"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineConfig = defineConfig;
|
|
4
|
+
const loader_1 = require("./loader");
|
|
5
|
+
// Constants
|
|
6
|
+
const ANNOTATION_TYPES = {
|
|
7
|
+
TEST_ID: 'testId',
|
|
8
|
+
NAME: 'name',
|
|
9
|
+
URI: 'uri',
|
|
10
|
+
TAGS: 'tags'
|
|
11
|
+
};
|
|
12
|
+
const HOOK_NAMES = {
|
|
13
|
+
BEFORE_ALL: 'Before All',
|
|
14
|
+
AFTER_ALL: 'After All',
|
|
15
|
+
BEFORE: 'Before',
|
|
16
|
+
AFTER: 'After',
|
|
17
|
+
BEFORE_STEP: 'Before Step',
|
|
18
|
+
AFTER_STEP: 'After Step',
|
|
19
|
+
WORLD: 'World',
|
|
20
|
+
BEFORE_HOOKS: 'Before Hooks',
|
|
21
|
+
AFTER_HOOKS: 'After Hooks'
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_VALUES = {
|
|
24
|
+
ATTACHMENT_FILENAME: 'attachment',
|
|
25
|
+
CONTENT_TYPE: 'text/plain',
|
|
26
|
+
COLUMN: 1,
|
|
27
|
+
TEST_CASE_ID: '0',
|
|
28
|
+
TEST_STEP_ID: '0'
|
|
29
|
+
};
|
|
30
|
+
const STEP_ARGUMENT_LABELS = {
|
|
31
|
+
DOC_STRING: ' [MultiLine]',
|
|
32
|
+
DATA_TABLE: ' [DataTable]'
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Extracts the test ID from TestInfo annotations
|
|
36
|
+
*/
|
|
37
|
+
function getTestId(testInfo) {
|
|
38
|
+
const annotation = testInfo.annotations
|
|
39
|
+
.find((annotation) => annotation.type === ANNOTATION_TYPES.TEST_ID);
|
|
40
|
+
if (!annotation?.description) {
|
|
41
|
+
throw new Error('Test ID annotation not found');
|
|
42
|
+
}
|
|
43
|
+
return annotation.description;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Converts TestInfo to HookResult format
|
|
47
|
+
*/
|
|
48
|
+
function getResult(testInfo) {
|
|
49
|
+
const message = testInfo.errors.length > 0
|
|
50
|
+
? testInfo.errors.map((err) => err.message).join('\n')
|
|
51
|
+
: undefined;
|
|
52
|
+
return {
|
|
53
|
+
duration: testInfo.duration,
|
|
54
|
+
message,
|
|
55
|
+
status: testInfo.status?.toUpperCase() ?? 'UNKNOWN',
|
|
56
|
+
exception: testInfo.error
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a location object from step definition
|
|
61
|
+
*/
|
|
62
|
+
function getLine(step) {
|
|
63
|
+
return {
|
|
64
|
+
location: {
|
|
65
|
+
column: DEFAULT_VALUES.COLUMN,
|
|
66
|
+
file: step.uri,
|
|
67
|
+
line: step.line
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Logs data to console
|
|
73
|
+
*/
|
|
74
|
+
function log(data) {
|
|
75
|
+
console.log(data);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Attaches content to test report
|
|
79
|
+
*/
|
|
80
|
+
function attach(body, details) {
|
|
81
|
+
const fileName = details?.fileName ?? DEFAULT_VALUES.ATTACHMENT_FILENAME;
|
|
82
|
+
const contentType = details?.mediaType ?? DEFAULT_VALUES.CONTENT_TYPE;
|
|
83
|
+
this.test.info().attach(fileName, { body, contentType });
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Generates a human-readable step name with argument type indicator
|
|
87
|
+
*/
|
|
88
|
+
function stepName(pickleStep) {
|
|
89
|
+
let step = pickleStep.text;
|
|
90
|
+
if (pickleStep.argument) {
|
|
91
|
+
step += pickleStep.argument.docString
|
|
92
|
+
? STEP_ARGUMENT_LABELS.DOC_STRING
|
|
93
|
+
: STEP_ARGUMENT_LABELS.DATA_TABLE;
|
|
94
|
+
}
|
|
95
|
+
return step;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Overrides Error.captureStackTrace to set custom location for test registration
|
|
99
|
+
*/
|
|
100
|
+
function setLocation(location) {
|
|
101
|
+
Error.captureStackTrace = function (target) {
|
|
102
|
+
target.stack = location;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Executes before all hooks
|
|
107
|
+
*/
|
|
108
|
+
async function executeBeforeAllHooks(test, hooks) {
|
|
109
|
+
for (const hook of hooks) {
|
|
110
|
+
const location = getLine(hook);
|
|
111
|
+
await test.step(HOOK_NAMES.BEFORE_ALL, () => hook.code.apply({}), location);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Executes after all hooks
|
|
116
|
+
*/
|
|
117
|
+
async function executeAfterAllHooks(test, hooks) {
|
|
118
|
+
for (const hook of hooks) {
|
|
119
|
+
const location = getLine(hook);
|
|
120
|
+
await test.step(HOOK_NAMES.AFTER_ALL, () => hook.code.apply({}), location);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates test annotations from test case data
|
|
125
|
+
*/
|
|
126
|
+
function createTestAnnotations(testCase) {
|
|
127
|
+
const tags = [...new Set(testCase.tags.map((tag) => tag.name))];
|
|
128
|
+
return [
|
|
129
|
+
{ type: ANNOTATION_TYPES.NAME, description: testCase.name },
|
|
130
|
+
{ type: ANNOTATION_TYPES.URI, description: testCase.uri },
|
|
131
|
+
{ type: ANNOTATION_TYPES.TEST_ID, description: testCase.id },
|
|
132
|
+
{ type: ANNOTATION_TYPES.TAGS, description: JSON.stringify(tags) }
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Main configuration function that sets up Cucumber adapter for Playwright
|
|
137
|
+
*/
|
|
138
|
+
function defineConfig(config) {
|
|
139
|
+
const { features, supportCodeLibrary } = (0, loader_1.load)(config);
|
|
140
|
+
const fixture = new supportCodeLibrary.World({ config });
|
|
141
|
+
const test = fixture.test;
|
|
142
|
+
test.beforeAll(async () => {
|
|
143
|
+
await executeBeforeAllHooks(test, supportCodeLibrary.beforeTestRunHookDefinitions);
|
|
144
|
+
});
|
|
145
|
+
const worlds = new Map();
|
|
146
|
+
// Store original captureStackTrace to restore later
|
|
147
|
+
const origCaptureStackTrace = Error.captureStackTrace;
|
|
148
|
+
for (const feature of features) {
|
|
149
|
+
setLocation({
|
|
150
|
+
file: feature.uri,
|
|
151
|
+
line: 1,
|
|
152
|
+
column: 0,
|
|
153
|
+
});
|
|
154
|
+
const tests = feature.tests;
|
|
155
|
+
test.describe(feature.feature, async () => {
|
|
156
|
+
/**
|
|
157
|
+
* Factory function to create and register world instances
|
|
158
|
+
*/
|
|
159
|
+
const worldFactory = (fixtures) => {
|
|
160
|
+
const world = new supportCodeLibrary.World({
|
|
161
|
+
log,
|
|
162
|
+
attach,
|
|
163
|
+
supportCodeLibrary,
|
|
164
|
+
config
|
|
165
|
+
});
|
|
166
|
+
world.init(fixtures);
|
|
167
|
+
worlds.set(getTestId(test.info()), world);
|
|
168
|
+
};
|
|
169
|
+
worldFactory.toString = () => fixture.init.toString();
|
|
170
|
+
test.beforeEach(HOOK_NAMES.WORLD, worldFactory);
|
|
171
|
+
test.beforeEach(HOOK_NAMES.BEFORE_HOOKS, async () => {
|
|
172
|
+
const testId = getTestId(test.info());
|
|
173
|
+
const world = worlds.get(testId);
|
|
174
|
+
const testCase = tests.find((t) => t.id === testId);
|
|
175
|
+
if (!testCase) {
|
|
176
|
+
throw new Error(`Test case with ID ${testId} not found`);
|
|
177
|
+
}
|
|
178
|
+
for (const beforeHook of supportCodeLibrary.beforeTestCaseHookDefinitions) {
|
|
179
|
+
if (beforeHook.appliesToTestCase(testCase)) {
|
|
180
|
+
const hookName = beforeHook.name ?? HOOK_NAMES.BEFORE;
|
|
181
|
+
const location = getLine(beforeHook);
|
|
182
|
+
await test.step(hookName, () => beforeHook.code.apply(world, [{
|
|
183
|
+
gherkinDocument: feature.gherkinDocument,
|
|
184
|
+
pickle: testCase
|
|
185
|
+
}]), location);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
for (const testCase of tests) {
|
|
190
|
+
const tag = [...new Set(testCase.tags.map((tag) => tag.name))];
|
|
191
|
+
const annotation = createTestAnnotations(testCase);
|
|
192
|
+
setLocation({
|
|
193
|
+
file: testCase.uri,
|
|
194
|
+
line: testCase.location?.line ?? 0,
|
|
195
|
+
column: testCase.location?.column ?? 0,
|
|
196
|
+
});
|
|
197
|
+
test(testCase.name, { tag, annotation }, async () => {
|
|
198
|
+
const world = worlds.get(testCase.id);
|
|
199
|
+
const result = { status: 'passed' };
|
|
200
|
+
for (const pickleStep of testCase.steps) {
|
|
201
|
+
if (result.status !== 'passed') {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
const matchingSteps = supportCodeLibrary.stepDefinitions
|
|
205
|
+
.filter((stepDef) => stepDef.matchesStepName(pickleStep.text));
|
|
206
|
+
if (matchingSteps.length === 0) {
|
|
207
|
+
throw new Error(`Step definition not found for: "${pickleStep.text}"`);
|
|
208
|
+
}
|
|
209
|
+
if (matchingSteps.length > 1) {
|
|
210
|
+
throw new Error(`Ambiguous step "${pickleStep.text}" matches ${matchingSteps.length} definitions`);
|
|
211
|
+
}
|
|
212
|
+
const [step] = matchingSteps;
|
|
213
|
+
const location = getLine(step);
|
|
214
|
+
await test.step(stepName(pickleStep), async () => {
|
|
215
|
+
for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
|
|
216
|
+
if (beforeStep.appliesToTestCase(testCase)) {
|
|
217
|
+
const location = getLine(beforeStep);
|
|
218
|
+
await test.step(HOOK_NAMES.BEFORE_STEP, () => beforeStep.code.apply(world, [{
|
|
219
|
+
gherkinDocument: feature.gherkinDocument,
|
|
220
|
+
pickle: testCase,
|
|
221
|
+
pickleStep
|
|
222
|
+
}]), location);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const { parameters } = await step.getInvocationParameters({
|
|
226
|
+
step: {
|
|
227
|
+
text: pickleStep.text,
|
|
228
|
+
argument: pickleStep.argument
|
|
229
|
+
},
|
|
230
|
+
world
|
|
231
|
+
});
|
|
232
|
+
try {
|
|
233
|
+
await step.code.apply(world, parameters);
|
|
234
|
+
}
|
|
235
|
+
catch (err) {
|
|
236
|
+
result.status = 'failed';
|
|
237
|
+
result.error = err;
|
|
238
|
+
throw err;
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
for (const afterStep of supportCodeLibrary.afterTestStepHookDefinitions) {
|
|
242
|
+
if (afterStep.appliesToTestCase(testCase)) {
|
|
243
|
+
const location = getLine(afterStep);
|
|
244
|
+
await test.step(HOOK_NAMES.AFTER_STEP, () => afterStep.code.apply(world, [{
|
|
245
|
+
gherkinDocument: feature.gherkinDocument,
|
|
246
|
+
testCaseStartedId: DEFAULT_VALUES.TEST_CASE_ID,
|
|
247
|
+
testStepId: DEFAULT_VALUES.TEST_STEP_ID,
|
|
248
|
+
pickle: testCase,
|
|
249
|
+
pickleStep,
|
|
250
|
+
result: {
|
|
251
|
+
duration: 0,
|
|
252
|
+
message: result.error?.message,
|
|
253
|
+
status: result.status.toUpperCase(),
|
|
254
|
+
exception: result.error
|
|
255
|
+
}
|
|
256
|
+
}]), location);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}, location);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
test.afterEach(HOOK_NAMES.AFTER_HOOKS, async () => {
|
|
265
|
+
const testInfo = test.info();
|
|
266
|
+
const testId = getTestId(testInfo);
|
|
267
|
+
const world = worlds.get(testId);
|
|
268
|
+
const testCase = tests.find((t) => t.id === testId);
|
|
269
|
+
if (!testCase) {
|
|
270
|
+
throw new Error(`Test case with ID ${testId} not found`);
|
|
271
|
+
}
|
|
272
|
+
for (const afterHook of supportCodeLibrary.afterTestCaseHookDefinitions) {
|
|
273
|
+
if (afterHook.appliesToTestCase(testCase)) {
|
|
274
|
+
const hookName = afterHook.name ?? HOOK_NAMES.AFTER;
|
|
275
|
+
const location = getLine(afterHook);
|
|
276
|
+
await test.step(hookName, () => afterHook.code.apply(world, [{
|
|
277
|
+
gherkinDocument: feature.gherkinDocument,
|
|
278
|
+
testCaseStartedId: DEFAULT_VALUES.TEST_CASE_ID,
|
|
279
|
+
pickle: testCase,
|
|
280
|
+
result: getResult(testInfo)
|
|
281
|
+
}]), location);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
test.afterEach(HOOK_NAMES.WORLD, async () => {
|
|
286
|
+
const testId = getTestId(test.info());
|
|
287
|
+
worlds.delete(testId);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
// Restore original captureStackTrace
|
|
292
|
+
Error.captureStackTrace = origCaptureStackTrace;
|
|
293
|
+
test.afterAll(async () => {
|
|
294
|
+
await executeAfterAllHooks(test, supportCodeLibrary.afterTestRunHookDefinitions);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=cucumberAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cucumberAdapter.js","sourceRoot":"","sources":["../src/cucumberAdapter.ts"],"names":[],"mappings":";;AA0MA,oCA4MC;AAtZD,qCAA8B;AAI9B,YAAY;AACZ,MAAM,gBAAgB,GAAG;IACrB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACN,CAAC;AAEX,MAAM,UAAU,GAAG;IACf,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,aAAa;CACpB,CAAC;AAEX,MAAM,cAAc,GAAG;IACnB,mBAAmB,EAAE,YAAY;IACjC,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,CAAC;IACT,YAAY,EAAE,GAAG;IACjB,YAAY,EAAE,GAAG;CACX,CAAC;AAEX,MAAM,oBAAoB,GAAG;IACzB,UAAU,EA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AE,cAAc,CAAC,YAAY;gCAC9C,MAAM,EAAE,QAAQ;gCAChB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC;6BACvB,CAAC,CAAC,EACV,QAAQ,CACX,CAAC;oBACN,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;gBACxC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QAEP,CAAC,CAAC,CAAC;IACP,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,iBAAiB,GAAG,qBAAqB,CAAC;IAEhD,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;QACrB,MAAM,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/adapter/index.d.ts
CHANGED
package/adapter/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./PlaywrightWorld"), exports);
|
|
18
|
-
__exportStar(require("./defineCucumber"), exports);
|
|
19
18
|
__exportStar(require("./filter"), exports);
|
|
20
19
|
__exportStar(require("./Template"), exports);
|
|
21
20
|
__exportStar(require("@cucumber/cucumber"), exports);
|
|
21
|
+
__exportStar(require("./cucumberAdapter"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/adapter/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,2CAAyB;AACzB,6CAA2B;AAC3B,qDAAmC;AACnC,oDAAkC"}
|
package/adapter/loader.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ type Feature = {
|
|
|
3
3
|
feature?: string;
|
|
4
4
|
gherkinDocument: GherkinDocument;
|
|
5
5
|
tests: readonly Pickle[];
|
|
6
|
+
uri: string;
|
|
6
7
|
};
|
|
7
8
|
export declare function loadFeatures(globPattern: string[]): Feature[];
|
|
8
9
|
export declare function loadStepDefinitions(globPattern: string[]): import("@cucumber/cucumber/lib/support_code_library_builder/types").SupportCodeLibrary;
|
|
9
|
-
export declare function load(): {
|
|
10
|
+
export declare function load(config: any): {
|
|
10
11
|
features: Feature[];
|
|
11
12
|
supportCodeLibrary: import("@cucumber/cucumber/lib/support_code_library_builder/types").SupportCodeLibrary;
|
|
12
13
|
};
|
package/adapter/loader.js
CHANGED
|
@@ -35,6 +35,7 @@ function loadFeatures(globPattern) {
|
|
|
35
35
|
const gherkinDocument = parser.parse((0, node_fs_1.readFileSync)(filePath, 'utf-8'));
|
|
36
36
|
return {
|
|
37
37
|
feature: gherkinDocument.feature?.name,
|
|
38
|
+
uri: filePath,
|
|
38
39
|
gherkinDocument,
|
|
39
40
|
tests: duplicates((0, gherkin_1.compile)(gherkinDocument, file, uuidFn))
|
|
40
41
|
};
|
|
@@ -50,15 +51,12 @@ function loadStepDefinitions(globPattern) {
|
|
|
50
51
|
}
|
|
51
52
|
return cucumber_1.supportCodeLibraryBuilder.finalize();
|
|
52
53
|
}
|
|
53
|
-
function load() {
|
|
54
|
-
const
|
|
55
|
-
const profile = process.env.PROFILE ?? 'default';
|
|
56
|
-
const resolvedConfig = config[profile];
|
|
57
|
-
const features = loadFeatures(resolvedConfig.paths);
|
|
54
|
+
function load(config) {
|
|
55
|
+
const features = loadFeatures(config.paths);
|
|
58
56
|
const supportCodeLibrary = loadStepDefinitions([
|
|
59
|
-
...(
|
|
60
|
-
...(
|
|
61
|
-
...(
|
|
57
|
+
...(config.requireModules ?? []),
|
|
58
|
+
...(config.require ?? []),
|
|
59
|
+
...(config.import ?? [])
|
|
62
60
|
]);
|
|
63
61
|
return { features, supportCodeLibrary };
|
|
64
62
|
}
|
package/adapter/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;AAoCA,oCAYC;AAED,kDASC;AAED,oBAQC;AArED,qCAAuC;AACvC,yCAAoC;AACpC,6CAAyC;AACzC,+CAA4F;AAC5F,iDAA+D;AAE/D,+BAAgC;AAChC,uDAAoD;AAEpD,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,wBAAU,GAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,oCAA0B,EAAE,CAAC;AACjD,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAE3C,SAAS,UAAU,CAAC,KAAwB;IACxC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CA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AY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;QAC3C,GAAG,CAAC,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;QAChC,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACzB,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;KAC3B,CAAC,CAAC;IACH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAA;AAC3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qavajs/playwright-runner-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "adapter for playwright test runner",
|
|
5
5
|
"main": "adapter/index.js",
|
|
6
6
|
"types": "adapter/index.d.ts",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"url": "https://github.com/qavajs/playwright-runner-adapter/issues"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cucumber/gherkin": "^
|
|
23
|
-
"@cucumber/tag-expressions": "^
|
|
24
|
-
"glob": "^13.0.
|
|
25
|
-
"@cucumber/cucumber": "^12.
|
|
22
|
+
"@cucumber/gherkin": "^38.0.0",
|
|
23
|
+
"@cucumber/tag-expressions": "^9.0.0",
|
|
24
|
+
"glob": "^13.0.1",
|
|
25
|
+
"@cucumber/cucumber": "^12.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@playwright/test": "^1.
|
|
29
|
-
"@types/node": "^
|
|
28
|
+
"@playwright/test": "^1.58.1",
|
|
29
|
+
"@types/node": "^25.2.1",
|
|
30
30
|
"typescript": "^5.9.3"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
package/src/PlaywrightWorld.ts
CHANGED