メインコンテンツにスキップ

waitForClickable

指定されたミリ秒数の間、要素がクリック可能またはクリック不可になるまで待機します。

情報

他の要素コマンドとは異なり、WebdriverIO はこのコマンドを実行するために要素が存在するまで待機しません。

使用方法
$(selector).waitForClickable({ timeout, reverse, timeoutMsg, interval })
パラメータ
名前タイプ詳細
オプション
オプション
WaitForOptionswaitForEnabled オプション (オプション)
options.timeout
オプション
数値ミリ秒単位の時間 (デフォルトはwaitforTimeout設定値に基づいて設定されます)
options.reverse
オプション
真偽値true の場合、反対の条件を待機します (デフォルト: false)
options.timeoutMsg
オプション
文字列存在する場合、デフォルトのエラーメッセージを上書きします
options.interval
オプション
数値チェック間隔 (デフォルト: waitforInterval)
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 });
});

ようこそ!何かお困りですか?

WebdriverIO AI Copilot