@dev-blinq/cucumber_client 1.0.1475-dev → 1.0.1475-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 +49 -49
- package/bin/assets/scripts/recorder.js +87 -34
- package/bin/assets/scripts/snapshot_capturer.js +10 -17
- package/bin/assets/scripts/unique_locators.js +78 -28
- package/bin/assets/templates/_hooks_template.txt +6 -2
- package/bin/assets/templates/utils_template.txt +16 -16
- package/bin/client/code_cleanup/codemod/find_harcoded_locators.js +173 -0
- package/bin/client/code_cleanup/codemod/fix_hardcoded_locators.js +247 -0
- package/bin/client/code_cleanup/utils.js +16 -7
- package/bin/client/code_gen/code_inversion.js +125 -1
- package/bin/client/code_gen/duplication_analysis.js +2 -1
- package/bin/client/code_gen/function_signature.js +8 -0
- package/bin/client/code_gen/index.js +4 -0
- package/bin/client/code_gen/page_reflection.js +90 -9
- package/bin/client/code_gen/playwright_codeget.js +173 -77
- package/bin/client/codemod/find_harcoded_locators.js +173 -0
- package/bin/client/codemod/fix_hardcoded_locators.js +247 -0
- package/bin/client/codemod/index.js +8 -0
- package/bin/client/codemod/locators_array/find_misstructured_elements.js +148 -0
- package/bin/client/codemod/locators_array/fix_misstructured_elements.js +144 -0
- package/bin/client/codemod/locators_array/index.js +114 -0
- package/bin/client/codemod/types.js +1 -0
- package/bin/client/cucumber/feature.js +4 -17
- package/bin/client/cucumber/steps_definitions.js +17 -12
- package/bin/client/recorderv3/bvt_init.js +310 -0
- package/bin/client/recorderv3/bvt_recorder.js +1560 -1183
- package/bin/client/recorderv3/constants.js +45 -0
- package/bin/client/recorderv3/implemented_steps.js +2 -0
- package/bin/client/recorderv3/index.js +3 -293
- package/bin/client/recorderv3/mixpanel.js +39 -0
- package/bin/client/recorderv3/services.js +839 -142
- package/bin/client/recorderv3/step_runner.js +36 -7
- package/bin/client/recorderv3/step_utils.js +316 -98
- package/bin/client/recorderv3/update_feature.js +85 -37
- package/bin/client/recorderv3/utils.js +80 -0
- package/bin/client/recorderv3/wbr_entry.js +61 -0
- package/bin/client/recording.js +1 -0
- package/bin/client/types/locators.js +2 -0
- package/bin/client/upload-service.js +2 -0
- package/bin/client/utils/app_dir.js +21 -0
- package/bin/client/utils/socket_logger.js +100 -125
- package/bin/index.js +5 -0
- package/package.json +21 -6
- package/bin/client/recorderv3/app_dir.js +0 -23
- package/bin/client/recorderv3/network.js +0 -299
- package/bin/client/recorderv3/scriptTest.js +0 -5
- package/bin/client/recorderv3/ws_server.js +0 -72
|
@@ -67,13 +67,12 @@ export class BVTStepRunner {
|
|
|
67
67
|
resolve();
|
|
68
68
|
}
|
|
69
69
|
} else {
|
|
70
|
-
|
|
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
|
}
|
|
75
74
|
|
|
76
|
-
async copyCodetoTempFolder({ step, parametersMap, tempFolderPath }) {
|
|
75
|
+
async copyCodetoTempFolder({ step, parametersMap, tempFolderPath, AICode }) {
|
|
77
76
|
if (!fs.existsSync(tempFolderPath)) {
|
|
78
77
|
fs.mkdirSync(tempFolderPath);
|
|
79
78
|
}
|
|
@@ -84,6 +83,18 @@ export class BVTStepRunner {
|
|
|
84
83
|
overwrite: true,
|
|
85
84
|
recursive: true,
|
|
86
85
|
});
|
|
86
|
+
|
|
87
|
+
// If AICode is provided, save it as well
|
|
88
|
+
if (AICode) {
|
|
89
|
+
for (const { mjsFileContent, mjsFile } of AICode) {
|
|
90
|
+
const mjsPath = path
|
|
91
|
+
.normalize(mjsFile)
|
|
92
|
+
.split(path.sep)
|
|
93
|
+
.filter((part) => part !== "features")
|
|
94
|
+
.join(path.sep);
|
|
95
|
+
writeFileSync(path.join(tempFolderPath, mjsPath), mjsFileContent);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
async writeTempFeatureFile({ step, parametersMap, tempFolderPath, tags }) {
|
|
@@ -250,7 +261,7 @@ export class BVTStepRunner {
|
|
|
250
261
|
return { result, info };
|
|
251
262
|
}
|
|
252
263
|
|
|
253
|
-
async runStep({ step, parametersMap, envPath, tags, config }, bvtContext, options) {
|
|
264
|
+
async runStep({ step, parametersMap, envPath, tags, config, AICode }, bvtContext, options) {
|
|
254
265
|
// Create a new AbortController for this specific step execution
|
|
255
266
|
this.#currentStepController = new AbortController();
|
|
256
267
|
const { signal } = this.#currentStepController;
|
|
@@ -284,13 +295,27 @@ export class BVTStepRunner {
|
|
|
284
295
|
return cId;
|
|
285
296
|
};
|
|
286
297
|
}
|
|
298
|
+
if (bvtContext.api) {
|
|
299
|
+
bvtContext.api.getCmdId = () => {
|
|
300
|
+
if (cmdIDs.length === 0) {
|
|
301
|
+
cmdIDs = (step.commands || []).map((cmd) => cmd.cmdId ?? cmd.id);
|
|
302
|
+
}
|
|
303
|
+
const cId = cmdIDs.shift();
|
|
304
|
+
this.sendExecutionStatus({
|
|
305
|
+
type: "cmdExecutionStart",
|
|
306
|
+
cmdId: cId,
|
|
307
|
+
});
|
|
308
|
+
this.#lastAttemptedCmdId = cId;
|
|
309
|
+
return cId;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
287
312
|
|
|
288
313
|
const __temp_features_FolderName = "__temp_features" + Math.random().toString(36).substring(2, 7);
|
|
289
314
|
const tempFolderPath = path.join(this.projectDir, __temp_features_FolderName);
|
|
290
315
|
process.env.tempFeaturesFolderPath = __temp_features_FolderName;
|
|
291
316
|
process.env.TESTCASE_REPORT_FOLDER_PATH = tempFolderPath;
|
|
292
317
|
|
|
293
|
-
await this.copyCodetoTempFolder({ step, parametersMap, tempFolderPath });
|
|
318
|
+
await this.copyCodetoTempFolder({ step, parametersMap, tempFolderPath, AICode });
|
|
294
319
|
|
|
295
320
|
// Write abort wrapper code with this step's signal
|
|
296
321
|
await this.writeWrapperCode(tempFolderPath, signal);
|
|
@@ -306,8 +331,11 @@ export class BVTStepRunner {
|
|
|
306
331
|
});
|
|
307
332
|
}
|
|
308
333
|
|
|
309
|
-
if (
|
|
310
|
-
|
|
334
|
+
if (
|
|
335
|
+
step.isUtilStep ||
|
|
336
|
+
((!(step.isImplemented && !step.shouldOverride) || step.shouldMakeStepTextUnique) && step.commands.length > 0)
|
|
337
|
+
) {
|
|
338
|
+
const pageName = generatePageName(step.startFrame?.url ?? "default", step.isUtilStep);
|
|
311
339
|
const stepDefinitionFolderPath = path.join(tempFolderPath, "step_definitions");
|
|
312
340
|
if (!existsSync(stepDefinitionFolderPath)) {
|
|
313
341
|
mkdirSync(stepDefinitionFolderPath, { recursive: true });
|
|
@@ -321,6 +349,7 @@ export class BVTStepRunner {
|
|
|
321
349
|
projectDir: this.projectDir,
|
|
322
350
|
stepsDefinitions,
|
|
323
351
|
parametersMap,
|
|
352
|
+
logger: socketLogger,
|
|
324
353
|
});
|
|
325
354
|
if (codePage) {
|
|
326
355
|
await codePage.save(stepDefsFilePath);
|