@zohodesk/testinglibrary 0.1.8-exp-bdd → 0.1.8-exp-bdd-v2

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.
Files changed (31) hide show
  1. package/build/bdd-framework/cli/commands/env.js +2 -1
  2. package/build/bdd-framework/cli/commands/export.js +2 -1
  3. package/build/bdd-framework/cli/commands/test.js +2 -1
  4. package/build/bdd-framework/cli/options.js +2 -1
  5. package/build/bdd-framework/config/index.js +2 -1
  6. package/build/bdd-framework/decorators.js +8 -4
  7. package/build/bdd-framework/run/bddFixtures.js +2 -1
  8. package/build/bdd-framework/snippets/index.js +1 -0
  9. package/build/bdd-framework/stepDefinitions/createDecorators.js +1 -0
  10. package/build/bdd-framework/stepDefinitions/decorators/steps.js +1 -0
  11. package/build/bdd-framework/utils/logger.js +2 -1
  12. package/build/bdd-poc/core-runner/exportMethods.js +12 -6
  13. package/build/bdd-poc/core-runner/stepDefinitions.js +1 -3
  14. package/build/bdd-poc/runner.js +19 -0
  15. package/build/bdd-poc/test/cucumber/featureFileParer.js +4 -5
  16. package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +7 -8
  17. package/build/bdd-poc/test/stepGenerate/stepsnippets.js +2 -1
  18. package/build/bdd-poc/test/testDataMap.js +2 -2
  19. package/build/bdd-poc/test/testStructure.js +3 -4
  20. package/build/core/jest/preprocessor/jsPreprocessor.js +3 -2
  21. package/build/core/playwright/custom-commands.js +2 -1
  22. package/build/core/playwright/index.js +3 -1
  23. package/build/core/playwright/readConfigFile.js +2 -1
  24. package/build/core/playwright/setup/config-creator.js +10 -7
  25. package/build/core/playwright/test-runner.js +6 -2
  26. package/build/index.js +10 -14
  27. package/build/parser/parser.js +1 -0
  28. package/build/utils/logger.js +2 -1
  29. package/build/utils/stepDefinitionsFormatter.js +2 -1
  30. package/npm-shrinkwrap.json +4 -570
  31. package/package.json +3 -3
@@ -15,7 +15,7 @@ var _loadConfig = require("../../playwright/loadConfig");
15
15
  const logger = new _logger.Logger({
16
16
  verbose: true
17
17
  });
18
- const envCommand = exports.envCommand = new _commander.Command('env').description('Prints environment info').addOption(_options.configOption).action(opts => {
18
+ const envCommand = new _commander.Command('env').description('Prints environment info').addOption(_options.configOption).action(opts => {
19
19
  logger.log(`Playwright-bdd environment info:\n`);
20
20
  logger.log(`platform: ${process.platform}`);
21
21
  logger.log(`node: ${process.version}`);
@@ -24,6 +24,7 @@ const envCommand = exports.envCommand = new _commander.Command('env').descriptio
24
24
  showPackageVersion('@cucumber/cucumber');
25
25
  showPlaywrightConfigPath(opts.config);
26
26
  });
27
+ exports.envCommand = envCommand;
27
28
  function showPackageVersion(packageName) {
28
29
  const version = packageName === 'playwright-bdd' ? getOwnVersion() : (0, _utils.getPackageVersion)(packageName);
29
30
  logger.log(`${packageName}: v${version}`);
@@ -16,7 +16,7 @@ var _gen = require("../../gen");
16
16
  const logger = new _logger.Logger({
17
17
  verbose: true
18
18
  });
19
- const exportCommand = exports.exportCommand = new _commander.Command('export').description('Prints all step definitions').addOption(_options.configOption).action(async opts => {
19
+ const exportCommand = new _commander.Command('export').description('Prints all step definitions').addOption(_options.configOption).action(async opts => {
20
20
  const {
21
21
  resolvedConfigFile
22
22
  } = await (0, _loadConfig.loadConfig)(opts.config);
@@ -25,6 +25,7 @@ const exportCommand = exports.exportCommand = new _commander.Command('export').d
25
25
  (0, _test.assertConfigsCount)(configs);
26
26
  await showStepsForConfigs(configs);
27
27
  });
28
+ exports.exportCommand = exportCommand;
28
29
  async function showStepsForConfigs(configs) {
29
30
  // here we don't need workers (as in test command) because if some step files
30
31
  // are already in node cache, we collected them.
@@ -17,12 +17,13 @@ var _config = require("../../config");
17
17
  var _options = require("../options");
18
18
  var _exit = require("../../utils/exit");
19
19
  const GEN_WORKER_PATH = _path.default.resolve(__dirname, '..', 'worker.js');
20
- const testCommand = exports.testCommand = new _commander.Command('test').description('Generate Playwright test files from Gherkin documents').addOption(_options.configOption).option('--tags <expression>', `Tags expression to filter scenarios for generation`).option('--verbose', `Verbose mode (default: ${Boolean(_config.defaults.verbose)})`).action(async opts => {
20
+ const testCommand = new _commander.Command('test').description('Generate Playwright test files from Gherkin documents').addOption(_options.configOption).option('--tags <expression>', `Tags expression to filter scenarios for generation`).option('--verbose', `Verbose mode (default: ${Boolean(_config.defaults.verbose)})`).action(async opts => {
21
21
  await (0, _loadConfig.loadConfig)(opts.config);
22
22
  const configs = readConfigsFromEnv();
23
23
  mergeCliOptions(configs, opts);
24
24
  await generateFilesForConfigs(configs);
25
25
  });
26
+ exports.testCommand = testCommand;
26
27
  function readConfigsFromEnv() {
27
28
  const configs = Object.values((0, _env.getEnvConfigs)());
28
29
  assertConfigsCount(configs);
@@ -10,10 +10,11 @@ var _commander = require("commander");
10
10
  * Config option moved to separate file as it used in test run.
11
11
  */
12
12
 
13
- const configOption = exports.configOption = new _commander.Option(`-c, --config <file>`, `Path to Playwright configuration file (default: playwright.config.(js|ts))`);
13
+ const configOption = new _commander.Option(`-c, --config <file>`, `Path to Playwright configuration file (default: playwright.config.(js|ts))`);
14
14
  /**
15
15
  * Helper used in test run to detect config location.
16
16
  */
17
+ exports.configOption = configOption;
17
18
  function getCliConfigPath() {
18
19
  return new _commander.Command().allowUnknownOption().addOption(configOption).parse().getOptionValue('config');
19
20
  }
@@ -15,13 +15,14 @@ var _utils = require("../utils");
15
15
  * BDD Config.
16
16
  */
17
17
 
18
- const defaults = exports.defaults = {
18
+ const defaults = {
19
19
  outputDir: '.features-gen',
20
20
  verbose: false,
21
21
  examplesTitleFormat: 'Example #<_index_>',
22
22
  publishQuiet: true,
23
23
  quotes: 'double'
24
24
  };
25
+ exports.defaults = defaults;
25
26
  function defineBddConfig(inputConfig) {
26
27
  const config = getConfig(inputConfig);
27
28
  // In main process store config in env to be accessible by workers
@@ -12,7 +12,11 @@ Object.defineProperty(exports, "Fixture", {
12
12
  exports.When = exports.Then = exports.Step = exports.Given = void 0;
13
13
  var _poms = require("./stepDefinitions/decorators/poms");
14
14
  var _steps = require("./stepDefinitions/decorators/steps");
15
- const Given = exports.Given = (0, _steps.createStepDecorator)('Given');
16
- const When = exports.When = (0, _steps.createStepDecorator)('When');
17
- const Then = exports.Then = (0, _steps.createStepDecorator)('Then');
18
- const Step = exports.Step = (0, _steps.createStepDecorator)('Unknown');
15
+ const Given = (0, _steps.createStepDecorator)('Given');
16
+ exports.Given = Given;
17
+ const When = (0, _steps.createStepDecorator)('When');
18
+ exports.When = When;
19
+ const Then = (0, _steps.createStepDecorator)('Then');
20
+ exports.Then = Then;
21
+ const Step = (0, _steps.createStepDecorator)('Unknown');
22
+ exports.Step = Step;
@@ -13,7 +13,7 @@ var _config = require("../config");
13
13
  var _env = require("../config/env");
14
14
  var _steps = require("../stepDefinitions/decorators/steps");
15
15
  var _dir = require("../config/dir");
16
- const test = exports.test = _test.test.extend({
16
+ const test = _test.test.extend({
17
17
  $bddWorldBase: async ({
18
18
  $tags,
19
19
  $test
@@ -101,6 +101,7 @@ const test = exports.test = _test.test.extend({
101
101
  // eslint-disable-next-line
102
102
  $test: ({}, use) => use(_test.test)
103
103
  });
104
+ exports.test = test;
104
105
  const BDD_AUTO_INJECT_FIXTURES = ['$testInfo', '$test', '$tags'];
105
106
  function isBddAutoInjectFixture(name) {
106
107
  return BDD_AUTO_INJECT_FIXTURES.includes(name);
@@ -30,6 +30,7 @@ class Snippets {
30
30
  this.printFooter(snippets);
31
31
  // exit();
32
32
  }
33
+
33
34
  async createSnippetBuilder() {
34
35
  const {
35
36
  snippetInterface
@@ -65,6 +65,7 @@ function appendDecoratorSteps(supportCodeLibrary) {
65
65
  decoratedSteps.clear();
66
66
  // todo: fill supportCodeLibrary.originalCoordinates as it is used in snippets?
67
67
  }
68
+
68
69
  function getPomNodeByFixtureName(fixtureName) {
69
70
  for (const pomNode of pomGraph.values()) {
70
71
  if (pomNode.fixtureName === fixtureName) return pomNode;
@@ -73,6 +73,7 @@ function appendDecoratorSteps(supportCodeLibrary) {
73
73
  decoratedSteps.clear();
74
74
  // todo: fill supportCodeLibrary.originalCoordinates as it is used in snippets?
75
75
  }
76
+
76
77
  function getFirstNonAutoInjectFixture(fixturesArg, stepConfig) {
77
78
  // there should be exatcly one suitable fixture in fixturesArg
78
79
  const fixtureNames = Object.keys(fixturesArg).filter(fixtureName => !(0, _bddFixtures.isBddAutoInjectFixture)(fixtureName));
@@ -25,4 +25,5 @@ class Logger {
25
25
  }
26
26
  // default logger
27
27
  exports.Logger = Logger;
28
- const logger = exports.logger = new Logger();
28
+ const logger = new Logger();
29
+ exports.logger = logger;
@@ -3,12 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.And = void 0;
7
- exports.Given = Given;
8
- exports.When = exports.Then = void 0;
6
+ exports.createBdd = createBdd;
9
7
  function Given(description, callback) {
10
8
  globalStepMap.set(description, callback);
11
9
  }
12
- const Then = exports.Then = Given;
13
- const When = exports.When = Given;
14
- const And = exports.And = Given;
10
+ const Then = Given;
11
+ const When = Given;
12
+ const And = Given;
13
+ function createBdd() {
14
+ return {
15
+ Given,
16
+ When,
17
+ Then,
18
+ And
19
+ };
20
+ }
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createNativeBDD = createNativeBDD;
7
- var _testDataMap = require("../test/testDataMap");
8
- (0, _testDataMap.testDataCreation)().then(data => globalThis.globalTestdata = data);
9
7
  function $Given(description) {
10
- const stepFunction = globalStepMap[description];
8
+ const stepFunction = globalStepMap.get(description);
11
9
  if (stepFunction === undefined) {
12
10
  process.exit(1);
13
11
  }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.stepFileMap = stepFileMap;
8
+ var _fastGlob = require("fast-glob");
9
+ var _path = _interopRequireDefault(require("path"));
10
+ async function stepFileMap() {
11
+ const actualSpecPattern = _path.default.resolve(process.cwd(), 'uat', 'modules', '**', '**', '**', '**', '**', '**', '**', '**', '*.spec.js').split(`\\`).join('/');
12
+ await (0, _fastGlob.globSync)(actualSpecPattern, {
13
+ dot: true,
14
+ cwd: process.cwd()
15
+ }).forEach(FilePath => {
16
+ const specFilePath = _path.default.resolve(process.cwd(), FilePath);
17
+ require(specFilePath);
18
+ });
19
+ }
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.parseFeature = parseFeature;
8
- var _gherkin = _interopRequireDefault(require("@cucumber/gherkin"));
7
+ var _gherkin = require("@cucumber/gherkin");
9
8
  var _messages = require("@cucumber/messages");
10
9
  var uuidFn = _messages.IdGenerator.uuid();
11
- var builder = new _gherkin.default.AstBuilder(uuidFn);
12
- var matcher = new _gherkin.default.GherkinClassicTokenMatcher();
13
- var parser = new _gherkin.default.Parser(builder, matcher);
10
+ var builder = new _gherkin.AstBuilder(uuidFn);
11
+ var matcher = new _gherkin.GherkinClassicTokenMatcher();
12
+ var parser = new _gherkin.Parser(builder, matcher);
14
13
  function parseFeature(featureFileContent) {
15
14
  var _gherkinDocument$feat;
16
15
  var gherkinDocument = parser.parse(featureFileContent);
@@ -10,27 +10,26 @@ var _fastGlob = _interopRequireDefault(require("fast-glob"));
10
10
  var _path = _interopRequireDefault(require("path"));
11
11
  var _featureFileParer = require("../cucumber/featureFileParer");
12
12
  var _testStructure = require("../testStructure");
13
- async function stepFileCreation(featureContent, stepFilename, constructedFilePath) {
14
- const generatedFolderPath = _path.default.resolve(process.cwd(), './feature-gen');
13
+ async function stepFileCreation(featureContent, stepFilename, featureFilePath) {
14
+ const generatedFolderPath = _path.default.resolve(process.cwd(), 'uat', 'feature-gen');
15
15
  if (!(0, _fs.existsSync)(generatedFolderPath)) {
16
16
  (0, _fs.mkdirSync)('./feature-gen', {
17
17
  recursive: true
18
18
  });
19
19
  }
20
- const stepsFilePath = _path.default.resolve(process.cwd(), 'feature-gen', stepFilename);
21
- const stepsSnippets = (0, _testStructure.testSnippet)(featureContent, constructedFilePath);
20
+ const stepsFilePath = _path.default.resolve(process.cwd(), 'uat', 'feature-gen', stepFilename);
21
+ const stepsSnippets = (0, _testStructure.testSnippet)(featureContent, featureFilePath);
22
22
  await (0, _fs.writeFileSync)(stepsFilePath, stepsSnippets);
23
23
  }
24
24
  function generateSpecFiles() {
25
- const featureFilePath = _path.default.resolve(process.cwd(), 'uat', 'modules', '**', '**', '**', '**', '**', '**', '**', '**', '*.feature').split(`\\`).join('/');
26
- _fastGlob.default.globSync(featureFilePath, {
25
+ const featureFilePattern = _path.default.resolve(process.cwd(), 'uat', 'modules', '**', '**', '**', '**', '**', '**', '**', '**', '*.feature').split(`\\`).join('/');
26
+ _fastGlob.default.globSync(featureFilePattern, {
27
27
  dot: true,
28
28
  cwd: process.cwd()
29
29
  }).forEach(filePath => {
30
- console.log(filePath);
31
30
  const featurefilePath = _path.default.resolve(process.cwd(), filePath);
32
31
  const featureContent = (0, _featureFileParer.parseFeature)((0, _fs.readFileSync)(featurefilePath, 'utf-8'));
33
32
  const fileName = _path.default.basename(filePath).replace('.feature', '.spec.js');
34
- stepFileCreation(featureContent, fileName, featureFilePath);
33
+ stepFileCreation(featureContent, fileName, filePath);
35
34
  });
36
35
  }
@@ -8,7 +8,8 @@ exports.testCase = testCase;
8
8
  exports.testFile = testFile;
9
9
  exports.testStep = testStep;
10
10
  exports.testSuite = testSuite;
11
- const TESTING_LIBRARY = exports.TESTING_LIBRARY = '@zohodesk/testinglibrary';
11
+ const TESTING_LIBRARY = '@zohodesk/testinglibrary';
12
+ exports.TESTING_LIBRARY = TESTING_LIBRARY;
12
13
  function testStep(keyword, description, browserObject, testData, options) {
13
14
  return `await $${keyword}('${description}')(${browserObject},${testData})\n`;
14
15
  }
@@ -18,8 +18,8 @@ async function testDataCreation() {
18
18
  var parser = new _gherkin.default.Parser(builder, matcher);
19
19
  var exampleSteps = [];
20
20
  const globalTestdata = new Map();
21
- const featurePath = _path.default.resolve('uat', 'modules', '**', '**', '**', '**', '**', '*.feature');
22
- await _fastGlob.default.globSync([featurePath], {
21
+ const actualStepFilePath = _path.default.resolve('uat', 'modules', '**', '**', '**', '**', '**', '*.spec.js').split('\\').join('/');
22
+ await _fastGlob.default.globSync(actualStepFilePath, {
23
23
  dot: true,
24
24
  cwd: process.cwd()
25
25
  }).forEach(filePath => {
@@ -12,14 +12,13 @@ var _fs = require("fs");
12
12
  var _stringManipulation = require("../utils/stringManipulation");
13
13
  var _stepsnippets = require("./stepGenerate/stepsnippets");
14
14
  const inputsParamterMap = new Map();
15
- function testSnippet(featureContent, constructedFilePath) {
16
- const relativeFilePath = _path.default.relative(process.cwd(), constructedFilePath);
15
+ function testSnippet(featureContent, featureFilePath) {
17
16
  var currentScenarios = [];
18
17
  featureContent.scenarios.forEach(scenario => {
19
18
  const _constructStep = scenarioSnippet(scenario);
20
- currentScenarioss.push(_constructStep);
19
+ currentScenarios.push(_constructStep);
21
20
  });
22
- return (0, _stepsnippets.testFile)(currentScenarios, relativeFilePath);
21
+ return (0, _stepsnippets.testFile)(currentScenarios, featureFilePath);
23
22
  }
24
23
  function extactStepArgs(step) {
25
24
  var inputParam = [];
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _babelJest = _interopRequireDefault(require("babel-jest"));
9
- var _default = exports.default = _babelJest.default.createTransformer({
9
+ var _default = _babelJest.default.createTransformer({
10
10
  presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')],
11
11
  plugins: [require.resolve('babel-plugin-transform-dynamic-import')]
12
- });
12
+ });
13
+ exports.default = _default;
@@ -4,4 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CUSTOM_COMMANDS = void 0;
7
- const CUSTOM_COMMANDS = exports.CUSTOM_COMMANDS = ['mode', 'tags'];
7
+ const CUSTOM_COMMANDS = ['mode', 'tags'];
8
+ exports.CUSTOM_COMMANDS = CUSTOM_COMMANDS;
@@ -55,7 +55,7 @@ const {
55
55
  bddMode
56
56
  } = (0, _readConfigFile.generateConfigFromFile)();
57
57
  let base = bddMode ? _bddFramework.test : _test.test;
58
- const test = exports.test = base.extend({
58
+ const test = base.extend({
59
59
  page: async ({
60
60
  page
61
61
  }, use) => {
@@ -91,6 +91,7 @@ const test = exports.test = base.extend({
91
91
  // await page;
92
92
  // });
93
93
  },
94
+
94
95
  context: async ({
95
96
  context
96
97
  }, use) => {
@@ -100,6 +101,7 @@ const test = exports.test = base.extend({
100
101
  },
101
102
  ...additionalPages
102
103
  });
104
+ exports.test = test;
103
105
  const {
104
106
  Given,
105
107
  When,
@@ -11,7 +11,8 @@ exports.isUserConfigFileAvailable = isUserConfigFileAvailable;
11
11
  var _fs = require("fs");
12
12
  var _path = _interopRequireDefault(require("path"));
13
13
  var _logger = require("../../utils/logger");
14
- const fileName = exports.fileName = 'uat.config.js';
14
+ const fileName = 'uat.config.js';
15
+ exports.fileName = fileName;
15
16
  function getDefaultConfig() {
16
17
  return {
17
18
  browsers: ['Chrome'],
@@ -9,8 +9,8 @@ var _test = require("@playwright/test");
9
9
  var _path = _interopRequireDefault(require("path"));
10
10
  var _readConfigFile = require("../readConfigFile");
11
11
  var _configUtils = require("./config-utils");
12
- var _main = require("../../../bdd-poc/main");
13
12
  var _testDataMap = require("../../../bdd-poc/test/testDataMap");
13
+ var _runner = require("../../../bdd-poc/runner");
14
14
  const {
15
15
  browsers,
16
16
  trace,
@@ -34,12 +34,14 @@ const projects = (0, _configUtils.getProjects)({
34
34
  testTimeout,
35
35
  viewport
36
36
  });
37
- const testDir = (0, _configUtils.getTestDir)(bddMode, process.cwd(), {
38
- featureFilesFolder,
39
- stepDefinitionsFolder
40
- });
37
+ // const testDir = getTestDir(bddMode, process.cwd(), { featureFilesFolder, stepDefinitionsFolder });
38
+ const testDir = _path.default.resolve(process.cwd(), 'uat', 'feature-gen');
41
39
  function getPlaywrightConfig() {
42
- (0, _main.cucumberBDDtoTestFile)();
40
+ globalThis.globalStepMap = new Map();
41
+ (0, _runner.stepFileMap)();
42
+ (0, _testDataMap.testDataCreation)().then(inputs => {
43
+ globalThis.globalTestdata = inputs;
44
+ });
43
45
  return {
44
46
  testDir,
45
47
  outputDir: _path.default.join(process.cwd(), 'uat', 'test-results'),
@@ -72,4 +74,5 @@ function getPlaywrightConfig() {
72
74
  }, ...projects] : [...projects]
73
75
  };
74
76
  }
75
- var _default = exports.default = (0, _test.defineConfig)(getPlaywrightConfig());
77
+ var _default = (0, _test.defineConfig)(getPlaywrightConfig());
78
+ exports.default = _default;
@@ -13,6 +13,7 @@ var _envInitializer = require("./env-initializer");
13
13
  var _logger = require("../../utils/logger");
14
14
  var _readConfigFile = require("./readConfigFile");
15
15
  var _rootPath = require("../../utils/rootPath");
16
+ var _main = require("../../bdd-poc/main");
16
17
  function parseUserArgs() {
17
18
  return (0, _cliArgsToObject.cliArgsToObject)(process.argv.slice(2));
18
19
  }
@@ -101,11 +102,14 @@ function main() {
101
102
  const args = ['test', '--config', configPath].concat(playwrightArgs);
102
103
  let promises = [];
103
104
  if (bddMode) {
104
- promises.push(runPreprocessing(tagArgs, configPath));
105
+ (0, _main.cucumberBDDtoTestFile)();
106
+ // promises.push(runPreprocessing(tagArgs, configPath));
105
107
  }
108
+
106
109
  Promise.all(promises).then(() => runPlaywright(command, args)).catch(err => {
107
110
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, err);
108
111
  process.exit();
109
112
  });
110
113
  }
111
- var _default = exports.default = main;
114
+ var _default = main;
115
+ exports.default = _default;
package/build/index.js CHANGED
@@ -7,7 +7,13 @@ exports.When = exports.Then = exports.Step = exports.Given = void 0;
7
7
  Object.defineProperty(exports, "createBdd", {
8
8
  enumerable: true,
9
9
  get: function () {
10
- return _index.createBdd;
10
+ return _exportMethods.createBdd;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "createNativeBDD", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _stepDefinitions.createNativeBDD;
11
17
  }
12
18
  });
13
19
  Object.defineProperty(exports, "expect", {
@@ -23,25 +29,15 @@ Object.defineProperty(exports, "test", {
23
29
  }
24
30
  });
25
31
  var _index = require("./core/playwright/index");
26
- // const { expect, test, createBdd } = require('./core/playwright/index');
27
- // const { fireEvent, render } = require('@testing-library/react');
28
-
29
- // module.exports = {
30
- // expect,
31
- // test,
32
- // fireEvent,
33
- // render,
34
- // createBdd
35
- // }
36
-
32
+ var _exportMethods = require("./bdd-poc/core-runner/exportMethods");
33
+ var _stepDefinitions = require("./bdd-poc/core-runner/stepDefinitions");
37
34
  // import { fireEvent, render } from '@testing-library/react';
38
- globalThis.globalStepMap = new Map();
39
35
  const {
40
36
  Given,
41
37
  Then,
42
38
  When,
43
39
  Step
44
- } = (0, _index.createBdd)();
40
+ } = (0, _exportMethods.createBdd)();
45
41
  exports.Step = Step;
46
42
  exports.When = When;
47
43
  exports.Then = Then;
@@ -108,6 +108,7 @@ function generateSpecFileContent({
108
108
  });
109
109
  //specContent += `});\n\n`;
110
110
  }
111
+
111
112
  return specContent;
112
113
  }
113
114
  function updateExistingSpecFile({
@@ -54,4 +54,5 @@ class LoggerImpl {
54
54
  this.consoleLogger.log(`${color[0]}${message}${color[1]}`);
55
55
  }
56
56
  }
57
- const Logger = exports.Logger = new LoggerImpl();
57
+ const Logger = new LoggerImpl();
58
+ exports.Logger = Logger;
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.delimiters = void 0;
7
7
  exports.findDelimiterFromStep = findDelimiterFromStep;
8
- const delimiters = exports.delimiters = ["Given", "When", "Then", "And"];
8
+ const delimiters = ["Given", "When", "Then", "And"];
9
+ exports.delimiters = delimiters;
9
10
  function findDelimiterFromStep(step) {
10
11
  return delimiters.find(delimiter => step.includes(delimiter));
11
12
  }