@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.
- package/build/bdd-framework/cli/commands/env.js +2 -1
- package/build/bdd-framework/cli/commands/export.js +2 -1
- package/build/bdd-framework/cli/commands/test.js +2 -1
- package/build/bdd-framework/cli/options.js +2 -1
- package/build/bdd-framework/config/index.js +2 -1
- package/build/bdd-framework/decorators.js +8 -4
- package/build/bdd-framework/run/bddFixtures.js +2 -1
- package/build/bdd-framework/snippets/index.js +1 -0
- package/build/bdd-framework/stepDefinitions/createDecorators.js +1 -0
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +1 -0
- package/build/bdd-framework/utils/logger.js +2 -1
- package/build/bdd-poc/core-runner/exportMethods.js +12 -6
- package/build/bdd-poc/core-runner/stepDefinitions.js +1 -3
- package/build/bdd-poc/runner.js +19 -0
- package/build/bdd-poc/test/cucumber/featureFileParer.js +4 -5
- package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +7 -8
- package/build/bdd-poc/test/stepGenerate/stepsnippets.js +2 -1
- package/build/bdd-poc/test/testDataMap.js +2 -2
- package/build/bdd-poc/test/testStructure.js +3 -4
- package/build/core/jest/preprocessor/jsPreprocessor.js +3 -2
- package/build/core/playwright/custom-commands.js +2 -1
- package/build/core/playwright/index.js +3 -1
- package/build/core/playwright/readConfigFile.js +2 -1
- package/build/core/playwright/setup/config-creator.js +10 -7
- package/build/core/playwright/test-runner.js +6 -2
- package/build/index.js +10 -14
- package/build/parser/parser.js +1 -0
- package/build/utils/logger.js +2 -1
- package/build/utils/stepDefinitionsFormatter.js +2 -1
- package/npm-shrinkwrap.json +4 -570
- 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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
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 =
|
|
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);
|
|
@@ -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));
|
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
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 =
|
|
13
|
-
const When =
|
|
14
|
-
const And =
|
|
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
|
|
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 =
|
|
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.
|
|
12
|
-
var matcher = new _gherkin.
|
|
13
|
-
var parser = new _gherkin.
|
|
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,
|
|
14
|
-
const generatedFolderPath = _path.default.resolve(process.cwd(), '
|
|
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,
|
|
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
|
|
26
|
-
_fastGlob.default.globSync(
|
|
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,
|
|
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 =
|
|
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
|
|
22
|
-
await _fastGlob.default.globSync(
|
|
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,
|
|
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
|
-
|
|
19
|
+
currentScenarios.push(_constructStep);
|
|
21
20
|
});
|
|
22
|
-
return (0, _stepsnippets.testFile)(currentScenarios,
|
|
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 =
|
|
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;
|
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
38
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
|
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
|
-
|
|
27
|
-
|
|
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,
|
|
40
|
+
} = (0, _exportMethods.createBdd)();
|
|
45
41
|
exports.Step = Step;
|
|
46
42
|
exports.When = When;
|
|
47
43
|
exports.Then = Then;
|
package/build/parser/parser.js
CHANGED
package/build/utils/logger.js
CHANGED
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.delimiters = void 0;
|
|
7
7
|
exports.findDelimiterFromStep = findDelimiterFromStep;
|
|
8
|
-
const delimiters =
|
|
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
|
}
|