@zohodesk/testinglibrary 0.1.8-bdd-26.6 → 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,8 +15,12 @@ const {
15
15
  stepDefinitionsFolder
16
16
  } = (0, _readConfigFile.generateConfigFromFile)();
17
17
  function getFeatureFilePath() {
18
- return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', 'modules', '**', '**', 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', 'modules', '**', '**', stepDefinitionsFolder, '**', '**', '**', '**', '**', '*.spec.js'), _getFilePath.isWindows);
22
- }
21
+ return (0, _stringManipulation.filePathPattern)(_path.default.resolve(process.cwd(), 'uat', 'modules', '**', stepDefinitionsFolder || '**', '**', '*.spec.js'), _getFilePath.isWindows);
22
+ }
23
+
24
+ /**
25
+ * loosly coupled and repo context
26
+ */
@@ -20,6 +20,7 @@ async function createStepsCallBack() {
20
20
  cwd: process.cwd()
21
21
  }).forEach(FilePath => {
22
22
  const specFilePath = _path.default.resolve(process.cwd(), FilePath);
23
+ // Executing spec file to store description and callbacks && Esm Pattern && invoke call
23
24
  require(specFilePath);
24
25
  });
25
26
  }
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createBdd = createBdd;
7
- function Given(description, callback) {
7
+ const Given = Then = When = And = Step = (description, callback) => {
8
8
  globalStepMap.set(description, callback);
9
- }
10
- const Then = Given;
11
- const When = Given;
12
- const And = Given;
13
- const Step = Given;
9
+ };
14
10
  function createBdd() {
15
11
  return {
16
12
  Given,
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createGlobalMaps = createGlobalMaps;
7
7
  var _createCallbacksMap = require("./createCallbacksMap");
8
- var _dataSourceMap = require("../test/cucumber/data-driven/dataSourceMap");
8
+ var _dataSourceMap = require("../gherkin-parser/cucumber/data-driven/dataSourceMap");
9
9
  async function createGlobalMaps() {
10
+ // globalStepMap = stores (description callback)
10
11
  globalThis.globalStepMap = new Map();
11
12
  (0, _createCallbacksMap.createStepsCallBack)();
13
+ // globalTestDataMap For feature Files (parser testdata map)
12
14
  globalThis.globalTestDataMap = await (0, _dataSourceMap.createTestDataMap)();
13
15
  }
@@ -3,13 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createCucumberBDD = createCucumberBDD;
7
- var _createTestCode = require("../test/stepsDefinition/createTestCode");
6
+ exports.preProcessGherkin = preProcessGherkin;
7
+ var _createTestTemplate = require("../gherkin-parser/createTestTemplate");
8
8
  /**
9
9
  * @function
10
10
  * @name createCucumber - start generating Step Files
11
11
  */
12
12
 
13
- function createCucumberBDD() {
14
- (0, _createTestCode.createStepFiles)();
15
- }
13
+ function preProcessGherkin() {
14
+ (0, _createTestTemplate.gherkinParser)();
15
+ }
16
+
17
+ /**
18
+ * feature relates - gherkin
19
+ * steps related - gherkin step
20
+ * developer written - step file
21
+ */
@@ -5,18 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createNativeBDD = createNativeBDD;
7
7
  var _logger = require("../../utils/logger");
8
- function $Given(description) {
8
+ const $Given = $Step = $Then = $When = $And = description => {
9
9
  const stepFunction = globalStepMap.get(description);
10
10
  if (stepFunction === undefined) {
11
11
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Missing Steps Implementation - ${description}`);
12
12
  process.exit(0);
13
13
  }
14
14
  return function (pages, ...argument) {
15
- const stepTestData = getTestData(description, argument);
15
+ const stepTestData = filterTestData(description, argument);
16
16
  return stepFunction(pages, ...stepTestData);
17
17
  };
18
- }
19
- function getTestData(description, argument) {
18
+ };
19
+ function filterTestData(description, argument) {
20
20
  const stepArguments = globalTestDataMap.get(description);
21
21
  if (stepArguments === undefined) {
22
22
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Missing Step - ${description}`);
@@ -25,38 +25,62 @@ function getTestData(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
- const $When = $Given;
57
- const $And = $Given;
58
- const $Then = $Given;
59
- const $Step = $Given;
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
+ }
80
+ /**
81
+ * get method input but not get it assign and extract
82
+ */
83
+
60
84
  function createNativeBDD() {
61
85
  return {
62
86
  $Given,
@@ -20,4 +20,7 @@ function throwProperStepImplementError(filePath, description = "", options = nul
20
20
  \n File : ${filePath}
21
21
  \n MisMatch Steps Pattern !
22
22
  `);
23
- }
23
+ }
24
+
25
+ // name conversion
26
+ // Error info (friendly error msg) and action to solve that issue
@@ -4,23 +4,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.createStepFiles = createStepFiles;
7
+ exports.gherkinParser = gherkinParser;
8
8
  var _fastGlob = _interopRequireDefault(require("fast-glob"));
9
9
  var _path = _interopRequireDefault(require("path"));
10
- var _cucumberSynatxParser = require("../cucumber/cucumberSynatxParser");
11
- var _generateStep = require("../generateStep");
12
- var _fileUtils = require("../../../utils/fileUtils");
13
- var _pathConfig = require("../../config/pathConfig");
14
- var _parserSteps = require("./parserSteps");
10
+ var _cucumberSynatxParser = require("./cucumber/cucumberSynatxParser");
11
+ var _generateStep = require("./stepsDefinition/generateStep");
12
+ var _fileUtils = require("../../utils/fileUtils");
13
+ var _pathConfig = require("../config/pathConfig");
14
+ var _parserStepsArguments = require("./stepsDefinition/parserStepsArguments");
15
15
  // import { createStepDataMap } from './extractTestInputs';
16
16
 
17
- function createStepSnippet(parsedFeatureContent, stepFilename, featureFilePath) {
18
- const stepsFilePath = _path.default.resolve(process.cwd(), 'uat', '.feature-gen', stepFilename);
19
- const stepsSnippets = (0, _generateStep.createTestStructure)(parsedFeatureContent, featureFilePath);
20
- (0, _fileUtils.writeFileContents)(stepsFilePath, stepsSnippets);
21
- }
22
- async function createStepFiles() {
23
- await (0, _parserSteps.traverseASTstep)();
17
+ async function gherkinParser() {
18
+ await (0, _parserStepsArguments.createStepArgumentsMap)();
24
19
  const featureFilePattern = (0, _pathConfig.getFeatureFilePath)();
25
20
  const featureFileFolderPath = _path.default.resolve(process.cwd(), 'uat', '.feature-gen');
26
21
  if (!(0, _fileUtils.checkIfFileExists)(featureFileFolderPath)) {
@@ -35,6 +30,11 @@ async function createStepFiles() {
35
30
  const featurefilePath = _path.default.resolve(process.cwd(), filePath);
36
31
  const parsedFeatureContent = (0, _cucumberSynatxParser.parseFeature)((0, _fileUtils.readFileContents)(featurefilePath, 'utf-8'));
37
32
  const fileName = _path.default.basename(filePath).replace('.feature', '.spec.js');
38
- createStepSnippet(parsedFeatureContent, fileName, filePath);
33
+ generateStepFiles(parsedFeatureContent, fileName, filePath);
39
34
  });
35
+ }
36
+ function generateStepFiles(parsedFeatureContent, stepFilename, featureFilePath) {
37
+ const stepsFilePath = _path.default.resolve(process.cwd(), 'uat', '.feature-gen', stepFilename);
38
+ const testSnippet = (0, _generateStep.createTestSnippet)(parsedFeatureContent, featureFilePath);
39
+ (0, _fileUtils.writeFileContents)(stepsFilePath, testSnippet);
40
40
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.parseFeature = parseFeature;
8
+ exports.testDataExtraction = testDataExtraction;
8
9
  var _cucumber = _interopRequireDefault(require("./cucumber"));
9
10
  function parseFeature(featureFileContent) {
10
11
  var _gherkinDocument$feat;
@@ -21,7 +22,7 @@ function parseFeature(featureFileContent) {
21
22
  gherkinDocument.feature.children.forEach($scenario => {
22
23
  var _$scenario$scenario, _$scenario$scenario2, _$scenario$scenario3, _$scenario$scenario4;
23
24
  var scenarioSteps = {
24
- scenariodescription: "",
25
+ scenarioDescription: "",
25
26
  steps: [],
26
27
  tablebody: false,
27
28
  tableheader: false,
@@ -29,7 +30,7 @@ function parseFeature(featureFileContent) {
29
30
  scenarioTags: [],
30
31
  background: []
31
32
  };
32
- scenarioSteps.scenariodescription = (_$scenario$scenario = $scenario.scenario) === null || _$scenario$scenario === void 0 ? void 0 : _$scenario$scenario.name;
33
+ scenarioSteps.scenarioDescription = (_$scenario$scenario = $scenario.scenario) === null || _$scenario$scenario === void 0 ? void 0 : _$scenario$scenario.name;
33
34
 
34
35
  /** If Feature Has Background it will Assign to Scenario Background of Feature */
35
36
  if ($scenario !== null && $scenario !== void 0 && $scenario.background) {
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createTestDataMap = createTestDataMap;
8
8
  var _fastGlob = _interopRequireDefault(require("fast-glob"));
9
- var _generateStep = require("../../generateStep");
9
+ var _generateStep = require("../../stepsDefinition/generateStep");
10
10
  var _fileUtils = require("../../../../utils/fileUtils");
11
11
  var _path = _interopRequireDefault(require("path"));
12
12
  var _cucumber = _interopRequireDefault(require("../cucumber"));
13
13
  var _pathConfig = require("../../../config/pathConfig");
14
+ var _cucumberSynatxParser = require("../cucumberSynatxParser");
14
15
  function createTestDataMap() {
15
16
  var exampleSteps = [];
16
17
  const globalTestdata = new Map();
@@ -91,7 +92,7 @@ function createTestDataMap() {
91
92
  return exampleHead.value;
92
93
  });
93
94
  });
94
- const inputParameter = testDataExtraction(header, body);
95
+ const inputParameter = (0, _cucumberSynatxParser.testDataExtraction)(header, body);
95
96
  exampleSteps.forEach(step => {
96
97
  $currentExampleSteps.inputParameter = Object.assign([], inputParameter);
97
98
  $currentExampleSteps.scenarioTable = true;
@@ -103,21 +104,6 @@ function createTestDataMap() {
103
104
  resolve(globalTestdata);
104
105
  });
105
106
  }
106
- function testDataExtraction(tableHeader, tableBody) {
107
- const result = [];
108
- if (tableBody && tableHeader) {
109
- tableBody.forEach(array => {
110
- const obj = {};
111
- array.forEach((item, index) => {
112
- obj[`${tableHeader[index].replace(/\s/g, '')}`] = item;
113
- });
114
- result.push(obj);
115
- });
116
- } else {
117
- return;
118
- }
119
- return [...result];
120
- }
121
107
 
122
108
  // handle length of example
123
109
  // if($scenario?.background){
@@ -54,6 +54,9 @@ function extractInputFrmStep(trimmedStep, filePath) {
54
54
  process.exit(0);
55
55
  }
56
56
  }
57
+
58
+ // regex seperation
59
+
57
60
  function extractDescriptionFrmStep(trimmedStep) {
58
61
  var refactoredDescription;
59
62
  if (trimmedStep.match(/\((.*?)\)/g).pop().split('').indexOf(`'`) === 1) {
@@ -3,13 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createTestStructure = createTestStructure;
6
+ exports.createTestSnippet = createTestSnippet;
7
7
  exports.extractStepArgument = extractStepArgument;
8
- var _logger = require("../../utils/logger");
9
- var _throwError = require("../errors/throwError");
10
- var _stringManipulation = require("../utils/stringManipulation");
11
- var _stepsnippets = require("../snippets/stepsnippets");
12
- function createTestStructure(parsedFeature, featureFilePath) {
8
+ var _throwError = require("../../errors/throwError");
9
+ var _stringManipulation = require("../../utils/stringManipulation");
10
+ var _stepsnippets = require("../../snippets/stepsnippets");
11
+ function createTestSnippet(parsedFeature, featureFilePath) {
13
12
  var currentScenarios = [];
14
13
  var $tags = {};
15
14
  parsedFeature.scenarios.forEach(scenario => {
@@ -18,7 +17,7 @@ function createTestStructure(parsedFeature, featureFilePath) {
18
17
  const resultedStep = scenarioSnippet(scenario);
19
18
  currentScenarios.push(resultedStep);
20
19
  });
21
- return (0, _stepsnippets.testFile)(currentScenarios, featureFilePath, $tags);
20
+ return (0, _stepsnippets.createTestFormat)(currentScenarios, featureFilePath, $tags);
22
21
  }
23
22
  function extractStepArgument(step) {
24
23
  var testInputs = [];
@@ -44,6 +43,7 @@ function scenarioSnippet(scenario) {
44
43
  var currentInputs = [];
45
44
  /** To Add BackGround As Steps */
46
45
  if ((scenario === null || scenario === void 0 || (_scenario$background = scenario.background) === null || _scenario$background === void 0 ? void 0 : _scenario$background.length) >= 1) {
46
+ /** if Background will run every scenario (add in before Given, when, Then) */
47
47
  /** Destructed Should be Background will first remaining Step behind */
48
48
  scenario.steps = [...scenario.background, ...scenario.steps];
49
49
  }
@@ -59,11 +59,11 @@ function scenarioSnippet(scenario) {
59
59
  process.exit(0);
60
60
  }
61
61
  currentInputs.push(pageFixtureUsed_Step.stepPageFixtureName);
62
- currentStep.push((0, _stepsnippets.testStep)(step.keyword, convertedStep, pageFixtureUsed_Step.stepPageFixtureName, pageFixtureUsed_Step.stepInputKey.join(','), step.stepDescription));
62
+ currentStep.push((0, _stepsnippets.createStepFormat)(step.keyword, convertedStep, pageFixtureUsed_Step.stepPageFixtureName, pageFixtureUsed_Step.stepInputKey.join(','), step.stepDescription));
63
63
  return;
64
64
  });
65
65
  const pageFixtures = pageFixtureFilter(currentInputs);
66
- return (0, _stepsnippets.testCase)(currentStep, scenario === null || scenario === void 0 ? void 0 : scenario.examples, scenario === null || scenario === void 0 ? void 0 : scenario.scenariodescription, pageFixtures, scenario.scenarioTags);
66
+ return (0, _stepsnippets.describeTest)(currentStep, scenario === null || scenario === void 0 ? void 0 : scenario.examples, scenario === null || scenario === void 0 ? void 0 : scenario.scenarioDescription, pageFixtures, scenario.scenarioTags);
67
67
  }
68
68
  function pageFixtureFilter(pageFixturesArray) {
69
69
  var pageInputs = [];
@@ -87,6 +87,6 @@ function tagHandleFixture(scenario) {
87
87
  return tagsObjects;
88
88
  }
89
89
  return {
90
- [scenario.scenariodescription]: scenario.scenarioTags
90
+ [scenario.scenarioDescription]: scenario.scenarioTags
91
91
  };
92
92
  }
@@ -4,12 +4,22 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.traverseASTstep = traverseASTstep;
7
+ exports.createStepArgumentsMap = createStepArgumentsMap;
8
8
  var _acorn = require("acorn");
9
9
  var _fileUtils = require("../../../utils/fileUtils");
10
10
  var _fastGlob = _interopRequireDefault(require("fast-glob"));
11
11
  var _pathConfig = require("../../config/pathConfig");
12
12
  globalThis.testDataMap = new Map();
13
+ function createStepArgumentsMap() {
14
+ var $promise = [];
15
+ _fastGlob.default.globSync((0, _pathConfig.getStepFilePath)(), {
16
+ dot: true,
17
+ cwd: process.cwd()
18
+ }).forEach(filePath => {
19
+ $promise.push(parseNodeAST((0, _fileUtils.readFileContents)(filePath)));
20
+ });
21
+ Promise.all($promise);
22
+ }
13
23
  async function extractFixtureFrmNode(node) {
14
24
  var stepText;
15
25
  return await new Promise(resolve => {
@@ -51,17 +61,7 @@ function combineAllFixture(fixturesArray) {
51
61
  }
52
62
  return `{${allFixture}${lastFixture}}`;
53
63
  }
54
- function traverseASTstep() {
55
- var $promise = [];
56
- _fastGlob.default.globSync((0, _pathConfig.getStepFilePath)(), {
57
- dot: true,
58
- cwd: process.cwd()
59
- }).forEach(filePath => {
60
- $promise.push(nodeAST((0, _fileUtils.readFileContents)(filePath)));
61
- });
62
- Promise.all($promise);
63
- }
64
- function nodeAST(stepContent) {
64
+ function parseNodeAST(stepContent) {
65
65
  const options = {
66
66
  ecmaVersion: 2020,
67
67
  sourceType: 'module'
@@ -9,16 +9,16 @@ Object.defineProperty(exports, "createBdd", {
9
9
  return _exportMethods.createBdd;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "createCucumberBDD", {
12
+ Object.defineProperty(exports, "createNativeBDD", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _main.createCucumberBDD;
15
+ return _stepRunner.createNativeBDD;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "createNativeBDD", {
18
+ Object.defineProperty(exports, "preProcessGherkin", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _stepRunner.createNativeBDD;
21
+ return _main.preProcessGherkin;
22
22
  }
23
23
  });
24
24
  var _exportMethods = require("./core-runner/exportMethods");
@@ -3,10 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.testCase = testCase;
7
- exports.testFile = testFile;
8
- exports.testStep = testStep;
9
- exports.testSuite = testSuite;
6
+ exports.createStepFormat = createStepFormat;
7
+ exports.createTestFormat = createTestFormat;
8
+ exports.describeTest = describeTest;
10
9
  const TESTING_LIBRARY = '@zohodesk/testinglibrary';
11
10
  function stepReportHandle(Steps, Example) {
12
11
  var _steps = [...Steps];
@@ -19,7 +18,7 @@ function stepReportHandle(Steps, Example) {
19
18
  });
20
19
  return [...resultSteps.split(medium)];
21
20
  }
22
- function testStep(keyword, description, pageFixtureUsed_Step, testData, stepDescription, options) {
21
+ function createStepFormat(keyword, description, pageFixtureUsed_Step, testData, stepDescription, options) {
23
22
  return `await test.step('${keyword.trim()}:${stepDescription.replace(new RegExp(`'`, 'g'), ' ')}',async() => {
24
23
  await $${keyword}("${description}")(${pageFixtureUsed_Step},${testData})
25
24
  })`;
@@ -29,7 +28,7 @@ function testSuite(description, scenariotestBlock, tags, options = null) {
29
28
  ${scenariotestBlock}
30
29
  })`;
31
30
  }
32
- function testCase(steps, examples, description, pageFixtures, tags, option) {
31
+ function describeTest(steps, examples, description, pageFixtures, tags, option) {
33
32
  if (examples.length >= 1) {
34
33
  const exmapleScenario = examples.map(($ele, index) => {
35
34
  var exampleDescription = Object.values($ele).map(val => {
@@ -47,7 +46,7 @@ function testBlock(description, steps, pageFixtures) {
47
46
  ${steps.join(`\n\t`)}
48
47
  })`;
49
48
  }
50
- function testFile(testCase, relativeFilePath, $tags = ' ', options = null) {
49
+ function createTestFormat(testCases, relativeFilePath, $tags = ' ', options = null) {
51
50
  return ` // ${relativeFilePath}
52
51
  import { test, createNativeBDD } from "${TESTING_LIBRARY}";
53
52
  const {$Given,$When,$Then,$And} = createNativeBDD()
@@ -56,6 +55,10 @@ function testFile(testCase, relativeFilePath, $tags = ' ', options = null) {
56
55
  $tags: ({}, use, testInfo) => use(${JSON.stringify($tags)}
57
56
  [testInfo.titlePath.slice(2).join("|")] || [])
58
57
  })
59
- ${testCase.join('')}
58
+ ${testCases.join('')}
60
59
  `;
61
- }
60
+ }
61
+
62
+ /**
63
+ * test templete else snippet
64
+ */
@@ -54,6 +54,10 @@ const testOptions = (0, _configUtils.getTestUseOptions)({
54
54
  */
55
55
  async function getPlaywrightConfig() {
56
56
  (0, _intialize.createGlobalMaps)();
57
+ /**
58
+ * createglobal Map = make it loose coupled
59
+ * expose from bdd parser (From module to core module)
60
+ */
57
61
  // globalThis.globalStepMap = new Map();
58
62
  // createStepsCallBack();
59
63
  // globalThis.globalTestDataMap = await createTestDataMap();
@@ -128,7 +128,7 @@ function main() {
128
128
  const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? require.resolve('./setup/config-creator.js') : require.resolve('../../../playwright.config.js');
129
129
  let promises = [];
130
130
  if (bddMode) {
131
- promises.push((0, _bddPoc.createCucumberBDD)());
131
+ promises.push((0, _bddPoc.preProcessGherkin)());
132
132
  // promises.push(createGlobalMaps());
133
133
  }
134
134
  const args = ['test', '--config', configPath].concat(playwrightArgs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.8-bdd-26.6",
3
+ "version": "0.1.8-bdd-28",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  // @ts-check
2
- const { defineConfig, devices } = require('@playwright/test');
2
+ const { defineConfig, devices } = require('@playwright/test')
3
3
  const path = require('path');
4
4
  const numCPUs = require('os').cpus().length;
5
5