froth-webdriverio-framework 3.0.116 → 3.0.117
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/config/commonconfig.js +15 -9
- package/package.json +1 -1
package/config/commonconfig.js
CHANGED
|
@@ -46,11 +46,12 @@ const commonconfig = {
|
|
|
46
46
|
console.log("length:", specdat.length);
|
|
47
47
|
// console.log("Config:", config);
|
|
48
48
|
} catch (error) {
|
|
49
|
+
console.error('🚨 Error in beforeSession:', error);
|
|
49
50
|
console.error('🚨 Error in beforeSession:', error.message);
|
|
50
|
-
resultdetails.excution_status = 'FAILED'
|
|
51
|
+
resultdetails.excution_status = 'FAILED';
|
|
51
52
|
resultdetails.comments.push("Session creation failed:", error.message);
|
|
52
53
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
53
|
-
|
|
54
|
+
// throw new Error(`Session creation failed: ${error.message}`);
|
|
54
55
|
process.exit(1); // Stop execution if session creation fails
|
|
55
56
|
|
|
56
57
|
}
|
|
@@ -70,7 +71,7 @@ const commonconfig = {
|
|
|
70
71
|
console.log("BrowserStack is enabled");
|
|
71
72
|
await getBSSessionDetails(process.env.BS_SESSION_TYPE, process.env.BROWSERSTACK_USERNAME, process.env.BROWSERSTACK_ACCESS_KEY);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
// const resultdetails = {};
|
|
74
75
|
exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
75
76
|
|
|
76
77
|
} catch (e) {
|
|
@@ -114,15 +115,15 @@ const commonconfig = {
|
|
|
114
115
|
|
|
115
116
|
if (passed) {
|
|
116
117
|
scriptresult = "PASSED"
|
|
117
|
-
resultdetails.comments.push(
|
|
118
|
+
resultdetails.comments.push(`${test.title} - passed`);
|
|
118
119
|
}
|
|
119
120
|
else {
|
|
120
121
|
scriptresult = "FAILED"
|
|
121
|
-
resultdetails.comments.push(
|
|
122
|
+
resultdetails.comments.push(`${test.title} - failed: ${error.message}`);
|
|
122
123
|
}
|
|
123
124
|
if (error) {
|
|
124
125
|
console.error(`========= Error occured while executing the test: ${error.message}`);
|
|
125
|
-
resultdetails.comments.push(
|
|
126
|
+
resultdetails.comments.push(`${test.title} - error occured: ${error.message}`);
|
|
126
127
|
|
|
127
128
|
// scriptresult = "FAILED"
|
|
128
129
|
}
|
|
@@ -157,12 +158,17 @@ const commonconfig = {
|
|
|
157
158
|
BUFFER.setItem("RESULT_DATA", result);
|
|
158
159
|
console.log("====> Result data :" + BUFFER.getItem("RESULT_DATA"))
|
|
159
160
|
|
|
160
|
-
|
|
161
|
+
/// const resultdetails = {}
|
|
161
162
|
resultdetails.excution_status = BUFFER.getItem("RESULT_DATA") == 0 ? 'PASSED' : 'FAILED'
|
|
162
163
|
console.log("====> Total Duration taken for the suite:" + BUFFER.getItem("FROTH_TOTAL_DURATION"));
|
|
163
164
|
console.log("====> Execution Status from results" + resultdetails.excution_status);
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
// Capture WebDriver session errors
|
|
166
|
+
if (result !== 0) {
|
|
167
|
+
if (resultdetails.comments.length === 0) {
|
|
168
|
+
resultdetails.comments.push("❌ WebDriver session failed or timed out.");
|
|
169
|
+
}
|
|
170
|
+
resultdetails.comments.push(`Execution failed with exit code: ${result}`);
|
|
171
|
+
}
|
|
166
172
|
resultdetails.excution_time = await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))
|
|
167
173
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|
|
168
174
|
|