@zohodesk/testinglibrary 0.1.8-stb-bdd-v3 → 0.1.8-stb-bdd-v4
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.
|
@@ -11,7 +11,9 @@ exports.testStep = testStep;
|
|
|
11
11
|
exports.testSuite = testSuite;
|
|
12
12
|
const TESTING_LIBRARY = exports.TESTING_LIBRARY = '@zohodesk/testinglibrary';
|
|
13
13
|
function testStep(keyword, description, browserObject, testData, options) {
|
|
14
|
-
return `
|
|
14
|
+
return `test.step("${keyword} ${description}",async() => {
|
|
15
|
+
await $${keyword}('${description}')(${browserObject},${testData})
|
|
16
|
+
})`;
|
|
15
17
|
}
|
|
16
18
|
function testSuite(description, scenariotestBlock, tags, options = null) {
|
|
17
19
|
return `\ntest.describe('${description}${tags.join(" ")}', () => {
|
|
@@ -8,7 +8,6 @@ exports.testSnippet = testSnippet;
|
|
|
8
8
|
var _stringManipulation = require("../utils/stringManipulation");
|
|
9
9
|
var _stepsnippets = require("./stepGenerate/stepsnippets");
|
|
10
10
|
function testSnippet(featureContent, featureFilePath) {
|
|
11
|
-
var _featureContent$featu;
|
|
12
11
|
var currentScenarios = [];
|
|
13
12
|
var $tags = {};
|
|
14
13
|
featureContent.scenarios.forEach(scenario => {
|
|
@@ -17,9 +16,9 @@ function testSnippet(featureContent, featureFilePath) {
|
|
|
17
16
|
const _constructStep = scenarioSnippet(scenario);
|
|
18
17
|
currentScenarios.push(_constructStep);
|
|
19
18
|
});
|
|
20
|
-
if
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
// if(featureContent.featureBackGround?.length){
|
|
20
|
+
// return testFile(currentScenarios,featureFilePath,$tags,backgroundHandle(featureContent.featureBackGround))
|
|
21
|
+
// }
|
|
23
22
|
return (0, _stepsnippets.testFile)(currentScenarios, featureFilePath, $tags);
|
|
24
23
|
}
|
|
25
24
|
function extactStepArgs(step) {
|
|
@@ -41,8 +40,13 @@ function extactStepArgs(step) {
|
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
function scenarioSnippet(scenario) {
|
|
43
|
+
var _scenario$background;
|
|
44
44
|
var currentStep = [];
|
|
45
45
|
var currentInputs = [];
|
|
46
|
+
// To Add BackGround As Steps :
|
|
47
|
+
if ((scenario === null || scenario === void 0 || (_scenario$background = scenario.background) === null || _scenario$background === void 0 ? void 0 : _scenario$background.length) >= 1) {
|
|
48
|
+
scenario.steps = [...scenario.background, ...scenario.steps];
|
|
49
|
+
}
|
|
46
50
|
scenario.steps.forEach(step => {
|
|
47
51
|
var {
|
|
48
52
|
refactoredStep,
|
|
@@ -81,6 +85,20 @@ function handleInputTags(scenario) {
|
|
|
81
85
|
[scenario.scenariodescription]: scenario.scenarioTags
|
|
82
86
|
};
|
|
83
87
|
}
|
|
88
|
+
|
|
89
|
+
// function backGroundStep(backGroundScenario){
|
|
90
|
+
// const currentBackGroundStep = []
|
|
91
|
+
// const backgroundStepInput = []
|
|
92
|
+
// backGroundScenario.background.forEach((backGroundStep) => {
|
|
93
|
+
// var { refactoredStep, currentArgument } = extactStepArgs(backGroundStep.stepDescription);
|
|
94
|
+
// var input = inputsParamterMap.get(`'${refactoredStep}'`);
|
|
95
|
+
// backgroundStepInput.push(input)
|
|
96
|
+
// currentBackGroundStep.push(testStep(backGroundStep.keyword, refactoredStep, input, currentArgument.join(',')));
|
|
97
|
+
// return;
|
|
98
|
+
// })
|
|
99
|
+
// return
|
|
100
|
+
// }
|
|
101
|
+
|
|
84
102
|
function backgroundHandle(background) {
|
|
85
103
|
const currentBackground = [];
|
|
86
104
|
const backgroundInput = [];
|