@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, isTextVariable, parametersMap }) => {
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
- const replacementToValue = `{${variable}}`;
341
- locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
342
- }
343
- if (isTextVariable) {
344
- const variable = cmd.text.slice(1, -1);
345
- const val = parametersMap[variable];
346
- const replacementFromValue = val.trim();
347
- const replacementToValue = `{${variable}}`;
348
- locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
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 isTextVariable = isVariable(cmd.text);
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 && !isTextVariable) {
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
- isTextVariable,
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
- isTextVariable,
419
+ isTargetValueVariable,
416
420
  parametersMap,
417
421
  });
418
422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1506-dev",
3
+ "version": "1.0.1507-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",