@dev-blinq/cucumber_client 1.0.1506-dev → 1.0.1507-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.
|
@@ -332,20 +332,24 @@ const _parameterizeLocators = (locators, replacementFromValue, replacementToValu
|
|
|
332
332
|
}
|
|
333
333
|
return locators;
|
|
334
334
|
};
|
|
335
|
-
const parameterizeLocators = ({ cmd, locs, isValueVariable,
|
|
335
|
+
const parameterizeLocators = ({ cmd, locs, isValueVariable, isTargetValueVariable, parametersMap }) => {
|
|
336
336
|
if (isValueVariable) {
|
|
337
337
|
const variable = cmd.value.slice(1, -1);
|
|
338
|
-
const val = parametersMap[variable];
|
|
339
|
-
const replacementFromValue = val.trim();
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
const
|
|
348
|
-
|
|
338
|
+
// const val = parametersMap[variable];
|
|
339
|
+
const replacementFromValue = cmd.text.trim().replace(/\s+/, " ") ?? ""; // val.trim();
|
|
340
|
+
if (replacementFromValue.length > 0) {
|
|
341
|
+
const replacementToValue = `{${variable}}`;
|
|
342
|
+
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (isTargetValueVariable) {
|
|
346
|
+
const variable = cmd.targetValue.slice(1, -1);
|
|
347
|
+
// const val = parametersMap[variable];
|
|
348
|
+
const replacementFromValue = cmd.targetText.trim().replace(/\s+/, " ") ?? ""; // val.trim();
|
|
349
|
+
if (replacementFromValue.length > 0) {
|
|
350
|
+
const replacementToValue = `{${variable}}`;
|
|
351
|
+
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
352
|
+
}
|
|
349
353
|
}
|
|
350
354
|
return locs;
|
|
351
355
|
};
|
|
@@ -372,13 +376,13 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
372
376
|
locatorsObject.element_name = element_name;
|
|
373
377
|
|
|
374
378
|
const isValueVariable = isVariable(cmd.value);
|
|
375
|
-
const
|
|
379
|
+
const isTargetValueVariable = isVariable(cmd.targetValue);
|
|
376
380
|
const allStrategyLocators = JSON.parse(JSON.stringify(cmd?.allStrategyLocators ?? null));
|
|
377
381
|
step.locators = locatorsObject;
|
|
378
382
|
step.allStrategyLocators = allStrategyLocators;
|
|
379
383
|
step.isLocatorsAssigned = true;
|
|
380
384
|
|
|
381
|
-
if (!isValueVariable && !
|
|
385
|
+
if (!isValueVariable && !isTargetValueVariable) {
|
|
382
386
|
return step;
|
|
383
387
|
}
|
|
384
388
|
|
|
@@ -393,7 +397,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
393
397
|
cmd,
|
|
394
398
|
locs,
|
|
395
399
|
isValueVariable,
|
|
396
|
-
|
|
400
|
+
isTargetValueVariable,
|
|
397
401
|
parametersMap,
|
|
398
402
|
});
|
|
399
403
|
locatorsObject.locators = locs;
|
|
@@ -412,7 +416,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
412
416
|
cmd,
|
|
413
417
|
locs: locators,
|
|
414
418
|
isValueVariable,
|
|
415
|
-
|
|
419
|
+
isTargetValueVariable,
|
|
416
420
|
parametersMap,
|
|
417
421
|
});
|
|
418
422
|
}
|