@zohodesk/testinglibrary 0.1.2 → 0.1.3
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.
|
@@ -36,9 +36,20 @@ function getDefaultConfig() {
|
|
|
36
36
|
}
|
|
37
37
|
function combineDefaultConfigWithUserConfig(userConfiguration) {
|
|
38
38
|
let defaultConfig = getDefaultConfig();
|
|
39
|
+
let configurationObj = {};
|
|
40
|
+
Object.keys(userConfiguration).forEach(configKey => {
|
|
41
|
+
let configValue = userConfiguration[configKey];
|
|
42
|
+
if (configValue && configValue !== null) {
|
|
43
|
+
configurationObj[configKey] = configValue;
|
|
44
|
+
} else if (defaultConfig[configKey]) {
|
|
45
|
+
configurationObj[configKey] = defaultConfig[configKey];
|
|
46
|
+
} else {
|
|
47
|
+
_logger.Logger.log(_logger.Logger.INFO_TYPE, `key - ${configKey} is not yet supported in uat configuration. This will not be used while creating playwright configuration`);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
39
50
|
return {
|
|
40
51
|
...defaultConfig,
|
|
41
|
-
...
|
|
52
|
+
...configurationObj
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
55
|
|
|
@@ -20,7 +20,9 @@ const {
|
|
|
20
20
|
expectTimeout,
|
|
21
21
|
testTimeout,
|
|
22
22
|
authFilePath,
|
|
23
|
-
viewport
|
|
23
|
+
viewport,
|
|
24
|
+
featureFilesFolder,
|
|
25
|
+
stepDefinitionsFolder
|
|
24
26
|
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
25
27
|
const projects = (0, _configUtils.getProjects)({
|
|
26
28
|
browsers,
|
|
@@ -30,7 +32,10 @@ const projects = (0, _configUtils.getProjects)({
|
|
|
30
32
|
testTimeout,
|
|
31
33
|
viewport
|
|
32
34
|
});
|
|
33
|
-
const testDir = (0, _configUtils.getTestDir)(bddMode, process.cwd()
|
|
35
|
+
const testDir = (0, _configUtils.getTestDir)(bddMode, process.cwd(), {
|
|
36
|
+
featureFilesFolder,
|
|
37
|
+
stepDefinitionsFolder
|
|
38
|
+
});
|
|
34
39
|
function getPlaywrightConfig() {
|
|
35
40
|
return {
|
|
36
41
|
testDir,
|
|
@@ -98,10 +98,12 @@ function getProjects({
|
|
|
98
98
|
viewport
|
|
99
99
|
})).filter(Boolean);
|
|
100
100
|
}
|
|
101
|
-
function getTestDir(bddMode, cwd
|
|
101
|
+
function getTestDir(bddMode, cwd, {
|
|
102
|
+
stepDefinitionsFolder
|
|
103
|
+
}) {
|
|
102
104
|
return bddMode ? (0, _bddFramework.defineBddConfig)({
|
|
103
105
|
paths: [_path.default.join(cwd, 'uat', '**', '*.feature')],
|
|
104
|
-
import: [_path.default.join(cwd, 'uat', '**',
|
|
106
|
+
import: [_path.default.join(cwd, 'uat', '**', stepDefinitionsFolder, '*.spec.js')],
|
|
105
107
|
featuresRoot: _path.default.join(cwd, 'uat'),
|
|
106
108
|
outputDir: _path.default.join(cwd, 'uat', '.features-gen'),
|
|
107
109
|
publish: true
|
|
@@ -36,7 +36,8 @@ module.exports = {
|
|
|
36
36
|
authFilePath: 'uat/playwright/.auth/user.json',
|
|
37
37
|
trace: true,
|
|
38
38
|
video: true,
|
|
39
|
+
bddMode: true,
|
|
39
40
|
featureFilesFolder: 'feature-files',
|
|
40
41
|
stepDefinitionsFolder: 'steps',
|
|
41
|
-
viewport:
|
|
42
|
+
viewport: { width: 1280, height: 720 }
|
|
42
43
|
}
|
package/changelog.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Framework that abstracts the configuration for playwright and Jest
|
|
4
4
|
|
|
5
|
+
# 0.1.3
|
|
6
|
+
|
|
7
|
+
- uat config sample file updated with `bddMode` and `viewport` values
|
|
8
|
+
- user configuration issue fix when the value is undefined
|
|
9
|
+
|
|
5
10
|
# 0.1.2
|
|
6
11
|
|
|
7
12
|
- Bdd version updated to `5.4.0`
|