@zohodesk/testinglibrary 0.1.8-stb-bdd-v15 → 0.1.8-stb-bdd-v17
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-poc/errors/throwError.js +15 -0
- package/build/bdd-poc/test/stepGenerate/extractTestInputs.js +1 -1
- package/build/bdd-poc/test/testStructure.js +3 -2
- package/build/core/playwright/index.js +8 -0
- package/build/core/playwright/setup/config-creator.js +1 -1
- package/npm-shrinkwrap.json +4 -4
- package/package.json +4 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.throwNotImplementError = throwNotImplementError;
|
|
7
|
+
var _logger = require("../../utils/logger");
|
|
8
|
+
function throwNotImplementError(step, stepInSpec, keyword) {
|
|
9
|
+
return _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `
|
|
10
|
+
\n ${step} - Not Implemented
|
|
11
|
+
\n ${keyword}(${stepInSpec},async({page}) => {
|
|
12
|
+
\n ..........................................
|
|
13
|
+
\n }
|
|
14
|
+
`);
|
|
15
|
+
}
|
|
@@ -31,7 +31,7 @@ function extractPageFixtures(filePath) {
|
|
|
31
31
|
const trimmedStep = step.trim();
|
|
32
32
|
if (trimmedStep.startsWith('Given') || trimmedStep.startsWith('When') || trimmedStep.startsWith('Then') || trimmedStep.startsWith('And') || trimmedStep.startsWith('Step')) {
|
|
33
33
|
var sortedSpecInput = extractInputFrmStep(trimmedStep, filePath);
|
|
34
|
-
testDataMap.set(extractDescriptionFrmStep(trimmedStep), sortedSpecInput
|
|
34
|
+
testDataMap.set(extractDescriptionFrmStep(trimmedStep), sortedSpecInput);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.extractStepArgument = extractStepArgument;
|
|
7
7
|
exports.testSnippet = testSnippet;
|
|
8
8
|
var _logger = require("../../utils/logger");
|
|
9
|
+
var _throwError = require("../errors/throwError");
|
|
9
10
|
var _stringManipulation = require("../utils/stringManipulation");
|
|
10
11
|
var _stepsnippets = require("./stepGenerate/stepsnippets");
|
|
11
12
|
function testSnippet(parsedFeature, featureFilePath) {
|
|
@@ -51,10 +52,10 @@ function scenarioSnippet(scenario) {
|
|
|
51
52
|
convertedStep,
|
|
52
53
|
currentArgument
|
|
53
54
|
} = extractStepArgument(step.stepDescription);
|
|
54
|
-
var pageFixtureUsed_Step = testDataMap.get(
|
|
55
|
+
var pageFixtureUsed_Step = testDataMap.get(convertedStep) || null;
|
|
55
56
|
/** Step Implementation Check (Walk Through Approach)*/
|
|
56
57
|
if (!pageFixtureUsed_Step) {
|
|
57
|
-
|
|
58
|
+
(0, _throwError.throwNotImplementError)(step.stepDescription, convertedStep, step.keyword);
|
|
58
59
|
process.exit(0);
|
|
59
60
|
}
|
|
60
61
|
currentInputs.push(pageFixtureUsed_Step);
|
|
@@ -23,6 +23,14 @@ const {
|
|
|
23
23
|
// In house BDD testing. so, use playwright test
|
|
24
24
|
let base = _test.test;
|
|
25
25
|
const buildInFixtures = (0, _builtInFixtures.default)(bddMode);
|
|
26
|
+
if (!bddMode) {
|
|
27
|
+
userFixtures = {
|
|
28
|
+
...userFixtures,
|
|
29
|
+
...{
|
|
30
|
+
$tags: ({}, use) => use([])
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
26
34
|
const test = exports.test = base.extend({
|
|
27
35
|
...buildInFixtures,
|
|
28
36
|
...userFixtures
|
|
@@ -36,7 +36,7 @@ const projects = (0, _configUtils.getProjects)({
|
|
|
36
36
|
// const testDir = getTestDir(bddMode, process.cwd(), { featureFilesFolder, stepDefinitionsFolder });
|
|
37
37
|
var testDir = _path.default.resolve(process.cwd(), 'uat', '.feature-gen');
|
|
38
38
|
if (!bddMode) {
|
|
39
|
-
testDir = _path.default.resolve(process.cwd(), 'uat', '
|
|
39
|
+
testDir = _path.default.resolve(process.cwd(), 'uat', 'playwright-TestCase');
|
|
40
40
|
}
|
|
41
41
|
const testOptions = (0, _configUtils.getTestUseOptions)({
|
|
42
42
|
trace,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.1.8-stb-bdd-
|
|
3
|
+
"version": "0.1.8-stb-bdd-v16",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -2333,9 +2333,9 @@
|
|
|
2333
2333
|
"integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA=="
|
|
2334
2334
|
},
|
|
2335
2335
|
"acorn": {
|
|
2336
|
-
"version": "8.11.
|
|
2337
|
-
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.
|
|
2338
|
-
"integrity": "sha512-
|
|
2336
|
+
"version": "8.11.3",
|
|
2337
|
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
|
2338
|
+
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg=="
|
|
2339
2339
|
},
|
|
2340
2340
|
"acorn-globals": {
|
|
2341
2341
|
"version": "7.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.1.8-stb-bdd-
|
|
3
|
+
"version": "0.1.8-stb-bdd-v17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./build/index.js",
|
|
17
|
-
"./
|
|
17
|
+
"./decoraors": "./build/decorators.js"
|
|
18
18
|
},
|
|
19
|
+
"type": "commonjs",
|
|
19
20
|
"keywords": [],
|
|
20
21
|
"author": "",
|
|
21
22
|
"license": "ISC",
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"@babel/polyfill": "7.12.1",
|
|
50
51
|
"@babel/preset-env": "7.22.15",
|
|
51
52
|
"@babel/runtime": "7.22.15",
|
|
53
|
+
"acorn": "^8.11.3",
|
|
52
54
|
"commander": "^11.0.0"
|
|
53
55
|
}
|
|
54
56
|
}
|