@dev-blinq/cucumber_client 1.0.1321-dev → 1.0.1323-dev
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.
|
@@ -523,94 +523,94 @@ class StepsDefinitions {
|
|
|
523
523
|
// }
|
|
524
524
|
// );
|
|
525
525
|
};
|
|
526
|
+
//! Deprecated, not removing until stepRunner.executeStepRemote is stable
|
|
527
|
+
// executeStepRemote = async ({ feature_file_path, scenario, tempFolderPath, stepText, onCommandResult }, options) => {
|
|
528
|
+
// // const { skipAfter = true, skipBefore = true } = options || {};
|
|
529
|
+
// const environment = {
|
|
530
|
+
// ...process.env,
|
|
531
|
+
// };
|
|
526
532
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
533
|
+
// try {
|
|
534
|
+
// const { loadConfiguration, loadSupport, runCucumber } = await import("@dev-blinq/cucumber-js/api");
|
|
535
|
+
// const { runConfiguration } = await loadConfiguration(
|
|
536
|
+
// {
|
|
537
|
+
// provided: {
|
|
538
|
+
// name: [scenario],
|
|
539
|
+
// paths: [feature_file_path],
|
|
540
|
+
// import: [path.join(tempFolderPath, "step_definitions", "**", "*.mjs")],
|
|
541
|
+
// // format: ["bvt"],
|
|
542
|
+
// },
|
|
543
|
+
// },
|
|
544
|
+
// { cwd: process.cwd(), env: environment }
|
|
545
|
+
// );
|
|
546
|
+
// // const files = glob.sync(path.join(tempFolderPath, "step_definitions", "**", "*.mjs"));
|
|
547
|
+
// // console.log("Files found:", files);
|
|
548
|
+
// const support = await loadSupport(runConfiguration, { cwd: process.cwd(), env: environment });
|
|
549
|
+
// // console.log("found ", support.stepDefinitions.length, "step definitions");
|
|
550
|
+
// // support.stepDefinitions.map((step) => {
|
|
551
|
+
// // console.log("step", step.pattern);
|
|
552
|
+
// // });
|
|
532
553
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
);
|
|
546
|
-
// const files = glob.sync(path.join(tempFolderPath, "step_definitions", "**", "*.mjs"));
|
|
547
|
-
// console.log("Files found:", files);
|
|
548
|
-
const support = await loadSupport(runConfiguration, { cwd: process.cwd(), env: environment });
|
|
549
|
-
// console.log("found ", support.stepDefinitions.length, "step definitions");
|
|
550
|
-
// support.stepDefinitions.map((step) => {
|
|
551
|
-
// console.log("step", step.pattern);
|
|
552
|
-
// });
|
|
554
|
+
// if (skipAfter) {
|
|
555
|
+
// // ignore afterAll/after hooks
|
|
556
|
+
// support.afterTestCaseHookDefinitions = [];
|
|
557
|
+
// support.afterTestRunHookDefinitions = [];
|
|
558
|
+
// }
|
|
559
|
+
// // if (skipBefore) {
|
|
560
|
+
// // // ignore beforeAll/before hooks
|
|
561
|
+
// // support.beforeTestCaseHookDefinitions = support.beforeTestCaseHookDefinitions.filter((hook) => {
|
|
562
|
+
// // return hook.uri.endsWith("utils.mjs")
|
|
563
|
+
// // });
|
|
564
|
+
// // support.beforeTestRunHookDefinitions = [];
|
|
565
|
+
// // }
|
|
553
566
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
567
|
+
// let errorMesssage = null;
|
|
568
|
+
// let info = null;
|
|
569
|
+
// let errInfo = null;
|
|
570
|
+
// const result = await runCucumber({ ...runConfiguration, support }, environment, (message) => {
|
|
571
|
+
// if (message.testStepFinished) {
|
|
572
|
+
// const { testStepFinished } = message;
|
|
573
|
+
// const { testStepResult } = testStepFinished;
|
|
574
|
+
// if (testStepResult.status === "FAILED" || testStepResult.status === "AMBIGUOUS") {
|
|
575
|
+
// if (!errorMesssage) {
|
|
576
|
+
// errorMesssage = testStepResult.message;
|
|
577
|
+
// if (info) {
|
|
578
|
+
// errInfo = info;
|
|
579
|
+
// }
|
|
580
|
+
// }
|
|
581
|
+
// }
|
|
582
|
+
// if (testStepResult.status === "UNDEFINED") {
|
|
583
|
+
// if (!errorMesssage) {
|
|
584
|
+
// errorMesssage = `step ${JSON.stringify(stepText)} is ${testStepResult.status}`;
|
|
585
|
+
// if (info) {
|
|
586
|
+
// errInfo = info;
|
|
587
|
+
// }
|
|
588
|
+
// }
|
|
589
|
+
// }
|
|
590
|
+
// }
|
|
591
|
+
// if (message.attachment) {
|
|
592
|
+
// const attachment = message.attachment;
|
|
593
|
+
// if (attachment.mediaType === "application/json" && attachment.body) {
|
|
594
|
+
// const body = JSON.parse(attachment.body);
|
|
595
|
+
// info = body.info;
|
|
596
|
+
// }
|
|
597
|
+
// }
|
|
598
|
+
// });
|
|
599
|
+
// if (errorMesssage) {
|
|
600
|
+
// const bvtError = new Error(errorMesssage);
|
|
601
|
+
// Object.assign(bvtError, { info: errInfo });
|
|
602
|
+
// throw bvtError;
|
|
603
|
+
// }
|
|
566
604
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
errorMesssage = testStepResult.message;
|
|
577
|
-
if (info) {
|
|
578
|
-
errInfo = info;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
if (testStepResult.status === "UNDEFINED") {
|
|
583
|
-
if (!errorMesssage) {
|
|
584
|
-
errorMesssage = `step ${JSON.stringify(stepText)} is ${testStepResult.status}`;
|
|
585
|
-
if (info) {
|
|
586
|
-
errInfo = info;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
if (message.attachment) {
|
|
592
|
-
const attachment = message.attachment;
|
|
593
|
-
if (attachment.mediaType === "application/json" && attachment.body) {
|
|
594
|
-
const body = JSON.parse(attachment.body);
|
|
595
|
-
info = body.info;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
if (errorMesssage) {
|
|
600
|
-
const bvtError = new Error(errorMesssage);
|
|
601
|
-
Object.assign(bvtError, { info: errInfo });
|
|
602
|
-
throw bvtError;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
return {
|
|
606
|
-
result,
|
|
607
|
-
info,
|
|
608
|
-
};
|
|
609
|
-
} catch (error) {
|
|
610
|
-
console.error("Error running cucumber-js", error);
|
|
611
|
-
throw error;
|
|
612
|
-
}
|
|
613
|
-
};
|
|
605
|
+
// return {
|
|
606
|
+
// result,
|
|
607
|
+
// info,
|
|
608
|
+
// };
|
|
609
|
+
// } catch (error) {
|
|
610
|
+
// console.error("Error running cucumber-js", error);
|
|
611
|
+
// throw error;
|
|
612
|
+
// }
|
|
613
|
+
// };
|
|
614
614
|
}
|
|
615
615
|
function findFilesWithExtension(folderPath, extension, rootFolder = null) {
|
|
616
616
|
let result = [];
|
|
@@ -132,7 +132,9 @@ export class BVTStepRunner {
|
|
|
132
132
|
}
|
|
133
133
|
if (testStepResult.status === "UNDEFINED") {
|
|
134
134
|
if (!errorMesssage) {
|
|
135
|
-
errorMesssage = stepText
|
|
135
|
+
errorMesssage = stepText
|
|
136
|
+
? `step ${JSON.stringify(stepText)} is ${testStepResult.status}`
|
|
137
|
+
: testStepResult.message;
|
|
136
138
|
if (info) {
|
|
137
139
|
errInfo = info;
|
|
138
140
|
}
|
|
@@ -214,9 +216,9 @@ export class BVTStepRunner {
|
|
|
214
216
|
this.sendExecutionStatus({
|
|
215
217
|
type: "cmdExecutionStart",
|
|
216
218
|
cmdId: cId,
|
|
217
|
-
})
|
|
219
|
+
});
|
|
218
220
|
return cId;
|
|
219
|
-
}
|
|
221
|
+
};
|
|
220
222
|
}
|
|
221
223
|
let codePage; // = getCodePage();
|
|
222
224
|
// const tempFolderPath = process.env.tempFeaturesFolderPath;
|
|
@@ -293,7 +295,7 @@ export class BVTStepRunner {
|
|
|
293
295
|
const stepExecController = new AbortController();
|
|
294
296
|
this.#currentStepController = stepExecController;
|
|
295
297
|
const { result, info } = await withAbort(async () => {
|
|
296
|
-
return
|
|
298
|
+
return this.executeStepRemote(
|
|
297
299
|
{
|
|
298
300
|
feature_file_path,
|
|
299
301
|
tempFolderPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-blinq/cucumber_client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1323-dev",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@cucumber/tag-expressions": "^6.1.1",
|
|
33
33
|
"@dev-blinq/cucumber-js": "1.0.178-dev",
|
|
34
34
|
"@faker-js/faker": "^8.1.0",
|
|
35
|
-
"automation_model": "1.0.
|
|
35
|
+
"automation_model": "1.0.778-dev",
|
|
36
36
|
"axios": "^1.7.4",
|
|
37
37
|
"chokidar": "^3.6.0",
|
|
38
38
|
"create-require": "^1.1.1",
|