@dev-blinq/cucumber_client 1.0.1293-dev → 1.0.1295-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.
@@ -240,13 +240,17 @@ this.imports[2].node.source.value
240
240
  }
241
241
  return templates;
242
242
  }
243
- getExpectedTimeout(expectedNumofCmds) {
243
+ getExpectedTimeout(expectedNumofCmds, finalTimeout) {
244
+ const timeoutNum = parseFloat(finalTimeout);
245
+ if (finalTimeout && !isNaN(timeoutNum)) {
246
+ return -1;
247
+ }
244
248
  return expectedNumofCmds * 60 * 1000;
245
249
  }
246
- addCucumberStep(type, cucumberLine, method, expectedNumofCmds) {
250
+ addCucumberStep(type, cucumberLine, method, expectedNumofCmds, finalTimeout) {
247
251
  const result = {};
248
252
  let code = "\n";
249
- code += `${type}(${JSON.stringify(cucumberLine)}, ${expectedNumofCmds ? `{ timeout: ${this.getExpectedTimeout(expectedNumofCmds)}}, ` : ""}${method});\n`;
253
+ code += `${type}(${JSON.stringify(cucumberLine)}, ${expectedNumofCmds ? `{ timeout: ${this.getExpectedTimeout(expectedNumofCmds, finalTimeout)}}, ` : ""}${method});\n`;
250
254
  let existCodePart = null;
251
255
  for (let i = 0; i < this.cucumberCalls.length; i++) {
252
256
  if (
@@ -525,11 +525,7 @@ class StepsDefinitions {
525
525
  };
526
526
 
527
527
  executeStepRemote = async ({ feature_file_path, scenario, tempFolderPath, stepText }, options) => {
528
- if (!options) {
529
- options = {
530
- skipAfter: true,
531
- };
532
- }
528
+ const { skipAfter = true, skipBefore = true } = options || {};
533
529
  const environment = {
534
530
  ...process.env,
535
531
  };
@@ -555,11 +551,16 @@ class StepsDefinitions {
555
551
  // console.log("step", step.pattern);
556
552
  // });
557
553
 
558
- if (options.skipAfter) {
554
+ if (skipAfter) {
559
555
  // ignore afterAll/after hooks
560
556
  support.afterTestCaseHookDefinitions = [];
561
557
  support.afterTestRunHookDefinitions = [];
562
558
  }
559
+ if (skipBefore) {
560
+ // ignore beforeAll/before hooks
561
+ support.beforeTestCaseHookDefinitions = [];
562
+ support.beforeTestRunHookDefinitions = [];
563
+ }
563
564
 
564
565
  let errorMesssage = null;
565
566
  let info = null;
@@ -789,7 +789,7 @@ export class BVTRecorder {
789
789
  }, 100);
790
790
  this.timerId = timerId;
791
791
  }
792
- async runStep({ step, parametersMap, tags }, options) {
792
+ async runStep({ step, parametersMap, tags, isFirstStep }, options) {
793
793
  const _env = {
794
794
  TOKEN: this.TOKEN,
795
795
  TEMP_RUN: true,
@@ -815,7 +815,7 @@ export class BVTRecorder {
815
815
  tags
816
816
  },
817
817
  this.bvtContext,
818
- options
818
+ options ? { ...options, skipBefore: !isFirstStep } : { skipBefore: !isFirstStep }
819
819
  );
820
820
  await this.revertMode();
821
821
  return { result, info };
@@ -829,11 +829,6 @@ export class BVTRecorder {
829
829
  this.bvtContext.navigate = false;
830
830
  }
831
831
  }
832
- async runScenario({ steps, parametersMap, tags }) {
833
- for (const step of steps) {
834
- await this.runStep({ step, parametersMap, tags });
835
- }
836
- }
837
832
  async saveScenario({ scenario, featureName, override, isSingleStep }) {
838
833
  await updateStepDefinitions({ scenario, featureName, projectDir: this.projectDir }); // updates mjs files
839
834
  if (!isSingleStep) await updateFeatureFile({ featureName, scenario, override, projectDir: this.projectDir }); // updates gherkin files
@@ -139,9 +139,6 @@ const init = ({ envName, projectDir, roomId, TOKEN }) => {
139
139
  "recorderWindow.runStep": async (input) => {
140
140
  return recorder.runStep(input);
141
141
  },
142
- "recorderWindow.runScenario": async (input) => {
143
- return recorder.runScenario(input);
144
- },
145
142
  "recorderWindow.saveScenario": async (input) => {
146
143
  return recorder.saveScenario(input);
147
144
  },
@@ -166,7 +166,13 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
166
166
  path
167
167
  );
168
168
  const keyword = (cucumberStep.keywordAlias ?? cucumberStep.keyword).trim();
169
- const stepResult = codePage.addCucumberStep(keyword, cucumberStep.getTemplate(), methodName, steps.length);
169
+ const stepResult = codePage.addCucumberStep(
170
+ keyword,
171
+ cucumberStep.getTemplate(),
172
+ methodName,
173
+ steps.length,
174
+ step.finalTimeout
175
+ );
170
176
 
171
177
  if (!step.isImplemented) {
172
178
  stepsDefinitions.addStep({
@@ -328,7 +334,6 @@ export async function updateStepDefinitions({ scenario, featureName, projectDir
328
334
  const stepDefsFilePath = locateDefinitionPath(featureFolder, pageName);
329
335
  // path.join(stepDefinitionFolderPath, pageName + "_page.mjs");
330
336
  let codePage = getCodePage(stepDefsFilePath);
331
-
332
337
  codePage = await saveRecording({ step, cucumberStep, codePage, projectDir, stepsDefinitions });
333
338
  if (!codePage) {
334
339
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1293-dev",
3
+ "version": "1.0.1295-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.764-dev",
35
+ "automation_model": "1.0.765-dev",
36
36
  "axios": "^1.7.4",
37
37
  "chokidar": "^3.6.0",
38
38
  "create-require": "^1.1.1",