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

waitUntil

このwaitコマンドは、何かを待機したい場合の万能な武器です。条件を指定し、その条件が真値を返すまで待機します。

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

使用方法
browser.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