@zohodesk/testinglibrary 0.4.74-n18-experimental → 0.4.76-n18-experimental
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/core/playwright/setup/config-creator.js +16 -9
- package/build/core/playwright/setup/config-utils.js +13 -8
- package/build/core/playwright/test-runner.js +1 -1
- package/build/test/Test.js +13 -0
- package/build/utils/fileUtils.js +1 -2
- package/npm-shrinkwrap.json +2467 -2491
- package/package.json +1 -1
- package/test-results/.last-run.json +4 -0
|
@@ -38,9 +38,17 @@ const projects = (0, _configUtils.getProjects)({
|
|
|
38
38
|
testTimeout,
|
|
39
39
|
viewport
|
|
40
40
|
});
|
|
41
|
-
const testDir = (0, _configUtils.getTestDir)(bddMode,
|
|
42
|
-
featureFilesFolder,
|
|
43
|
-
stepDefinitionsFolder
|
|
41
|
+
const testDir = (0, _configUtils.getTestDir)(bddMode, {
|
|
42
|
+
featureFilesFolder: (0, _configUtils.getPathsForFeatureFiles)(process.cwd()),
|
|
43
|
+
stepDefinitionsFolder: _path.default.join(process.cwd(), 'uat', '**', 'steps', '*.spec.js'),
|
|
44
|
+
outputDir: _path.default.join(process.cwd(), 'uat', '.features-gen'),
|
|
45
|
+
uatPath: _path.default.join(process.cwd(), 'uat')
|
|
46
|
+
});
|
|
47
|
+
const smokeTestDir = (0, _configUtils.getTestDir)(bddMode, {
|
|
48
|
+
featureFilesFolder: _path.default.join(process.cwd(), 'uat', 'smokeTest', '**', '*.feature'),
|
|
49
|
+
stepDefinitionsFolder: _path.default.join(process.cwd(), 'uat', 'smokeTest', '**', '*smokeTest.spec.js'),
|
|
50
|
+
outputDir: _path.default.join(process.cwd(), 'uat', '.features-smoke-gen'),
|
|
51
|
+
uatPath: _path.default.join(process.cwd(), 'uat', 'smokeTest')
|
|
44
52
|
});
|
|
45
53
|
const use = {
|
|
46
54
|
trace,
|
|
@@ -69,15 +77,14 @@ function getPlaywrightConfig() {
|
|
|
69
77
|
storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
|
|
70
78
|
};
|
|
71
79
|
const dependencies = isAuthMode ? ['setup'] : [];
|
|
72
|
-
const smokeTestProject =
|
|
80
|
+
const smokeTestProject = {
|
|
73
81
|
name: 'smokeTest',
|
|
74
|
-
|
|
75
|
-
testDir: _path.default.join(process.cwd(), 'uat'),
|
|
82
|
+
testDir: smokeTestDir,
|
|
76
83
|
use: {
|
|
77
84
|
...commonConfig
|
|
78
85
|
},
|
|
79
86
|
dependencies: dependencies
|
|
80
|
-
}
|
|
87
|
+
};
|
|
81
88
|
const playwrightConfig = {
|
|
82
89
|
testDir,
|
|
83
90
|
globalTimeout: globalTimeout || 3600000,
|
|
@@ -94,11 +101,11 @@ function getPlaywrightConfig() {
|
|
|
94
101
|
testMatch: /.*\.setup\.js/,
|
|
95
102
|
testDir: _path.default.join(process.cwd(), 'uat'),
|
|
96
103
|
teardown: 'cleanup'
|
|
97
|
-
}, smokeTestProject, {
|
|
104
|
+
}, ...(isSmokeTest ? [smokeTestProject] : []), {
|
|
98
105
|
name: 'cleanup',
|
|
99
106
|
testMatch: /.*\.teardown\.js/,
|
|
100
107
|
testDir: _path.default.join(process.cwd(), 'uat')
|
|
101
|
-
}, ...projects] : [...projects, smokeTestProject],
|
|
108
|
+
}, ...projects] : [...projects, ...(isSmokeTest ? [smokeTestProject] : [])],
|
|
102
109
|
...uatConfig
|
|
103
110
|
};
|
|
104
111
|
return playwrightConfig;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getBrowsersList = getBrowsersList;
|
|
8
8
|
exports.getModulePathForFeatureFiles = getModulePathForFeatureFiles;
|
|
9
|
+
exports.getPathsForFeatureFiles = getPathsForFeatureFiles;
|
|
9
10
|
exports.getProjects = getProjects;
|
|
10
11
|
exports.getTestDir = getTestDir;
|
|
11
12
|
var _test = require("@playwright/test");
|
|
@@ -35,7 +36,8 @@ function getBrowserConfig({
|
|
|
35
36
|
storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
|
|
36
37
|
};
|
|
37
38
|
// Determine dependencies based on the mode and smoke test status
|
|
38
|
-
|
|
39
|
+
let dependencies = isAuthMode ? ['setup'] : [];
|
|
40
|
+
dependencies = isSmokeTest ? [...dependencies, 'smokeTest'] : dependencies;
|
|
39
41
|
if (browser === 'chrome') {
|
|
40
42
|
return {
|
|
41
43
|
name: _browserTypes.BROWSER_PROJECT_MAPPING.CHROME,
|
|
@@ -167,18 +169,21 @@ function getModulePathForFeatureFiles(moduleList) {
|
|
|
167
169
|
});
|
|
168
170
|
return validModuleList;
|
|
169
171
|
}
|
|
170
|
-
function getTestDir(bddMode,
|
|
171
|
-
|
|
172
|
+
function getTestDir(bddMode, {
|
|
173
|
+
featureFilesFolder,
|
|
174
|
+
stepDefinitionsFolder,
|
|
175
|
+
outputDir,
|
|
176
|
+
uatPath
|
|
172
177
|
}) {
|
|
173
178
|
return bddMode ? (0, _playwrightBdd.defineBddConfig)({
|
|
174
|
-
features:
|
|
175
|
-
steps: [
|
|
179
|
+
features: featureFilesFolder,
|
|
180
|
+
steps: [stepDefinitionsFolder, require.resolve('../fixtures.js')],
|
|
176
181
|
importTestFrom: require.resolve('../fixtures.js'),
|
|
177
|
-
featuresRoot:
|
|
178
|
-
outputDir:
|
|
182
|
+
featuresRoot: uatPath,
|
|
183
|
+
outputDir: outputDir,
|
|
179
184
|
disableWarnings: {
|
|
180
185
|
importTestFrom: true
|
|
181
186
|
},
|
|
182
187
|
publish: true
|
|
183
|
-
}) :
|
|
188
|
+
}) : uatPath;
|
|
184
189
|
}
|
|
@@ -105,7 +105,7 @@ function main() {
|
|
|
105
105
|
//This is only used for pass the user arguments to need places in legacy code. We need to rewamp that also.
|
|
106
106
|
const userArgsObject = userArgConfig.getAll();
|
|
107
107
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
108
|
-
const tagArgs = tagProcessor.processTags(
|
|
108
|
+
const tagArgs = tagProcessor.processTags(uatConfig.getAll());
|
|
109
109
|
const runnerObj = new _Runner.default();
|
|
110
110
|
runnerObj.setTagArgs(tagArgs);
|
|
111
111
|
runnerObj.setUserArgs(userArgsObject);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
delete require.cache[require.resolve('../core/playwright/runner/Runner')];
|
|
4
|
+
function test() {
|
|
5
|
+
const inputString = "@hc";
|
|
6
|
+
const selectedTag = ["@hc_1234"].reverse().find(tag => tag.startsWith(inputString));
|
|
7
|
+
let tagInput = null;
|
|
8
|
+
if (selectedTag) {
|
|
9
|
+
tagInput = selectedTag.split(`${inputString}_`).pop().toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
console.log(tagInput);
|
|
12
|
+
}
|
|
13
|
+
test();
|
package/build/utils/fileUtils.js
CHANGED
|
@@ -14,8 +14,7 @@ var _fs = _interopRequireDefault(require("fs"));
|
|
|
14
14
|
var _path = _interopRequireDefault(require("path"));
|
|
15
15
|
var _logger = require("./logger");
|
|
16
16
|
var glob = _interopRequireWildcard(require("glob"));
|
|
17
|
-
function
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
18
|
function checkIfFileExists(file) {
|
|
20
19
|
try {
|
|
21
20
|
_fs.default.accessSync(file, _fs.default.constants.F_OK);
|