@dev-blinq/cucumber_client 1.0.1506-dev → 1.0.1508-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,28 @@ 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
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
338
|
+
// const val = parametersMap[variable];
|
|
339
|
+
if (typeof cmd.text === "string") {
|
|
340
|
+
const replacementFromValue = cmd.text.trim().replace(/\s+/, " ") ?? "" // val.trim();
|
|
341
|
+
if (replacementFromValue.length > 0) {
|
|
342
|
+
const replacementToValue = `{${variable}}`;
|
|
343
|
+
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (isTargetValueVariable) {
|
|
348
|
+
const variable = cmd.targetValue.slice(1, -1);
|
|
349
|
+
// const val = parametersMap[variable];
|
|
350
|
+
if (typeof cmd.targetText === "string") {
|
|
351
|
+
const replacementFromValue = cmd.targetText.trim().replace(/\s+/, " ") ?? "" // val.trim();
|
|
352
|
+
if (replacementFromValue.length > 0) {
|
|
353
|
+
const replacementToValue = `{${variable}}`;
|
|
354
|
+
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
349
357
|
}
|
|
350
358
|
return locs;
|
|
351
359
|
};
|
|
@@ -372,13 +380,13 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
372
380
|
locatorsObject.element_name = element_name;
|
|
373
381
|
|
|
374
382
|
const isValueVariable = isVariable(cmd.value);
|
|
375
|
-
const
|
|
383
|
+
const isTargetValueVariable = isVariable(cmd.targetValue);
|
|
376
384
|
const allStrategyLocators = JSON.parse(JSON.stringify(cmd?.allStrategyLocators ?? null));
|
|
377
385
|
step.locators = locatorsObject;
|
|
378
386
|
step.allStrategyLocators = allStrategyLocators;
|
|
379
387
|
step.isLocatorsAssigned = true;
|
|
380
388
|
|
|
381
|
-
if (!isValueVariable && !
|
|
389
|
+
if (!isValueVariable && !isTargetValueVariable) {
|
|
382
390
|
return step;
|
|
383
391
|
}
|
|
384
392
|
|
|
@@ -393,7 +401,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
393
401
|
cmd,
|
|
394
402
|
locs,
|
|
395
403
|
isValueVariable,
|
|
396
|
-
|
|
404
|
+
isTargetValueVariable,
|
|
397
405
|
parametersMap,
|
|
398
406
|
});
|
|
399
407
|
locatorsObject.locators = locs;
|
|
@@ -412,7 +420,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
412
420
|
cmd,
|
|
413
421
|
locs: locators,
|
|
414
422
|
isValueVariable,
|
|
415
|
-
|
|
423
|
+
isTargetValueVariable,
|
|
416
424
|
parametersMap,
|
|
417
425
|
});
|
|
418
426
|
}
|