froth-webdriverio-framework 4.0.13 → 4.0.15
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
|
}
|
|
@@ -47,12 +49,14 @@ async function assertAttributeValue(elementSelector, attributeName, expectedText
|
|
|
47
49
|
await amendToBrowserstack(annotationMessage, "info");
|
|
48
50
|
} catch (error) {
|
|
49
51
|
console.warn("Assertion failed:", error.message);
|
|
50
|
-
let annotationMessage = `Assertion failed. Expected text:
|
|
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,13 @@ const commonconfig = {
|
|
|
140
140
|
|
|
141
141
|
let scriptresult = "NOT RUN";
|
|
142
142
|
|
|
143
|
+
if (browser.testError) {
|
|
144
|
+
console.error("Test Error:", browser.testError);
|
|
145
|
+
const err = browser.testError;
|
|
146
|
+
resultdetails.comments.push(`${test.title} - failed: ${err}`);
|
|
147
|
+
browser.testError = null; // clear it
|
|
148
|
+
throw err; // causes test to fail after execution
|
|
149
|
+
}
|
|
143
150
|
if (passed) {
|
|
144
151
|
scriptresult = "PASSED"
|
|
145
152
|
resultdetails.comments.push(`${test.title} - passed`);
|