Skip to content

TEST.commandTimeout

Controls the maximum amount of time (in seconds) that UI-licious will wait for an interaction command to succeed. The default is 15 seconds.

This timeout applies to commands that implicitly wait for elements to appear and become visible to the user, such as (but not limited to) I.click() and I.see().

You can change TEST.commandTimeout at any point during the test, and the new value takes effect immediately for subsequent commands.

Usage

js
TEST.commandTimeout = seconds

Examples

Increase timeout for a slow-loading section

js
// Uses default 15s timeout
I.click("Load report")

// Increase timeout for slower UI
TEST.commandTimeout = 60
I.see("#sales-chart")

// Reduce timeout back to 15
TEST.commandTimeout = 15
I.click("Next")

In the example above, the tests waits for up to 60 seconds for the element #sales-chart to appear before failing the test.