waitFor

suspend fun waitFor(tag: String, timeoutMs: Long = config.defaultWaitTimeoutMs)

Blocks execution until an element matching string tag becomes visible.

Example Usage

waitFor("dashboard_screen", timeoutMs = 5000)

Parameters

tag

The testTag string or visible text of the element.

timeoutMs

Maximum duration in milliseconds to wait (defaults to E2ETestConfig.defaultWaitTimeoutMs).

Throws

If the element is not visible within timeoutMs.


suspend fun waitFor(selector: Selector, timeoutMs: Long = config.defaultWaitTimeoutMs)

Blocks execution until an element matching selector becomes visible.

Advanced variant using explicit selectors.

Example Usage

waitFor(tag("checkout_button"), timeoutMs = 12_000L)

Parameters

selector

Explicit selector targeting the element.

timeoutMs

Maximum duration in milliseconds to wait.

Throws

If no matching element is visible within timeoutMs.