waitForFunction

abstract suspend fun waitForFunction(expression: String, timeoutMillis: Long = 0)

Waits until a JavaScript expression is truthy.