@dev-blinq/cucumber_client 1.0.1220-dev → 1.0.1222-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.
@@ -384,7 +384,6 @@ const invertStableCommand = (call, elements, stepParams) => {
384
384
  }
385
385
  break;
386
386
  }
387
-
388
387
  case "snapshotValidation": {
389
388
  step.type = Types.VERIFY_PAGE_SNAPSHOT;
390
389
  const inputParam = parseDataSource(call.arguments[1], stepParams);
@@ -394,6 +393,30 @@ const invertStableCommand = (call, elements, stepParams) => {
394
393
  step.selectors = call.arguments[0].value;
395
394
  break;
396
395
  }
396
+ case "verifyPageTitle": {
397
+ step.type = Types.VERIFY_PAGE_TITLE;
398
+ const text = parseDataSource(call.arguments[0], stepParams);
399
+ if (text.type === "literal") {
400
+ step.parameters = [text.value];
401
+ } else {
402
+ step.dataSource = text.dataSource;
403
+ step.dataKey = text.dataKey;
404
+ step.parameters = [toVariableName(text.dataKey)];
405
+ }
406
+ break;
407
+ }
408
+ case "verifyPagePath": {
409
+ step.type = Types.VERIFY_PAGE_PATH;
410
+ const path = parseDataSource(call.arguments[0], stepParams);
411
+ if (path.type === "literal") {
412
+ step.parameters = [path.value];
413
+ } else {
414
+ step.dataSource = path.dataSource;
415
+ step.dataKey = path.dataKey;
416
+ step.parameters = [toVariableName(path.dataKey)];
417
+ }
418
+ break;
419
+ }
397
420
  default:
398
421
  return; // Skip if no matching method
399
422
  }
@@ -198,6 +198,7 @@ export class BVTRecorder {
198
198
  this.logger = logger;
199
199
  this.screenshotMap = new Map();
200
200
  this.snapshotMap = new Map();
201
+ this.scenariosStepsMap = new Map();
201
202
  this.namesService = new NamesService({
202
203
  screenshotMap: this.screenshotMap,
203
204
  TOKEN: this.TOKEN,
@@ -751,10 +752,26 @@ export class BVTRecorder {
751
752
  await this.cleanup();
752
753
  }
753
754
  async getImplementedSteps() {
754
- return getImplementedSteps(this.projectDir);
755
+ const stepsAndScenarios = await getImplementedSteps(this.projectDir);
756
+ const implementedSteps = stepsAndScenarios.implementedSteps;
757
+ const scenarios = stepsAndScenarios.scenarios;
758
+ for (const scenario of scenarios) {
759
+ this.scenariosStepsMap.set(scenario.name, scenario.steps);
760
+ delete scenario.steps;
761
+ }
762
+ return {
763
+ implementedSteps,
764
+ scenarios,
765
+ };
755
766
  }
756
767
  async getStepsAndCommandsForScenario({ name, featureName }) {
757
- return getStepsAndCommandsForScenario({ name, featureName, projectDir: this.projectDir });
768
+ return this.scenariosStepsMap.get(name) || [];
769
+ // return getStepsAndCommandsForScenario({
770
+ // name,
771
+ // featureName,
772
+ // projectDir: this.projectDir,
773
+ // map: this.scenariosStepsMap,
774
+ // });
758
775
  }
759
776
  async generateStepName({ commands, stepsNames, parameters, map }) {
760
777
  return await this.namesService.generateStepName({ commands, stepsNames, parameters, map });
@@ -233,7 +233,6 @@ export const getImplementedSteps = async (projectDir) => {
233
233
  delete scenario.featureText;
234
234
  delete scenario.scenarioDocument;
235
235
  delete scenario.examples;
236
- delete scenario.steps;
237
236
  for (const tag of scenario.tags) {
238
237
  delete tag.location;
239
238
  }
@@ -253,7 +252,7 @@ export const getImplementedSteps = async (projectDir) => {
253
252
  return { implementedSteps, scenarios };
254
253
  };
255
254
 
256
- export const getStepsAndCommandsForScenario = ({ name, featureName, projectDir }) => {
255
+ export const getStepsAndCommandsForScenario = ({ name, featureName, projectDir, map }) => {
257
256
  const stepsDefinitions = new StepsDefinitions(projectDir);
258
257
  const step_definitions = loadStepDefinitions(projectDir);
259
258
  stepsDefinitions.load();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1220-dev",
3
+ "version": "1.0.1222-dev",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@cucumber/tag-expressions": "^6.1.1",
29
29
  "@dev-blinq/cucumber-js": "1.0.172-dev",
30
30
  "@faker-js/faker": "^8.1.0",
31
- "automation_model": "1.0.732-dev",
31
+ "automation_model": "1.0.735-dev",
32
32
  "axios": "^1.7.4",
33
33
  "chokidar": "^3.6.0",
34
34
  "create-require": "^1.1.1",