froth-webdriverio-framework 4.0.13 → 4.0.14
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.
|
@@ -16,7 +16,8 @@ async function assertText(elementSelector, expectedText) {
|
|
|
16
16
|
await amendToBrowserstack(annotationMessage, "info");
|
|
17
17
|
} catch (error) {
|
|
18
18
|
console.log(`Assertion failed. Expected text: ,${expectedText}.`);
|
|
19
|
-
let annotationMessage = `Assertion failed. Expected text:
|
|
19
|
+
let annotationMessage = `Assertion failed. Expected text: ${expectedText}.`;
|
|
20
|
+
browser.testError = annotationMessage
|
|
20
21
|
await amendToBrowserstack(annotationMessage, "error");
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -24,6 +25,7 @@ async function assertText(elementSelector, expectedText) {
|
|
|
24
25
|
} catch (error) {
|
|
25
26
|
console.error('Error occurred while verifying text:', error);
|
|
26
27
|
let annotationMessage = `Error occurred while verifying text: ${error.message}.`;
|
|
28
|
+
browser.testError = annotationMessage
|
|
27
29
|
await amendToBrowserstack(annotationMessage, "error");
|
|
28
30
|
// throw error;
|
|
29
31
|
}
|
|
@@ -48,11 +50,13 @@ async function assertAttributeValue(elementSelector, attributeName, expectedText
|
|
|
48
50
|
} catch (error) {
|
|
49
51
|
console.warn("Assertion failed:", error.message);
|
|
50
52
|
let annotationMessage = `Assertion failed. Expected text: ,${expectedText}. ,${error.message}`;
|
|
53
|
+
browser.testError = annotationMessage
|
|
51
54
|
await amendToBrowserstack(annotationMessage, "error");
|
|
52
55
|
}
|
|
53
56
|
} catch (error) {
|
|
54
57
|
console.error('Error occurred while verifying text:', error);
|
|
55
58
|
let annotationMessage = `Error occurred while asserting Attribute: ${error.message}.`;
|
|
59
|
+
browser.testError = annotationMessage
|
|
56
60
|
await amendToBrowserstack(annotationMessage, "error");
|
|
57
61
|
}
|
|
58
62
|
|
|
@@ -140,6 +140,12 @@ const commonconfig = {
|
|
|
140
140
|
|
|
141
141
|
let scriptresult = "NOT RUN";
|
|
142
142
|
|
|
143
|
+
if (browser.testError) {
|
|
144
|
+
const err = browser.testError;
|
|
145
|
+
resultdetails.comments.push(`${test.title} - failed: ${err}`);
|
|
146
|
+
browser.testError = null; // clear it
|
|
147
|
+
throw err; // causes test to fail after execution
|
|
148
|
+
}
|
|
143
149
|
if (passed) {
|
|
144
150
|
scriptresult = "PASSED"
|
|
145
151
|
resultdetails.comments.push(`${test.title} - passed`);
|