@qavajs/playwright-runner-adapter 1.10.0 → 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.
@@ -0,0 +1,407 @@
1
+ import {load} from './loader';
2
+ import type {TestInfo, TestType} from '@playwright/test';
3
+ import type {ITestCaseHookParameter} from '@cucumber/cucumber';
4
+
5
+ // Constants
6
+ const ANNOTATION_TYPES = {
7
+ TEST_ID: 'testId',
8
+ NAME: 'name',
9
+ URI: 'uri',
10
+ TAGS: 'tags'
11
+ } as const;
12
+
13
+ const HOOK_NAMES = {
14
+ BEFORE_ALL: 'Before All',
15
+ AFTER_ALL: 'After All',
16
+ BEFORE: 'Before',
17
+ AFTER: 'After',
18
+ BEFORE_STEP: 'Before Step',
19
+ AFTER_STEP: 'After Step',
20
+ WORLD: 'World',
21
+ BEFORE_HOOKS: 'Before Hooks',
22
+ AFTER_HOOKS: 'After Hooks'
23
+ } as const;
24
+
25
+ const DEFAULT_VALUES = {
26
+ ATTACHMENT_FILENAME: 'attachment',
27
+ CONTENT_TYPE: 'text/plain',
28
+ COLUMN: 1,
29
+ TEST_CASE_ID: '0',
30
+ TEST_STEP_ID: '0'
31
+ } as const;
32
+
33
+ const STEP_ARGUMENT_LABELS = {
34
+ DOC_STRING: ' [MultiLine]',
35
+ DATA_TABLE: ' [DataTable]'
36
+ } as const;
37
+
38
+ // Type definitions
39
+ interface Location {
40
+ file: string;
41
+ line: number;
42
+ column: number;
43
+ }
44
+
45
+ interface StepDefinition {
46
+ uri: string;
47
+ line: number;
48
+ }
49
+
50
+ interface TestResult {
51
+ status: string;
52
+ error?: Error;
53
+ }
54
+
55
+ interface HookResult {
56
+ duration: number | { nanos: number; seconds: number };
57
+ message?: string;
58
+ status: string;
59
+ exception?: Error;
60
+ }
61
+
62
+ /**
63
+ * Extracts the test ID from TestInfo annotations
64
+ */
65
+ function getTestId(testInfo: TestInfo): string {
66
+ const annotation = testInfo.annotations
67
+ .find((annotation) => annotation.type === ANNOTATION_TYPES.TEST_ID);
68
+
69
+ if (!annotation?.description) {
70
+ throw new Error('Test ID annotation not found');
71
+ }
72
+
73
+ return annotation.description;
74
+ }
75
+
76
+ /**
77
+ * Converts TestInfo to HookResult format
78
+ */
79
+ function getResult(testInfo: TestInfo): HookResult {
80
+ const message = testInfo.errors.length > 0
81
+ ? testInfo.errors.map((err) => err.message).join('\n')
82
+ : undefined;
83
+
84
+ return {
85
+ duration: testInfo.duration,
86
+ message,
87
+ status: testInfo.status?.toUpperCase() ?? 'UNKNOWN',
88
+ exception: testInfo.error as any
89
+ };
90
+ }
91
+
92
+ /**
93
+ * Creates a location object from step definition
94
+ */
95
+ function getLine(step: StepDefinition): { location: Location } {
96
+ return {
97
+ location: {
98
+ column: DEFAULT_VALUES.COLUMN,
99
+ file: step.uri,
100
+ line: step.line
101
+ }
102
+ };
103
+ }
104
+
105
+ /**
106
+ * Logs data to console
107
+ */
108
+ function log(data: unknown): void {
109
+ console.log(data);
110
+ }
111
+
112
+ /**
113
+ * Attaches content to test report
114
+ */
115
+ function attach(
116
+ this: { test: { info: () => TestInfo } },
117
+ body: string | Buffer,
118
+ details?: { fileName?: string; mediaType?: string }
119
+ ): void {
120
+ const fileName = details?.fileName ?? DEFAULT_VALUES.ATTACHMENT_FILENAME;
121
+ const contentType = details?.mediaType ?? DEFAULT_VALUES.CONTENT_TYPE;
122
+ this.test.info().attach(fileName, { body, contentType });
123
+ }
124
+
125
+ /**
126
+ * Generates a human-readable step name with argument type indicator
127
+ */
128
+ function stepName(pickleStep: {
129
+ text: string;
130
+ argument?: { docString?: unknown }
131
+ }): string {
132
+ let step = pickleStep.text;
133
+
134
+ if (pickleStep.argument) {
135
+ step += pickleStep.argument.docString
136
+ ? STEP_ARGUMENT_LABELS.DOC_STRING
137
+ : STEP_ARGUMENT_LABELS.DATA_TABLE;
138
+ }
139
+
140
+ return step;
141
+ }
142
+
143
+ /**
144
+ * Overrides Error.captureStackTrace to set custom location for test registration
145
+ */
146
+ function setLocation(location: Location): void {
147
+ Error.captureStackTrace = function (target: Error): void {
148
+ (target as any).stack = location;
149
+ };
150
+ }
151
+
152
+ /**
153
+ * Executes before all hooks
154
+ */
155
+ async function executeBeforeAllHooks(
156
+ test: TestType<any, any>,
157
+ hooks: any[]
158
+ ): Promise<void> {
159
+ for (const hook of hooks) {
160
+ const location = getLine(hook);
161
+ await test.step(
162
+ HOOK_NAMES.BEFORE_ALL,
163
+ () => hook.code.apply({}),
164
+ location
165
+ );
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Executes after all hooks
171
+ */
172
+ async function executeAfterAllHooks(
173
+ test: TestType<any, any>,
174
+ hooks: any[]
175
+ ): Promise<void> {
176
+ for (const hook of hooks) {
177
+ const location = getLine(hook);
178
+ await test.step(
179
+ HOOK_NAMES.AFTER_ALL,
180
+ () => hook.code.apply({}),
181
+ location
182
+ );
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Creates test annotations from test case data
188
+ */
189
+ function createTestAnnotations(testCase: any): any[] {
190
+ const tags = [...new Set(testCase.tags.map((tag: { name: string }) => tag.name))];
191
+
192
+ return [
193
+ { type: ANNOTATION_TYPES.NAME, description: testCase.name },
194
+ { type: ANNOTATION_TYPES.URI, description: testCase.uri },
195
+ { type: ANNOTATION_TYPES.TEST_ID, description: testCase.id },
196
+ { type: ANNOTATION_TYPES.TAGS, description: JSON.stringify(tags) }
197
+ ];
198
+ }
199
+
200
+ /**
201
+ * Main configuration function that sets up Cucumber adapter for Playwright
202
+ */
203
+ export function defineConfig(config: any): any {
204
+ const {features, supportCodeLibrary} = load(config);
205
+
206
+ const fixture = new supportCodeLibrary.World({config});
207
+ const test: TestType<any, any> = fixture.test;
208
+
209
+ test.beforeAll(async () => {
210
+ await executeBeforeAllHooks(test, supportCodeLibrary.beforeTestRunHookDefinitions);
211
+ });
212
+
213
+ const worlds = new Map<string, any>();
214
+
215
+ // Store original captureStackTrace to restore later
216
+ const origCaptureStackTrace = Error.captureStackTrace;
217
+
218
+ for (const feature of features) {
219
+ setLocation({
220
+ file: feature.uri,
221
+ line: 1,
222
+ column: 0,
223
+ });
224
+
225
+ const tests = feature.tests;
226
+
227
+ test.describe(feature.feature as string, async () => {
228
+ /**
229
+ * Factory function to create and register world instances
230
+ */
231
+ const worldFactory = (fixtures: any): void => {
232
+ const world = new supportCodeLibrary.World({
233
+ log,
234
+ attach,
235
+ supportCodeLibrary,
236
+ config
237
+ });
238
+ world.init(fixtures);
239
+ worlds.set(getTestId(test.info()), world);
240
+ };
241
+
242
+ worldFactory.toString = (): string => fixture.init.toString();
243
+
244
+ test.beforeEach(HOOK_NAMES.WORLD, worldFactory);
245
+
246
+ test.beforeEach(HOOK_NAMES.BEFORE_HOOKS, async () => {
247
+ const testId = getTestId(test.info());
248
+ const world = worlds.get(testId);
249
+ const testCase = tests.find((t: any) => t.id === testId);
250
+
251
+ if (!testCase) {
252
+ throw new Error(`Test case with ID ${testId} not found`);
253
+ }
254
+
255
+ for (const beforeHook of supportCodeLibrary.beforeTestCaseHookDefinitions) {
256
+ if (beforeHook.appliesToTestCase(testCase)) {
257
+ const hookName = beforeHook.name ?? HOOK_NAMES.BEFORE;
258
+ const location = getLine(beforeHook);
259
+ await test.step(
260
+ hookName,
261
+ () => beforeHook.code.apply(world, [{
262
+ gherkinDocument: feature.gherkinDocument,
263
+ pickle: testCase
264
+ } as ITestCaseHookParameter]),
265
+ location
266
+ );
267
+ }
268
+ }
269
+ });
270
+
271
+ for (const testCase of tests) {
272
+ const tag = [...new Set(testCase.tags.map((tag: { name: string }) => tag.name))];
273
+ const annotation = createTestAnnotations(testCase);
274
+
275
+ setLocation({
276
+ file: testCase.uri,
277
+ line: testCase.location?.line ?? 0,
278
+ column: testCase.location?.column ?? 0,
279
+ });
280
+
281
+ test(testCase.name, {tag, annotation}, async () => {
282
+ const world = worlds.get(testCase.id);
283
+ const result: TestResult = { status: 'passed' };
284
+
285
+ for (const pickleStep of testCase.steps) {
286
+ if (result.status !== 'passed') {
287
+ break;
288
+ }
289
+
290
+ const matchingSteps = supportCodeLibrary.stepDefinitions
291
+ .filter((stepDef: any) => stepDef.matchesStepName(pickleStep.text));
292
+
293
+ if (matchingSteps.length === 0) {
294
+ throw new Error(
295
+ `Step definition not found for: "${pickleStep.text}"`
296
+ );
297
+ }
298
+
299
+ if (matchingSteps.length > 1) {
300
+ throw new Error(
301
+ `Ambiguous step "${pickleStep.text}" matches ${matchingSteps.length} definitions`
302
+ );
303
+ }
304
+
305
+ const [step] = matchingSteps;
306
+ const location = getLine(step);
307
+ await test.step(stepName(pickleStep), async () => {
308
+ for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
309
+ if (beforeStep.appliesToTestCase(testCase)) {
310
+ const location = getLine(beforeStep);
311
+ await test.step(
312
+ HOOK_NAMES.BEFORE_STEP,
313
+ () => beforeStep.code.apply(world, [{
314
+ gherkinDocument: feature.gherkinDocument,
315
+ pickle: testCase,
316
+ pickleStep
317
+ }]),
318
+ location
319
+ );
320
+ }
321
+ }
322
+ const {parameters} = await step.getInvocationParameters({
323
+ step: {
324
+ text: pickleStep.text,
325
+ argument: pickleStep.argument
326
+ },
327
+ world
328
+ } as any);
329
+
330
+ try {
331
+ await step.code.apply(world, parameters);
332
+ } catch (err) {
333
+ result.status = 'failed';
334
+ result.error = err as Error;
335
+ throw err;
336
+ } finally {
337
+ for (const afterStep of supportCodeLibrary.afterTestStepHookDefinitions) {
338
+ if (afterStep.appliesToTestCase(testCase)) {
339
+ const location = getLine(afterStep);
340
+ await test.step(
341
+ HOOK_NAMES.AFTER_STEP,
342
+ () => afterStep.code.apply(world, [{
343
+ gherkinDocument: feature.gherkinDocument,
344
+ testCaseStartedId: DEFAULT_VALUES.TEST_CASE_ID,
345
+ testStepId: DEFAULT_VALUES.TEST_STEP_ID,
346
+ pickle: testCase,
347
+ pickleStep,
348
+ result: {
349
+ duration: 0 as any,
350
+ message: result.error?.message,
351
+ status: result.status.toUpperCase(),
352
+ exception: result.error
353
+ }
354
+ } as any]),
355
+ location
356
+ );
357
+ }
358
+ }
359
+ }
360
+ }, location);
361
+ }
362
+ })
363
+ }
364
+
365
+ test.afterEach(HOOK_NAMES.AFTER_HOOKS, async () => {
366
+ const testInfo = test.info();
367
+ const testId = getTestId(testInfo);
368
+ const world = worlds.get(testId);
369
+ const testCase = tests.find((t) => t.id === testId);
370
+
371
+ if (!testCase) {
372
+ throw new Error(`Test case with ID ${testId} not found`);
373
+ }
374
+
375
+ for (const afterHook of supportCodeLibrary.afterTestCaseHookDefinitions) {
376
+ if (afterHook.appliesToTestCase(testCase)) {
377
+ const hookName = afterHook.name ?? HOOK_NAMES.AFTER;
378
+ const location = getLine(afterHook);
379
+ await test.step(
380
+ hookName,
381
+ () => afterHook.code.apply(world, [{
382
+ gherkinDocument: feature.gherkinDocument,
383
+ testCaseStartedId: DEFAULT_VALUES.TEST_CASE_ID,
384
+ pickle: testCase,
385
+ result: getResult(testInfo)
386
+ } as any]),
387
+ location
388
+ );
389
+ }
390
+ }
391
+ });
392
+
393
+ test.afterEach(HOOK_NAMES.WORLD, async () => {
394
+ const testId = getTestId(test.info());
395
+ worlds.delete(testId);
396
+ });
397
+
398
+ });
399
+ }
400
+
401
+ // Restore original captureStackTrace
402
+ Error.captureStackTrace = origCaptureStackTrace;
403
+
404
+ test.afterAll(async () => {
405
+ await executeAfterAllHooks(test, supportCodeLibrary.afterTestRunHookDefinitions);
406
+ });
407
+ }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './PlaywrightWorld';
2
- export * from './defineCucumber';
3
2
  export * from './filter';
4
3
  export * from './Template';
5
4
  export * from '@cucumber/cucumber';
5
+ export * from './cucumberAdapter';
package/src/loader.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { join, resolve } from 'node:path';
2
+ import { resolve } from 'node:path';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { AstBuilder, compile, GherkinClassicTokenMatcher, Parser } from '@cucumber/gherkin';
5
5
  import { supportCodeLibraryBuilder } from '@cucumber/cucumber';
@@ -31,6 +31,7 @@ type Feature = {
31
31
  feature?: string;
32
32
  gherkinDocument: GherkinDocument;
33
33
  tests: readonly Pickle[];
34
+ uri: string;
34
35
  }
35
36
 
36
37
  export function loadFeatures(globPattern: string[]): Feature[] {
@@ -40,6 +41,7 @@ export function loadFeatures(globPattern: string[]): Feature[] {
40
41
  const gherkinDocument = parser.parse(readFileSync(filePath, 'utf-8'));
41
42
  return {
42
43
  feature: gherkinDocument.feature?.name,
44
+ uri: filePath,
43
45
  gherkinDocument,
44
46
  tests: duplicates(compile(gherkinDocument, file, uuidFn))
45
47
  }
@@ -57,16 +59,12 @@ export function loadStepDefinitions(globPattern: string[]) {
57
59
  return supportCodeLibraryBuilder.finalize();
58
60
  }
59
61
 
60
- export function load() {
61
- const config = require(join(process.cwd(), process.env.CONFIG ?? 'config.js'));
62
- const profile = process.env.PROFILE ?? 'default';
63
-
64
- const resolvedConfig = config[profile];
65
- const features = loadFeatures(resolvedConfig.paths);
62
+ export function load(config: any) {
63
+ const features = loadFeatures(config.paths);
66
64
  const supportCodeLibrary = loadStepDefinitions([
67
- ...(resolvedConfig.requireModules ?? []),
68
- ...(resolvedConfig.require ?? []),
69
- ...(resolvedConfig.import ?? [])
65
+ ...(config.requireModules ?? []),
66
+ ...(config.require ?? []),
67
+ ...(config.import ?? [])
70
68
  ]);
71
69
  return { features, supportCodeLibrary }
72
70
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,181 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const loader_1 = require("./loader");
4
- const { features, supportCodeLibrary } = (0, loader_1.load)();
5
- function getTestId(testInfo) {
6
- return testInfo
7
- .annotations
8
- .find((annotation) => annotation.type === 'testId')
9
- .description;
10
- }
11
- function getResult(testInfo) {
12
- const message = testInfo.errors.length > 0
13
- ? testInfo.errors.map((err) => err.message).join('\n')
14
- : undefined;
15
- return {
16
- duration: testInfo.duration,
17
- message,
18
- status: testInfo.status?.toUpperCase(),
19
- exception: testInfo.error
20
- };
21
- }
22
- function getLine(step) {
23
- return { location: { column: 1, file: step.uri, line: step.line } };
24
- }
25
- function log(data) {
26
- console.log(data);
27
- }
28
- function attach(body, details) {
29
- const fileName = details?.fileName ?? 'attachment';
30
- const contentType = details?.mediaType ?? 'text/plain';
31
- this.test.info().attach(fileName, { body, contentType });
32
- }
33
- function stepName(pickleStep) {
34
- let step = pickleStep.text;
35
- if (pickleStep.argument) {
36
- step += pickleStep.argument.docString ? ' [MultiLine]' : ' [DataTable]';
37
- }
38
- return step;
39
- }
40
- const fixture = new supportCodeLibrary.World({});
41
- const test = fixture.test;
42
- test.beforeAll(async () => {
43
- for (const beforeAllHook of supportCodeLibrary.beforeTestRunHookDefinitions) {
44
- const location = getLine(beforeAllHook);
45
- await test.step('Before All', () => beforeAllHook.code.apply({}), location);
46
- }
47
- });
48
- const worlds = new Map();
49
- for (const feature of features) {
50
- const tests = feature.tests;
51
- test.describe(feature.feature, async () => {
52
- const worldFactory = (fixtures) => {
53
- const world = new supportCodeLibrary.World({
54
- log,
55
- attach,
56
- supportCodeLibrary
57
- });
58
- world.init(fixtures);
59
- worlds.set(getTestId(test.info()), world);
60
- };
61
- worldFactory.toString = () => { return fixture.init.toString(); };
62
- test.beforeEach('World', worldFactory);
63
- test.beforeEach('Before Hooks', async () => {
64
- const testId = getTestId(test.info());
65
- const world = worlds.get(testId);
66
- const testCase = tests.find(test => test.id === testId);
67
- for (const beforeHook of supportCodeLibrary.beforeTestCaseHookDefinitions) {
68
- if (beforeHook.appliesToTestCase(testCase)) {
69
- const hookName = beforeHook.name ?? 'Before';
70
- const location = getLine(beforeHook);
71
- await test.step(hookName, () => beforeHook.code.apply(world, [{
72
- gherkinDocument: feature.gherkinDocument,
73
- pickle: testCase
74
- }]), location);
75
- }
76
- }
77
- });
78
- for (const testCase of tests) {
79
- const tag = [...new Set(testCase.tags.map((tag) => tag.name))];
80
- const annotation = [
81
- { type: 'name', description: testCase.name },
82
- { type: 'uri', description: testCase.uri },
83
- { type: 'testId', description: testCase.id },
84
- { type: 'tags', description: JSON.stringify(tag) }
85
- ];
86
- test(testCase.name, { tag, annotation }, async () => {
87
- const world = worlds.get(testCase.id);
88
- const result = { status: 'passed' };
89
- for (const pickleStep of testCase.steps) {
90
- if (result.status !== 'passed') {
91
- break;
92
- }
93
- const steps = supportCodeLibrary.stepDefinitions
94
- .filter(stepDefinition => stepDefinition.matchesStepName(pickleStep.text));
95
- if (steps.length === 0)
96
- throw new Error(`Step '${pickleStep.text}' is not defined`);
97
- if (steps.length > 1)
98
- throw new Error(`Step '${pickleStep.text}' matches multiple step definitions`);
99
- const [step] = steps;
100
- const location = getLine(step);
101
- await test.step(stepName(pickleStep), async () => {
102
- for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
103
- if (beforeStep.appliesToTestCase(testCase)) {
104
- const location = getLine(beforeStep);
105
- await test.step('Before Step', () => beforeStep.code.apply(world, [{
106
- gherkinDocument: feature.gherkinDocument,
107
- pickle: testCase,
108
- pickleStep
109
- }]), location);
110
- }
111
- }
112
- const { parameters } = await step.getInvocationParameters({
113
- step: {
114
- text: pickleStep.text,
115
- argument: pickleStep.argument
116
- },
117
- world
118
- });
119
- try {
120
- await step.code.apply(world, parameters);
121
- }
122
- catch (err) {
123
- result.status = 'failed';
124
- result.error = err;
125
- throw err;
126
- }
127
- finally {
128
- for (const afterStep of supportCodeLibrary.afterTestStepHookDefinitions) {
129
- if (afterStep.appliesToTestCase(testCase)) {
130
- const location = getLine(afterStep);
131
- await test.step('After Step', () => afterStep.code.apply(world, [{
132
- gherkinDocument: feature.gherkinDocument,
133
- testCaseStartedId: '0',
134
- testStepId: '0',
135
- pickle: testCase,
136
- pickleStep,
137
- result: {
138
- duration: 0,
139
- message: result.error?.message,
140
- status: result.status.toUpperCase(),
141
- exception: result.error
142
- }
143
- }]), location);
144
- }
145
- }
146
- }
147
- }, location);
148
- }
149
- });
150
- }
151
- test.afterEach('After Hooks', async () => {
152
- const testInfo = test.info();
153
- const testId = getTestId(testInfo);
154
- const world = worlds.get(testId);
155
- const testCase = tests.find(test => test.id === testId);
156
- for (const afterHook of supportCodeLibrary.afterTestCaseHookDefinitions) {
157
- if (afterHook.appliesToTestCase(testCase)) {
158
- const hookName = afterHook.name ?? 'After';
159
- const location = getLine(afterHook);
160
- await test.step(hookName, () => afterHook.code.apply(world, [{
161
- gherkinDocument: feature.gherkinDocument,
162
- testCaseStartedId: '0',
163
- pickle: testCase,
164
- result: getResult(testInfo)
165
- }]), location);
166
- }
167
- }
168
- });
169
- test.afterEach('World', async () => {
170
- const testId = getTestId(test.info());
171
- worlds.delete(testId);
172
- });
173
- });
174
- }
175
- test.afterAll(async () => {
176
- for (const afterAllHook of supportCodeLibrary.afterTestRunHookDefinitions) {
177
- const location = getLine(afterAllHook);
178
- await test.step('After All', () => afterAllHook.code.apply({}), location);
179
- }
180
- });
181
- //# sourceMappingURL=cucumber.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cucumber.spec.js","sourceRoot":"","sources":["../src/cucumber.spec.ts"],"names":[],"mappings":";;AAAA,qCAAgC;AAIhC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,IAAA,aAAI,GAAE,CAAC;AAEhD,SAAS,SAAS,CAAC,QAAkB;IACjC,OAAO,QAAQ;SACV,WAAW;SACX,IAAI,CAAC,CAAC,UAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,CAAE;SACrE,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,SAAS,CAAC,QAAkB;IACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QACtC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;Q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AAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;IACrB,KAAK,MAAM,YAAY,IAAI,kBAAkB,CAAC,2BAA2B,EAAE,CAAC;QACxE,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,IAAI,CACX,WAAW,EACX,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EACjC,QAAQ,CACX,CAAA;IACL,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- type CucumberConfig = {
2
- config: string;
3
- profile?: string;
4
- adapter?: string;
5
- };
6
- /**
7
- * Define cucumber config in playwright config
8
- * @param {CucumberConfig} config
9
- * @example
10
- * export default defineConfig({
11
- * testDir: defineCucumber({
12
- * config: 'cucumber.ts',
13
- * profile: 'chrome', // optional
14
- * adapter: 'path/to/adapter' // optional
15
- * }),
16
- * })
17
- */
18
- export declare function defineCucumber(config: CucumberConfig): string;
19
- export {};