waitForClickable
Aguarde por um elemento durante a quantidade de milissegundos fornecida para ser clicável ou não clicável.
informação
Ao contrário de outros comandos de elemento, o WebdriverIO não aguardará que o elemento exista para executar este comando.
Uso
$(selector).waitForClickable({ timeout, reverse, timeoutMsg, interval })
Parâmetros
| Nome | Tipo | Detalhes |
|---|---|---|
optionsopcional | WaitForOptions | opções de waitForEnabled (opcional) |
options.timeoutopcional | Number | tempo em ms (padrão definido com base no valor de configuração waitforTimeout) |
options.reverseopcional | Boolean | se verdadeiro, espera pelo oposto (padrão: false) |
options.timeoutMsgopcional | String | se existir, substitui a mensagem de erro padrão |
options.intervalopcional | Number | intervalo entre verificações (padrão: waitforInterval) |
Exemplo
waitForClickable.js
it('should detect when element is clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ timeout: 3000 });
});
it('should detect when element is no longer clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ reverse: true });
});
Retorna
- <Boolean>
return:truese o elemento for clicável (ou não se a flag estiver definida)