@dev-blinq/cucumber_client 1.0.1291-dev → 1.0.1293-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.
@@ -190,7 +190,7 @@ export class BVTRecorder {
190
190
 
191
191
  this.lastKnownUrlPath = "";
192
192
  // TODO: what is world?
193
- this.world = { attach: () => {} };
193
+ this.world = { attach: () => { } };
194
194
  this.shouldTakeScreenshot = true;
195
195
  this.watcher = null;
196
196
  }
@@ -294,7 +294,7 @@ export class BVTRecorder {
294
294
  process.env.CDP_LISTEN_PORT = this.#remoteDebuggerPort;
295
295
 
296
296
  this.stepRunner.setRemoteDebugPort(this.#remoteDebuggerPort);
297
- this.world = { attach: () => {} };
297
+ this.world = { attach: () => { } };
298
298
 
299
299
  const ai_config_file = path.join(this.projectDir, "ai_config.json");
300
300
  let ai_config = {};
@@ -700,7 +700,7 @@ export class BVTRecorder {
700
700
  }
701
701
  async closeBrowser() {
702
702
  delete process.env.TEMP_RUN;
703
- await this.watcher.close().then(() => {});
703
+ await this.watcher.close().then(() => { });
704
704
  this.watcher = null;
705
705
  this.previousIndex = null;
706
706
  this.previousHistoryLength = null;
@@ -789,7 +789,7 @@ export class BVTRecorder {
789
789
  }, 100);
790
790
  this.timerId = timerId;
791
791
  }
792
- async runStep({ step, parametersMap }, options) {
792
+ async runStep({ step, parametersMap, tags }, options) {
793
793
  const _env = {
794
794
  TOKEN: this.TOKEN,
795
795
  TEMP_RUN: true,
@@ -812,6 +812,7 @@ export class BVTRecorder {
812
812
  step,
813
813
  parametersMap,
814
814
  envPath: this.envName,
815
+ tags
815
816
  },
816
817
  this.bvtContext,
817
818
  options
@@ -828,9 +829,9 @@ export class BVTRecorder {
828
829
  this.bvtContext.navigate = false;
829
830
  }
830
831
  }
831
- async runScenario({ steps, parametersMap }) {
832
+ async runScenario({ steps, parametersMap, tags }) {
832
833
  for (const step of steps) {
833
- await this.runStep({ step, parametersMap });
834
+ await this.runStep({ step, parametersMap, tags });
834
835
  }
835
836
  }
836
837
  async saveScenario({ scenario, featureName, override, isSingleStep }) {
@@ -18,12 +18,17 @@ async function withAbort(fn, signal) {
18
18
  if (!signal) {
19
19
  return await fn();
20
20
  }
21
+ return new Promise((resolve, reject) => {
22
+ const abortHandler = () => reject(new Error("Aborted"));
23
+ signal.addEventListener("abort", abortHandler, { once: true });
21
24
 
22
- const abortPromise = new Promise((_, reject) => {
23
- signal.addEventListener("abort", () => reject(new Error("Aborted")), { once: true });
25
+ fn()
26
+ .then(resolve)
27
+ .catch(reject)
28
+ .finally(() => {
29
+ signal.removeEventListener("abort", abortHandler);
30
+ });
24
31
  });
25
-
26
- return await Promise.race([fn(), abortPromise]);
27
32
  }
28
33
  export class BVTStepRunner {
29
34
  #currentStepController;
@@ -56,11 +61,12 @@ export class BVTStepRunner {
56
61
  // copiedCodeToTemp = true;
57
62
  }
58
63
 
59
- async writeTempFeatureFile({ step, parametersMap, tempFolderPath }) {
64
+ async writeTempFeatureFile({ step, parametersMap, tempFolderPath, tags }) {
60
65
  const tFilePath = path.join(tempFolderPath, "__temp.feature");
61
66
  // console.log(tFilePath);
62
67
  let tFileContent = `# temp feature file
63
68
  Feature: Temp feature
69
+ ${tags ? tags.join(" ") : ""}
64
70
  Scenario Outline: Temp Scenario
65
71
  Given ${escapeString(step.text)}
66
72
  `;
@@ -68,7 +74,7 @@ export class BVTStepRunner {
68
74
  writeFileSync(tFilePath, tFileContent);
69
75
  return tFilePath;
70
76
  }
71
- async runStep({ step, parametersMap, envPath }, bvtContext, options) {
77
+ async runStep({ step, parametersMap, envPath, tags }, bvtContext, options) {
72
78
  let codePage; // = getCodePage();
73
79
  // const tempFolderPath = process.env.tempFeaturesFolderPath;
74
80
  const __temp_features_FolderName = "__temp_features" + Math.random().toString(36).substring(2, 7);
@@ -109,7 +115,7 @@ export class BVTStepRunner {
109
115
  codePage = getUtilsCodePage(this.projectDir);
110
116
  }
111
117
  }
112
- const feature_file_path = await this.writeTempFeatureFile({ step, parametersMap, tempFolderPath });
118
+ const feature_file_path = await this.writeTempFeatureFile({ step, parametersMap, tempFolderPath, tags });
113
119
  // console.log({ feature_file_path, step_text: step.text });
114
120
 
115
121
  const stepExecController = new AbortController();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1291-dev",
3
+ "version": "1.0.1293-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.176-dev",
34
34
  "@faker-js/faker": "^8.1.0",
35
- "automation_model": "1.0.763-dev",
35
+ "automation_model": "1.0.764-dev",
36
36
  "axios": "^1.7.4",
37
37
  "chokidar": "^3.6.0",
38
38
  "create-require": "^1.1.1",