@zohodesk/testinglibrary 0.2.5 → 0.2.6
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.
|
@@ -21,7 +21,7 @@ function addHelperLogsForEnvInitialization() {
|
|
|
21
21
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Please specify --mode='dev/prod' while running ZDTestingFramework test`);
|
|
22
22
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Going to use default mode as dev`);
|
|
23
23
|
}
|
|
24
|
-
function initializeEnvConfig(mode) {
|
|
24
|
+
function initializeEnvConfig(mode, isAuthMode) {
|
|
25
25
|
try {
|
|
26
26
|
if (!mode) {
|
|
27
27
|
addHelperLogsForEnvInitialization();
|
|
@@ -33,9 +33,6 @@ function initializeEnvConfig(mode) {
|
|
|
33
33
|
...configJSON,
|
|
34
34
|
mode
|
|
35
35
|
});
|
|
36
|
-
const {
|
|
37
|
-
isAuthMode
|
|
38
|
-
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
39
36
|
if (isAuthMode) {
|
|
40
37
|
const defaultActorConfiguration = (0, _getUsers.getDefaultActorConf)();
|
|
41
38
|
setEnvironmentVariables(defaultActorConfiguration);
|
|
@@ -31,12 +31,8 @@ function isDevelopmentSetup() {
|
|
|
31
31
|
}
|
|
32
32
|
function getDefaultActorConf() {
|
|
33
33
|
const {
|
|
34
|
-
uatDirectory
|
|
35
|
-
isAuthMode
|
|
34
|
+
uatDirectory
|
|
36
35
|
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
37
|
-
if (!isAuthMode) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
36
|
const defaultSettingFile = `conf/${getRunMode()}/settings.json`;
|
|
41
37
|
const filePath = _path.default.join(uatDirectory, defaultSettingFile);
|
|
42
38
|
if (!(0, _fs.existsSync)(filePath)) {
|
|
@@ -53,15 +49,8 @@ function getDefaultActor() {
|
|
|
53
49
|
}
|
|
54
50
|
function getListOfActors() {
|
|
55
51
|
const {
|
|
56
|
-
uatDirectory
|
|
57
|
-
isAuthMode
|
|
52
|
+
uatDirectory
|
|
58
53
|
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
59
|
-
if (!isAuthMode) {
|
|
60
|
-
return {
|
|
61
|
-
editions: [],
|
|
62
|
-
beta: []
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
54
|
const mode = getRunMode();
|
|
66
55
|
const configFile = `conf/${mode}/actors/index`;
|
|
67
56
|
const filePath = _path.default.join(uatDirectory, configFile);
|
|
@@ -71,12 +60,6 @@ function getListOfActors() {
|
|
|
71
60
|
return require(filePath);
|
|
72
61
|
}
|
|
73
62
|
function getUserForSelectedEditionAndProfile(preferedEdition, preferredProfile, betaFeature, testDataPortal = null) {
|
|
74
|
-
const {
|
|
75
|
-
isAuthMode
|
|
76
|
-
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
77
|
-
if (!isAuthMode) {
|
|
78
|
-
return {};
|
|
79
|
-
}
|
|
80
63
|
const {
|
|
81
64
|
editions: userdata,
|
|
82
65
|
beta: betaPortals
|
|
@@ -98,13 +98,15 @@ function runPlaywright(command, args) {
|
|
|
98
98
|
}
|
|
99
99
|
function main() {
|
|
100
100
|
const userArgsObject = (0, _parseUserArgs.default)();
|
|
101
|
-
(0,
|
|
101
|
+
const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
|
|
102
102
|
const {
|
|
103
103
|
debug,
|
|
104
104
|
bddMode = false,
|
|
105
105
|
headless = false,
|
|
106
|
-
editionOrder
|
|
107
|
-
|
|
106
|
+
editionOrder,
|
|
107
|
+
isAuthMode
|
|
108
|
+
} = uatConfig;
|
|
109
|
+
(0, _envInitializer.initializeEnvConfig)(userArgsObject.mode, isAuthMode);
|
|
108
110
|
const tagArgs = (0, _tagProcessor.tagProcessor)(userArgsObject, editionOrder);
|
|
109
111
|
const playwrightArgs = getPlaywrightArgs(userArgsObject, debug, bddMode, tagArgs, headless);
|
|
110
112
|
const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
|