froth-webdriverio-framework 4.0.14 → 4.0.16
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.
|
@@ -49,7 +49,7 @@ async function assertAttributeValue(elementSelector, attributeName, expectedText
|
|
|
49
49
|
await amendToBrowserstack(annotationMessage, "info");
|
|
50
50
|
} catch (error) {
|
|
51
51
|
console.warn("Assertion failed:", error.message);
|
|
52
|
-
let annotationMessage = `Assertion failed. Expected text:
|
|
52
|
+
let annotationMessage = `Assertion failed. Expected text: ${expectedText}. ,${error.message}`;
|
|
53
53
|
browser.testError = annotationMessage
|
|
54
54
|
await amendToBrowserstack(annotationMessage, "error");
|
|
55
55
|
}
|
|
@@ -139,29 +139,27 @@ const commonconfig = {
|
|
|
139
139
|
console.log(`====> Status of test: ${passed}`);
|
|
140
140
|
|
|
141
141
|
let scriptresult = "NOT RUN";
|
|
142
|
+
let localError = null;
|
|
142
143
|
|
|
143
144
|
if (browser.testError) {
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
console.error("Test Error:", browser.testError);
|
|
146
|
+
localError = browser.testError;
|
|
147
|
+
resultdetails.comments.push(`${test.title} - failed: ${localError}`);
|
|
146
148
|
browser.testError = null; // clear it
|
|
147
|
-
|
|
149
|
+
scriptresult = "FAILE"
|
|
150
|
+
// throw err; // causes test to fail after execution
|
|
148
151
|
}
|
|
149
|
-
if (passed) {
|
|
152
|
+
if (passed && !localError ) {
|
|
150
153
|
scriptresult = "PASSED"
|
|
151
154
|
resultdetails.comments.push(`${test.title} - passed`);
|
|
152
155
|
}
|
|
153
|
-
else {
|
|
156
|
+
else if (!passed && error) {
|
|
157
|
+
console.error(`========= Failed or Error occured while executing the test: ${error.message}`);
|
|
154
158
|
scriptresult = "FAILED"
|
|
155
159
|
if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
|
|
156
160
|
resultdetails.comments.push(`${test.title} - failed: ${error.message}`);
|
|
157
161
|
}
|
|
158
|
-
|
|
159
|
-
console.error(`========= Error occured while executing the test: ${error.message}`);
|
|
160
|
-
if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
|
|
161
|
-
resultdetails.comments.push(`${test.title} - error occured: ${error.message}`);
|
|
162
|
-
|
|
163
|
-
scriptresult = "FAILED"
|
|
164
|
-
}
|
|
162
|
+
|
|
165
163
|
let scriptDetails = BUFFER.getItem("FROTHE_SUITE_DETAILS");
|
|
166
164
|
if (typeof scriptDetails === "string") {
|
|
167
165
|
scriptDetails = JSON.parse(scriptDetails);
|
|
@@ -212,7 +210,7 @@ const commonconfig = {
|
|
|
212
210
|
console.error("Uncaught Exception:", err);
|
|
213
211
|
resultdetails.comments.push(`Execution failed : ${err}`);
|
|
214
212
|
});
|
|
215
|
-
|
|
213
|
+
|
|
216
214
|
}
|
|
217
215
|
resultdetails.excution_time = await secondsToTime(BUFFER.getItem("FROTH_TOTAL_DURATION"))
|
|
218
216
|
await exeDetails.updateExecuitonDetails(BUFFER.getItem("ORGANISATION_DOMAIN_URL"), BUFFER.getItem("FROTH_LOGIN_TOKEN"), BUFFER.getItem("FROTH_EXECUTION_ID"), resultdetails)
|