@zohodesk/testinglibrary 0.1.8-bdd-27 → 0.1.8-bdd-28

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.
@@ -15,10 +15,10 @@ const {
15
15
  stepDefinitionsFolder
16
16
  } = (0, _readConfigFile.generateConfigFromFile)();
17
17
  function getFeatureFilePath() {
18
- return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', featureFilesFolder || '**', '**', '*.feature'), _getFilePath.isWindows);
18
+ return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', 'modules', '**', featureFilesFolder || '**', '**', '*.feature'), _getFilePath.isWindows);
19
19
  }
20
20
  function getStepFilePath() {
21
- return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', stepDefinitionsFolder || '**', '**', '*.spec.js'), _getFilePath.isWindows);
21
+ return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', 'modules', '**', stepDefinitionsFolder || '**', '**', '*.spec.js'), _getFilePath.isWindows);
22
22
  }
23
23
 
24
24
  /**
@@ -25,35 +25,58 @@ function filterTestData(description, argument) {
25
25
 
26
26
  /** Both Input and Step Table Passed*/
27
27
  if (stepArguments.input && stepArguments.steptable) {
28
- const stepInput = Object.values(stepArguments.currentArgument) || [null];
29
- return [...stepInput, stepArguments.dataTableStep];
28
+ const stepInput = getInputs(stepArguments);
29
+ return [...stepInput, getStepTable(stepArguments)];
30
30
  }
31
31
 
32
32
  /** Input Passed */
33
33
  if (stepArguments.input) {
34
- return Object.values(stepArguments.currentArgument) || [];
34
+ return getInputs(stepArguments);
35
35
  }
36
36
 
37
37
  /** StepTable Passed */
38
38
  if (stepArguments.steptable) {
39
- return [stepArguments.dataTableStep];
39
+ return getStepTable(stepArguments);
40
40
  }
41
41
  /** Scenario Table Passed */
42
42
 
43
43
  if (stepArguments.scenarioTable) {
44
- var exceedParam = stepArguments.inputParameter[0];
45
- const extracted = argument.map(element => {
46
- return exceedParam[element.trim()];
47
- });
48
- const duplicateInput = Object.assign({}, stepArguments);
49
- const extractInput = duplicateInput.inputParameter.shift();
50
- duplicateInput.inputParameter.push(extractInput);
51
- globalTestDataMap.set(description, Object.assign({}, duplicateInput));
52
- return extracted;
44
+ return getScenarioTable(stepArguments, argument);
45
+ // var exceedParam = stepArguments.inputParameter[0];
46
+ // const extracted = argument.map(element => {
47
+ // return exceedParam[element.trim()];
48
+ // });
49
+
50
+ // const duplicateInput = Object.assign({}, stepArguments);
51
+ // const extractInput = duplicateInput.inputParameter.shift();
52
+ // duplicateInput.inputParameter.push(extractInput);
53
+ // globalTestDataMap.set(description, Object.assign({}, duplicateInput));
54
+ // return extracted;
53
55
  }
54
56
  return [];
55
57
  }
56
-
58
+ function getInputs(stepArguments) {
59
+ return Object.values(stepArguments.currentArgument) || [null];
60
+ }
61
+ function getStepTable(stepArguments) {
62
+ const dataTable = {
63
+ raw: () => {
64
+ return stepArguments.stepArguments || [];
65
+ }
66
+ };
67
+ return [dataTable];
68
+ }
69
+ function getScenarioTable(stepArguments, argument) {
70
+ var exceedParam = stepArguments.inputParameter[0];
71
+ const extracted = argument.map(element => {
72
+ return exceedParam[element.trim()];
73
+ });
74
+ const duplicateInput = Object.assign({}, stepArguments);
75
+ const extractInput = duplicateInput.inputParameter.shift();
76
+ duplicateInput.inputParameter.push(extractInput);
77
+ globalTestDataMap.set(description, Object.assign({}, duplicateInput));
78
+ return extracted;
79
+ }
57
80
  /**
58
81
  * get method input but not get it assign and extract
59
82
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.8-bdd-27",
3
+ "version": "0.1.8-bdd-28",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {