@dev-blinq/cucumber_client 1.0.1453-dev → 1.0.1453-stage

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.
Files changed (34) hide show
  1. package/bin/assets/bundled_scripts/recorder.js +73 -73
  2. package/bin/assets/scripts/recorder.js +87 -49
  3. package/bin/assets/scripts/snapshot_capturer.js +10 -17
  4. package/bin/assets/scripts/unique_locators.js +169 -47
  5. package/bin/assets/templates/_hooks_template.txt +6 -2
  6. package/bin/assets/templates/utils_template.txt +16 -16
  7. package/bin/client/code_cleanup/utils.js +16 -7
  8. package/bin/client/code_gen/code_inversion.js +115 -0
  9. package/bin/client/code_gen/duplication_analysis.js +2 -1
  10. package/bin/client/code_gen/function_signature.js +4 -0
  11. package/bin/client/code_gen/page_reflection.js +52 -11
  12. package/bin/client/code_gen/playwright_codeget.js +163 -75
  13. package/bin/client/cucumber/feature.js +4 -17
  14. package/bin/client/cucumber/steps_definitions.js +13 -0
  15. package/bin/client/local_agent.js +1 -0
  16. package/bin/client/recorderv3/bvt_init.js +305 -0
  17. package/bin/client/recorderv3/bvt_recorder.js +1031 -61
  18. package/bin/client/recorderv3/implemented_steps.js +2 -0
  19. package/bin/client/recorderv3/index.js +3 -286
  20. package/bin/client/recorderv3/services.js +818 -142
  21. package/bin/client/recorderv3/step_runner.js +23 -5
  22. package/bin/client/recorderv3/step_utils.js +569 -75
  23. package/bin/client/recorderv3/update_feature.js +87 -39
  24. package/bin/client/recorderv3/wbr_entry.js +61 -0
  25. package/bin/client/recording.js +1 -0
  26. package/bin/client/upload-service.js +2 -0
  27. package/bin/client/utils/app_dir.js +21 -0
  28. package/bin/client/utils/socket_logger.js +87 -125
  29. package/bin/index.js +4 -1
  30. package/package.json +11 -5
  31. package/bin/client/recorderv3/app_dir.js +0 -23
  32. package/bin/client/recorderv3/network.js +0 -299
  33. package/bin/client/recorderv3/scriptTest.js +0 -5
  34. package/bin/client/recorderv3/ws_server.js +0 -72
@@ -67,8 +67,7 @@ export class BVTStepRunner {
67
67
  resolve();
68
68
  }
69
69
  } else {
70
- console.warn(`No paused command found for cmdId: ${cmdId}`);
71
- socketLogger.error(`No paused command found for cmdId: ${cmdId}`);
70
+ socketLogger.error(`No paused command found for cmdId: ${cmdId}`, undefined, "BVTStepRunner.resumeExecution");
72
71
  }
73
72
  }
74
73
  }
@@ -257,7 +256,7 @@ export class BVTStepRunner {
257
256
 
258
257
  try {
259
258
  this.#lastAttemptedCmdId = null;
260
- let cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId);
259
+ let cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
261
260
  bvtContext.web.pausedCmd = null;
262
261
 
263
262
  // Clear the liveExecutionMap and set up new entries for this step
@@ -273,7 +272,21 @@ export class BVTStepRunner {
273
272
  if (bvtContext.web) {
274
273
  bvtContext.web.getCmdId = () => {
275
274
  if (cmdIDs.length === 0) {
276
- cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId);
275
+ cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
276
+ }
277
+ const cId = cmdIDs.shift();
278
+ this.sendExecutionStatus({
279
+ type: "cmdExecutionStart",
280
+ cmdId: cId,
281
+ });
282
+ this.#lastAttemptedCmdId = cId;
283
+ return cId;
284
+ };
285
+ }
286
+ if (bvtContext.api) {
287
+ bvtContext.api.getCmdId = () => {
288
+ if (cmdIDs.length === 0) {
289
+ cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
277
290
  }
278
291
  const cId = cmdIDs.shift();
279
292
  this.sendExecutionStatus({
@@ -306,7 +319,10 @@ export class BVTStepRunner {
306
319
  });
307
320
  }
308
321
 
309
- if (!step.isImplemented && step.commands.length > 0) {
322
+ if (
323
+ step.isUtilStep ||
324
+ ((!(step.isImplemented && !step.shouldOverride) || step.shouldMakeStepTextUnique) && step.commands.length > 0)
325
+ ) {
310
326
  const pageName = generatePageName(step.startFrame?.url ?? "default");
311
327
  const stepDefinitionFolderPath = path.join(tempFolderPath, "step_definitions");
312
328
  if (!existsSync(stepDefinitionFolderPath)) {
@@ -320,6 +336,8 @@ export class BVTStepRunner {
320
336
  codePage,
321
337
  projectDir: this.projectDir,
322
338
  stepsDefinitions,
339
+ parametersMap,
340
+ logger: socketLogger,
323
341
  });
324
342
  if (codePage) {
325
343
  await codePage.save(stepDefsFilePath);