waitForDisplayed
Wait for an element for the provided amount of milliseconds to be displayed or not displayed.
Usage
browser.waitForDisplayed(ms, reverse)
Parameters
Param | Type | Details |
---|---|---|
ms optional | param | time in ms (default: 500) |
reverse optional | param | if true it waits for the opposite (default: false) |
Example
<div id="elem" style="visibility: hidden;">Hello World!</div>
<script type="text/javascript">
setTimeout(function () {
document.getElementById('elem').style.visibility = 'visible';
}, 2000);
</script>
it('should detect when element is visible', function () {
const elem = $('#elem')
elem.waitForDisplayed(3000);
});