froth-webdriverio-framework 2.0.30 → 2.0.31
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.
|
@@ -21,18 +21,13 @@ async function assertText(driver, elementSelector, expectedText) {
|
|
|
21
21
|
actualText = await element.getText();
|
|
22
22
|
console.log("actual text is:" + actualText);
|
|
23
23
|
let annotationMessage = `Assertion passed. Actual text: ${actualText}, Expected text: ${expectedText}.`;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
window.parent.BrowserStack && window.parent.BrowserStack.addEvent('Passed', annotationMessage);
|
|
27
|
-
});
|
|
24
|
+
await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"Assertion passed. Actual text:'+ actualText+ '","level": "info"}}');
|
|
25
|
+
|
|
28
26
|
} else {
|
|
29
27
|
console.log(`Assertion failed. Expected text: ,${expectedText}.`);
|
|
30
28
|
let annotationMessage = `Assertion failed. Expected text: ,${expectedText}.`;
|
|
29
|
+
await driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"Assertion failed. Expected text:'+ expectedText+ '","level": "error"}}');
|
|
31
30
|
|
|
32
|
-
await browser.execute(function () {
|
|
33
|
-
// Use BrowserStack's reporting API to log the failure
|
|
34
|
-
window.parent.BrowserStack && window.parent.BrowserStack.addEvent('Failed', annotationMessage);
|
|
35
|
-
});
|
|
36
31
|
}
|
|
37
32
|
} catch (error) {
|
|
38
33
|
console.error('Error occurred while verifying text:', error);
|