retry

suspend fun <T> retry(maxAttempts: Int = 3, delayMs: Long = 500, block: suspend E2ETestScope.() -> T): T

Retries executing block up to maxAttempts times with a delayMs pause between attempts.

Useful for wrapping flaky assertions or waiting for asynchronous network operations.

Example Usage

retry(maxAttempts = 5, delayMs = 1000L) {
assertVisible("async_data_card")
}

Parameters

maxAttempts

Maximum number of execution attempts (default 3).

delayMs

Pause duration in milliseconds between attempts (default 500ms).

block

Test code block to execute and retry on failure.