@dev-blinq/cucumber_client 1.0.1457-dev → 1.0.1459-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.
|
@@ -543,7 +543,7 @@ export class CodePage {
|
|
|
543
543
|
if (Object.keys(replacedKeys).length === 0)
|
|
544
544
|
return;
|
|
545
545
|
for (const key in replacedKeys) {
|
|
546
|
-
const regexp = new RegExp(`elements
|
|
546
|
+
const regexp = new RegExp(`elements\\[\\s*["']${key}["']\\s*\\]`, "g");
|
|
547
547
|
this.fileContent = this.fileContent.replace(regexp, () => `elements["${replacedKeys[key]}"]`);
|
|
548
548
|
}
|
|
549
549
|
this.insertElements(mergedElements);
|
|
@@ -696,6 +696,7 @@ class LocalAgent {
|
|
|
696
696
|
stepDiff: stepResult,
|
|
697
697
|
});
|
|
698
698
|
page.removeUnusedElements();
|
|
699
|
+
page.mergeSimilarElements();
|
|
699
700
|
agent.scenarioReport.updateLastStep({
|
|
700
701
|
code: {
|
|
701
702
|
cleanFileNames: page.cleanFileNames,
|
|
@@ -1099,7 +1100,7 @@ class LocalAgent {
|
|
|
1099
1100
|
if (this.context && this.context.web) {
|
|
1100
1101
|
await this.context.web.afterStep(
|
|
1101
1102
|
{
|
|
1102
|
-
attach: (data, mimeType) => {},
|
|
1103
|
+
attach: (data, mimeType) => { },
|
|
1103
1104
|
},
|
|
1104
1105
|
this.cucumberStep
|
|
1105
1106
|
);
|
|
@@ -369,6 +369,10 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
369
369
|
if (!locatorsObject) return step;
|
|
370
370
|
const isValueVariable = isVariable(cmd.value);
|
|
371
371
|
const isTextVariable = isVariable(cmd.text);
|
|
372
|
+
const allStrategyLocators = JSON.parse(JSON.stringify(cmd?.allStrategyLocators ?? null));
|
|
373
|
+
step.locators = locatorsObject;
|
|
374
|
+
step.allStrategyLocators = allStrategyLocators;
|
|
375
|
+
step.isLocatorsAssigned = true;
|
|
372
376
|
|
|
373
377
|
if (!isValueVariable && !isTextVariable) {
|
|
374
378
|
return step;
|
|
@@ -378,7 +382,6 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
378
382
|
step.dataSource = "parameters";
|
|
379
383
|
step.dataKey = convertToIdentifier(cmd.value.slice(1, -1));
|
|
380
384
|
}
|
|
381
|
-
const allStrategyLocators = JSON.parse(JSON.stringify(cmd?.allStrategyLocators ?? null));
|
|
382
385
|
|
|
383
386
|
if (!allStrategyLocators) {
|
|
384
387
|
let locs = locatorsObject.locators;
|
|
@@ -657,6 +660,7 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
|
|
|
657
660
|
}
|
|
658
661
|
|
|
659
662
|
codePage.removeUnusedElements();
|
|
663
|
+
codePage.mergeSimilarElements();
|
|
660
664
|
cucumberStep.methodName = methodName;
|
|
661
665
|
if (generateCodeResult.locatorsMetadata) {
|
|
662
666
|
codePage.addLocatorsMetadata(generateCodeResult.locatorsMetadata);
|