.toBeVisible()
Asserts visibility status of elements and alerts.
Usage
expect(value).toBeVisible()
Returns
Promise
: A promise that resolves if the assertion is successful.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | Yes |
Examples
Check if the image is visible:
const { element, by, expect } = require("appdriver");
(async () => {
const $image = await element(by.label("image"));
return expect($image).toBeVisible();
})();
Check if an alert is visible:
const { alert, expect } = require("appdriver");
(async () => {
await expect(alert).toBeVisible();
})();