@zohodesk/testinglibrary 0.1.8-stb-bdd-v19 → 0.1.8-stb-bdd-v20

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.
@@ -36,8 +36,14 @@ function extractPageFixtures(filePath) {
36
36
  });
37
37
  }
38
38
  function extractInputFrmStep(trimmedStep, filePath) {
39
+ var toRemovePattern = trimmedStep.match(/async\s*\(([^)]*)\)/)[1].match(/{(.*?)}/);
40
+ var InputNames = trimmedStep.match(/async\s*\(([^)]*)\)/)[1].replace(toRemovePattern[0], "$null") || [];
39
41
  try {
40
- return trimmedStep.split(' ').slice(1).join('').match(/\((.*?)\)/)[1].match(/\{(.*?)\}/g).pop() || [""].pop();
42
+ var _InputNames$split;
43
+ return {
44
+ stepPageFixtureName: trimmedStep.split(' ').slice(1).join('').match(/\((.*?)\)/)[1].match(/\{(.*?)\}/g).pop() || [false].pop(),
45
+ stepInputKey: ((_InputNames$split = InputNames.split(',')) === null || _InputNames$split === void 0 || (_InputNames$split = _InputNames$split.slice(1)) === null || _InputNames$split === void 0 ? void 0 : _InputNames$split.map(input => `"${input}"`)) || []
46
+ };
41
47
  } catch (error) {
42
48
  // Logger.log(Logger.FAILURE_TYPE,`${filePath} - Steps Has MisMatched Pattern`)
43
49
  (0, _throwError.throwProperStepImplementError)(filePath);
@@ -54,12 +54,12 @@ function scenarioSnippet(scenario) {
54
54
  } = extractStepArgument(step.stepDescription);
55
55
  var pageFixtureUsed_Step = testDataMap.get(convertedStep) || null;
56
56
  /** Step Implementation Check (Walk Through Approach)*/
57
- if (!pageFixtureUsed_Step) {
57
+ if (!pageFixtureUsed_Step.stepPageFixtureName) {
58
58
  (0, _throwError.throwNotImplementError)(step.stepDescription, convertedStep, step.keyword);
59
59
  process.exit(0);
60
60
  }
61
- currentInputs.push(pageFixtureUsed_Step);
62
- currentStep.push((0, _stepsnippets.testStep)(step.keyword, convertedStep, pageFixtureUsed_Step, currentArgument.join(','), step.stepDescription));
61
+ currentInputs.push(pageFixtureUsed_Step.stepPageFixtureName);
62
+ currentStep.push((0, _stepsnippets.testStep)(step.keyword, convertedStep, pageFixtureUsed_Step.stepPageFixtureName, pageFixtureUsed_Step.stepInputKey.join(','), step.stepDescription));
63
63
  return;
64
64
  });
65
65
  const pageFixtures = pageFixtureFilter(currentInputs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.8-stb-bdd-v19",
3
+ "version": "0.1.8-stb-bdd-v20",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {