முக்கிய உள்ளடக்கத்திற்குச் செல்லவும்

காத்திருப்பதற்கு இயக்கப்பட்டது

Wait for an element (selected by css selector) for the provided amount of milliseconds to be (dis/en)abled. If multiple elements get queried by given selector, it returns true if at least one element is (dis/en)abled.

தகவல்

As opposed to other element commands WebdriverIO will not wait for the element to exist to execute this command.

Usage
$(selector).waitForEnabled({ timeout, reverse, timeoutMsg, interval })
Parameters
NameTypeDetails
options
optional
WaitForOptionswaitForEnabled விருப்பங்கள் (விருப்பமானது)
options.timeout
optional
Numberமில்லி வினாடிகளில் நேரம் (இயல்புநிலை waitforTimeout கட்டமைப்பு மதிப்பின் அடிப்படையில் அமைக்கப்பட்டுள்ளது)
options.reverse
optional
Booleanஇது உண்மையாக இருந்தால் எதிர்மறைக்கு காத்திருக்கிறது (இயல்புநிலை: பொய்)
options.timeoutMsg
optional
Stringஇருந்தால் இது இயல்புநிலை பிழை செய்தியை மேலெழுதுகிறது
options.interval
optional
Numberசோதனைகளுக்கு இடையேயான இடைவெளி (இயல்புநிலை: waitforInterval)
Examples
index.html
<input type="text" id="username" value="foobar" disabled="disabled"></input>
<script type="text/javascript">
setTimeout(() => {
document.getElementById('username').disabled = false
}, 2000);
</script>
waitForEnabledExample.js
it('should detect when element is enabled', async () => {
await $('#username').waitForEnabled({ timeout: 3000 });
});

it('should detect when element is disabled', async () => {
elem = await $('#username');
await elem.waitForEnabled({ reverse: true })
});
Returns
  • <Boolean> return: true if element is (dis/en)abled

Welcome! How can I help?

WebdriverIO AI Copilot