artes 1.1.27 → 1.1.29
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/cucumber.config.js
CHANGED
|
@@ -117,11 +117,14 @@ module.exports = {
|
|
|
117
117
|
worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
|
|
118
118
|
},
|
|
119
119
|
env: process.env.ENV
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
? JSON.parse(process.env.ENV)
|
|
121
|
+
: (typeof artesConfig.baseURL === "object" && artesConfig.baseURL !== null
|
|
122
|
+
? (
|
|
123
|
+
artesConfig.env && artesConfig.baseURL.hasOwnProperty(artesConfig.env.trim())
|
|
124
|
+
? artesConfig.env.trim()
|
|
125
|
+
: Object.keys(artesConfig.baseURL)[0]
|
|
126
|
+
)
|
|
127
|
+
: (artesConfig.env || "")),
|
|
125
128
|
baseURL: process.env.BASE_URL
|
|
126
129
|
? JSON.parse(process.env.BASE_URL)
|
|
127
130
|
: artesConfig?.baseURL
|
package/package.json
CHANGED
|
@@ -7,15 +7,12 @@ const invokeBrowser = async () => {
|
|
|
7
7
|
let baseURL = "";
|
|
8
8
|
|
|
9
9
|
if (typeof cucumberConfig.baseURL === "object") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
cucumberConfig.env
|
|
13
|
-
cucumberConfig.env != null
|
|
14
|
-
) {
|
|
15
|
-
baseURL = cucumberConfig.baseURL[cucumberConfig.env.trim()];
|
|
10
|
+
const env = (cucumberConfig.env || "").trim();
|
|
11
|
+
if (env && cucumberConfig.baseURL.hasOwnProperty(env)) {
|
|
12
|
+
baseURL = cucumberConfig.baseURL[env];
|
|
16
13
|
} else {
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const firstKey = Object.keys(cucumberConfig.baseURL)[0];
|
|
15
|
+
baseURL = cucumberConfig.baseURL[firstKey];
|
|
19
16
|
}
|
|
20
17
|
} else {
|
|
21
18
|
baseURL = cucumberConfig.baseURL;
|
|
@@ -4,15 +4,12 @@ const cucumberConfig = require("../../../cucumber.config.js");
|
|
|
4
4
|
let baseURL = "";
|
|
5
5
|
|
|
6
6
|
if (typeof cucumberConfig.baseURL === "object") {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cucumberConfig.env
|
|
10
|
-
cucumberConfig.env != null
|
|
11
|
-
) {
|
|
12
|
-
baseURL = cucumberConfig.baseURL[cucumberConfig.env.trim()];
|
|
7
|
+
const env = (cucumberConfig.env || "").trim();
|
|
8
|
+
if (env && cucumberConfig.baseURL.hasOwnProperty(env)) {
|
|
9
|
+
baseURL = cucumberConfig.baseURL[env];
|
|
13
10
|
} else {
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const firstKey = Object.keys(cucumberConfig.baseURL)[0];
|
|
12
|
+
baseURL = cucumberConfig.baseURL[firstKey];
|
|
16
13
|
}
|
|
17
14
|
} else {
|
|
18
15
|
baseURL = cucumberConfig.baseURL;
|
package/src/hooks/hooks.js
CHANGED
|
@@ -70,8 +70,6 @@ Before(async function () {
|
|
|
70
70
|
} catch (err) {
|
|
71
71
|
console.error("Error parsing environment variables JSON:", err);
|
|
72
72
|
}
|
|
73
|
-
}else{
|
|
74
|
-
console.error(`Environment file not found: ${envFilePath}`);
|
|
75
73
|
}
|
|
76
74
|
|
|
77
75
|
const { browser, context: browserContext } = await invokeBrowser();
|