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

waitUntil(待機まで)

この待機コマンドは、何かを待ちたい場合の万能ツールです。条件を指定して、その条件が真値で満たされるまで待機します。

情報

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

一般的な例としては、特定の要素が特定のテキストを含むまで待機することがあります(例を参照)。

使用法
$(selector).waitUntil(condition, { timeout, timeoutMsg, interval })
パラメータ
名前タイプ詳細
conditionFunction待機する条件
options
オプション
WaitUntilOptionsコマンドオプション
options.timeout
オプション
Numberミリ秒単位の時間(デフォルトは waitforTimeout 設定値に基づく)
options.timeoutMsg
オプション
StringwaitUntilがタイムアウトした時にスローするエラーメッセージ
options.interval
オプション
Number条件チェック間の間隔(デフォルトは waitforInterval 設定値に基づく)
index.html
loading...
waitUntilExample.js
loading...
戻り値
  • <Boolean> return: 条件が満たされた場合はtrue

Welcome! How can I help?

WebdriverIO AI Copilot