froth-webdriverio-framework 3.0.134 → 3.0.136
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.
|
@@ -22,7 +22,7 @@ async function getSuiteDetails(frothUrl, token, id) {
|
|
|
22
22
|
jsondata.automation_suite_id = data.id == null ? 0 : data.id;
|
|
23
23
|
jsondata.automation_suite_name = data.automation_suite_name == null ? "" : data.automation_suite_name;
|
|
24
24
|
jsondata.test_data_id = data.test_data_id == null ? 0 : data.test_data_id;
|
|
25
|
-
|
|
25
|
+
// jsondata.browser_stack_urls = data.browser_stack_urls == null ? "" : data.browser_stack_urls;
|
|
26
26
|
jsondata.script_details = data.script_details == null ? [] : data.script_details;
|
|
27
27
|
// console.log("automation_script_id:" + JSON.stringify(jsondata.automation_script_id))
|
|
28
28
|
// const automationScripts = jsondata.script_details.reduce((obj, item) => {
|
|
@@ -35,21 +35,17 @@ async function getSuiteDetails(frothUrl, token, id) {
|
|
|
35
35
|
jsondata.test_sequence = data.test_sequence;
|
|
36
36
|
// console.log("automation_script_ details:" + JSON.stringify(BUFFER))
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
console.log("json data :" + JSON.stringify(jsondata));
|
|
39
|
+
|
|
39
40
|
|
|
40
|
-
return jsondata;
|
|
41
41
|
|
|
42
42
|
} else if (response.status === 401) { // Unauthorized, token expired
|
|
43
|
-
|
|
44
|
-
// const newToken = await getLoginToken(BUFFER.getItem("SERVICE_USER"), BUFFER.getItem("SERVICE_PASSWORD")); // You need to implement the login function
|
|
45
|
-
// // Retry the request with the new token
|
|
46
|
-
// return getSuiteDetails(frothUrl, newToken, id);
|
|
43
|
+
|
|
47
44
|
console.log("Unauthorized, token expired" + response.status)
|
|
48
45
|
}
|
|
49
46
|
else {
|
|
50
47
|
const errorText = await response.text();
|
|
51
48
|
console.error(`Data fetch failed response in getSuiteDetails: ${response.status}`);
|
|
52
|
-
// throw new Error(`HTTP error! status: ${response.status}`);
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
|
|
@@ -58,10 +54,11 @@ async function getSuiteDetails(frothUrl, token, id) {
|
|
|
58
54
|
console.error('Error fetching data:', error);
|
|
59
55
|
|
|
60
56
|
}
|
|
57
|
+
|
|
61
58
|
} else {
|
|
62
59
|
console.error('Error fetching data: Invalid ID or no suite id is linked to execution');
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
return jsondata;
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
// async function main() {
|
|
@@ -30,6 +30,7 @@ const commonconfig = {
|
|
|
30
30
|
|
|
31
31
|
// await setAllDetails.setIntegrationsDetails();
|
|
32
32
|
suite_info= await setAllDetails.setSuiteDetails();
|
|
33
|
+
console.log("Suite Info:", JSON.stringify(suite_info));
|
|
33
34
|
await setAllDetails.setTestDataDetails();
|
|
34
35
|
console.log("on prepare:", JSON.stringify(capabilities))
|
|
35
36
|
|
|
@@ -155,8 +156,9 @@ const commonconfig = {
|
|
|
155
156
|
|
|
156
157
|
// scriptresult = "FAILED"
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
let suite_info1= JSON.stringify(suite_info);
|
|
160
|
+
console.log("suite info:", suite_info1)
|
|
161
|
+
const jwtScript = suite_info1.script_details.find(script => script.scriptName === fileName.replace(".js", ""));
|
|
160
162
|
console.log("jwtScript:", jwtScript);
|
|
161
163
|
if (jwtScript) {
|
|
162
164
|
console.log("Script ID:", jwtScript.scriptId);
|
|
@@ -77,6 +77,7 @@ async function setSuiteDetails() {
|
|
|
77
77
|
try {
|
|
78
78
|
const getSuiteDetail = await getSuiteDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), process.env.AUTOMATION_SUITE_ID);
|
|
79
79
|
// process.env.BROWSERSTACK_APP_PATH = getSuiteDetail.browser_stack_urls;
|
|
80
|
+
console.log("Suite Details:", JSON.stringify(getSuiteDetail));
|
|
80
81
|
process.env.TESTDATA_ID = getSuiteDetail.test_data_id;
|
|
81
82
|
return getSuiteDetail;
|
|
82
83
|
|