@dev-blinq/cucumber_client 1.0.1421-dev → 1.0.1421-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.
- package/bin/assets/bundled_scripts/recorder.js +105 -105
- package/bin/assets/preload/css_gen.js +10 -10
- package/bin/assets/preload/toolbar.js +27 -29
- package/bin/assets/preload/unique_locators.js +1 -1
- package/bin/assets/preload/yaml.js +288 -275
- package/bin/assets/scripts/aria_snapshot.js +223 -220
- package/bin/assets/scripts/dom_attr.js +329 -329
- package/bin/assets/scripts/dom_parent.js +169 -174
- package/bin/assets/scripts/event_utils.js +94 -94
- package/bin/assets/scripts/pw.js +2050 -1949
- package/bin/assets/scripts/recorder.js +70 -45
- package/bin/assets/scripts/snapshot_capturer.js +147 -147
- package/bin/assets/scripts/unique_locators.js +163 -44
- package/bin/assets/scripts/yaml.js +796 -783
- package/bin/assets/templates/_hooks_template.txt +6 -2
- package/bin/assets/templates/utils_template.txt +16 -16
- package/bin/client/code_cleanup/find_step_definition_references.js +0 -1
- package/bin/client/code_gen/api_codegen.js +2 -2
- package/bin/client/code_gen/code_inversion.js +63 -2
- package/bin/client/code_gen/function_signature.js +4 -0
- package/bin/client/code_gen/page_reflection.js +823 -1003
- package/bin/client/code_gen/playwright_codeget.js +25 -3
- package/bin/client/cucumber/feature_data.js +2 -2
- package/bin/client/cucumber/project_to_document.js +8 -2
- package/bin/client/cucumber/steps_definitions.js +19 -3
- package/bin/client/cucumber_selector.js +4 -0
- package/bin/client/local_agent.js +3 -2
- package/bin/client/parse_feature_file.js +23 -26
- package/bin/client/playground/projects/env.json +2 -2
- package/bin/client/project.js +186 -202
- package/bin/client/recorderv3/bvt_init.js +363 -0
- package/bin/client/recorderv3/bvt_recorder.js +1008 -47
- package/bin/client/recorderv3/implemented_steps.js +2 -0
- package/bin/client/recorderv3/index.js +4 -283
- package/bin/client/recorderv3/scriptTest.js +1 -1
- package/bin/client/recorderv3/services.js +810 -142
- package/bin/client/recorderv3/step_runner.js +37 -11
- package/bin/client/recorderv3/step_utils.js +495 -39
- package/bin/client/recorderv3/update_feature.js +32 -13
- package/bin/client/recorderv3/wbr_entry.js +61 -0
- package/bin/client/recording.js +1 -0
- package/bin/client/upload-service.js +4 -2
- package/bin/client/utils/socket_logger.js +1 -1
- package/bin/index.js +4 -1
- package/bin/logger.js +3 -2
- package/bin/min/consoleApi.min.cjs +2 -3
- package/bin/min/injectedScript.min.cjs +16 -16
- package/package.json +19 -9
|
@@ -14,6 +14,7 @@ import { escapeString, getExamplesContent } from "./update_feature.js";
|
|
|
14
14
|
import fs from "fs";
|
|
15
15
|
import { locateDefinitionPath } from "../cucumber/steps_definitions.js";
|
|
16
16
|
import { tmpdir } from "os";
|
|
17
|
+
import socketLogger from "../utils/socket_logger.js";
|
|
17
18
|
|
|
18
19
|
export class BVTStepRunner {
|
|
19
20
|
#currentStepController = null;
|
|
@@ -44,7 +45,10 @@ export class BVTStepRunner {
|
|
|
44
45
|
|
|
45
46
|
async pauseExecution(cmdId) {
|
|
46
47
|
if (this.bvtContext.web) {
|
|
47
|
-
this.bvtContext.web.pausedCmd =
|
|
48
|
+
this.bvtContext.web.pausedCmd = {
|
|
49
|
+
id: cmdId,
|
|
50
|
+
...this.liveExecutionMap.get(cmdId),
|
|
51
|
+
};
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
|
|
@@ -56,6 +60,7 @@ export class BVTStepRunner {
|
|
|
56
60
|
}
|
|
57
61
|
this.bvtContext.web.pausedCmd = null;
|
|
58
62
|
} else {
|
|
63
|
+
socketLogger.warn(`bvtContext.web.pausedCmd is null`);
|
|
59
64
|
if (this.liveExecutionMap.has(cmdId)) {
|
|
60
65
|
const { resolve } = this.liveExecutionMap.get(cmdId);
|
|
61
66
|
if (resolve) {
|
|
@@ -63,6 +68,7 @@ export class BVTStepRunner {
|
|
|
63
68
|
}
|
|
64
69
|
} else {
|
|
65
70
|
console.warn(`No paused command found for cmdId: ${cmdId}`);
|
|
71
|
+
socketLogger.error(`No paused command found for cmdId: ${cmdId}`);
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
}
|
|
@@ -210,6 +216,7 @@ export class BVTStepRunner {
|
|
|
210
216
|
this.sendExecutionStatus({
|
|
211
217
|
type: "cmdExecutionSuccess",
|
|
212
218
|
cmdId: body.cmdId,
|
|
219
|
+
info,
|
|
213
220
|
selectedStrategy: info?.selectedStrategy,
|
|
214
221
|
});
|
|
215
222
|
} else {
|
|
@@ -250,7 +257,7 @@ export class BVTStepRunner {
|
|
|
250
257
|
|
|
251
258
|
try {
|
|
252
259
|
this.#lastAttemptedCmdId = null;
|
|
253
|
-
let cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId);
|
|
260
|
+
let cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
|
|
254
261
|
bvtContext.web.pausedCmd = null;
|
|
255
262
|
|
|
256
263
|
// Clear the liveExecutionMap and set up new entries for this step
|
|
@@ -258,15 +265,29 @@ export class BVTStepRunner {
|
|
|
258
265
|
|
|
259
266
|
for (const cmdId of cmdIDs) {
|
|
260
267
|
this.liveExecutionMap.set(cmdId, {
|
|
261
|
-
resolve: () => {
|
|
262
|
-
reject: () => {
|
|
268
|
+
resolve: () => {},
|
|
269
|
+
reject: () => {},
|
|
263
270
|
});
|
|
264
271
|
}
|
|
265
272
|
|
|
266
273
|
if (bvtContext.web) {
|
|
267
274
|
bvtContext.web.getCmdId = () => {
|
|
268
275
|
if (cmdIDs.length === 0) {
|
|
269
|
-
cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId);
|
|
276
|
+
cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
|
|
277
|
+
}
|
|
278
|
+
const cId = cmdIDs.shift();
|
|
279
|
+
this.sendExecutionStatus({
|
|
280
|
+
type: "cmdExecutionStart",
|
|
281
|
+
cmdId: cId,
|
|
282
|
+
});
|
|
283
|
+
this.#lastAttemptedCmdId = cId;
|
|
284
|
+
return cId;
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
if (bvtContext.api) {
|
|
288
|
+
bvtContext.api.getCmdId = () => {
|
|
289
|
+
if (cmdIDs.length === 0) {
|
|
290
|
+
cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
|
|
270
291
|
}
|
|
271
292
|
const cId = cmdIDs.shift();
|
|
272
293
|
this.sendExecutionStatus({
|
|
@@ -313,6 +334,7 @@ export class BVTStepRunner {
|
|
|
313
334
|
codePage,
|
|
314
335
|
projectDir: this.projectDir,
|
|
315
336
|
stepsDefinitions,
|
|
337
|
+
parametersMap,
|
|
316
338
|
});
|
|
317
339
|
if (codePage) {
|
|
318
340
|
await codePage.save(stepDefsFilePath);
|
|
@@ -373,13 +395,17 @@ export class BVTStepRunner {
|
|
|
373
395
|
this.#currentStepController = null;
|
|
374
396
|
global.__BVT_STEP_ABORT_SIGNAL = null;
|
|
375
397
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
fs.
|
|
398
|
+
try {
|
|
399
|
+
// Clean up temp folder
|
|
400
|
+
const __temp_features_FolderName = process.env.tempFeaturesFolderPath;
|
|
401
|
+
if (__temp_features_FolderName) {
|
|
402
|
+
const tempFolderPath = path.join(this.projectDir, __temp_features_FolderName);
|
|
403
|
+
if (fs.existsSync(tempFolderPath)) {
|
|
404
|
+
fs.rmSync(tempFolderPath, { recursive: true });
|
|
405
|
+
}
|
|
382
406
|
}
|
|
407
|
+
} catch (error) {
|
|
408
|
+
console.error("Error cleaning up temp folder", error);
|
|
383
409
|
}
|
|
384
410
|
}
|
|
385
411
|
}
|