Skip to content

waitFor()

This function is used to wait for number of milliseconds given or a given element or a given condition.

waitFor(5000)
waitFor("1 item in cart")
waitFor("Order Created", 2000)
waitFor(async () => !(await $("loading-text").exists()))
NameTypeDescription
elementstringElement/condition to wait for
timenumber | timeTime to wait. default to 10s
optionsunknownDefault: {}.
null-nulloptions.messageCustom message
TypeDescription
promise