@dev-blinq/cucumber_client 1.0.1382-dev → 1.0.1384-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.
@@ -429,6 +429,50 @@ const invertStableCommand = (call, elements, stepParams) => {
429
429
  }
430
430
  break;
431
431
  }
432
+ case "verifyProperty": {
433
+ step.type = Types.VERIFY_PROPERTY;
434
+ step.element = extractElement(call.arguments[0]);
435
+ const property = call.arguments[1].value;
436
+ const value = parseDataSource(call.arguments[2], stepParams);
437
+ if (value.type === "literal") {
438
+ step.parameters = [property, value.value];
439
+ } else {
440
+ step.dataSource = value.dataSource;
441
+ step.dataKey = value.dataKey;
442
+ step.parameters = [property, toVariableName(value.dataKey)];
443
+ }
444
+ break;
445
+ }
446
+ case "extractProperty": {
447
+ step.type = Types.EXTRACT_PROPERTY;
448
+ step.element = extractElement(call.arguments[0]);
449
+ const attribute = call.arguments[1].value;
450
+ const variable = parseDataSource(call.arguments[2], stepParams);
451
+ if (variable.type === "literal") {
452
+ step.parameters = [attribute, variable.value];
453
+ } else {
454
+ step.dataSource = variable.dataSource;
455
+ step.dataKey = variable.dataKey;
456
+ step.parameters = [attribute, toVariableName(variable.dataKey)];
457
+ }
458
+ if (call.arguments[4].type === "ObjectExpression") {
459
+ const properties = call.arguments[4].properties;
460
+ const regexProp = properties.findIndex((prop) => prop.key.name === "regex");
461
+ if (regexProp !== -1) {
462
+ const regex = properties[regexProp].value.value;
463
+ step.regex = regex;
464
+ }
465
+ const trimSpacesProp = properties.findIndex((prop) => prop.key.name === "trimSpaces");
466
+ if (trimSpacesProp !== -1) {
467
+ const trimSpaces = properties[trimSpacesProp].value.value;
468
+ step.trimSpaces = trimSpaces;
469
+ }
470
+ } else {
471
+ step.regex = "";
472
+ step.trimSpaces = false;
473
+ }
474
+ break;
475
+ }
432
476
  default:
433
477
  return; // Skip if no matching method
434
478
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1382-dev",
3
+ "version": "1.0.1384-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",