Appearance
I.dontSee()
Asserts that a text or element is not visible on the page.
I.dontSee() is designed for negative visibility assertions and UI stabilization. It verifies that a target is not visible for a minimum duration before the step is marked as successful, making it especially useful for waiting for loading indicators, spinners, or temporary UI states to disappear.
By default, I.dontSee() checks that the target remains not visible for at least 3 seconds. This minimum duration can be customized by passing { forAtLeast: <seconds> } as the second argument.
If a matching element appears at any point during the check, I.dontSee() waits for it to disappear again. It will wait for up to 15 seconds (or the value configured via TEST.commandTimeout) for this to happen. Once the element disappears, the assertion succeeds immediately, without waiting for the full minimum duration again. If the element does not disappear within this timeout, the assertion fails and the test is marked as failed.
A target is considered not visible if:
- its
displayCSS property is set tonone - its
visibilityCSS property is set tohidden - its
opacityCSS property is set to0 - its bounding box is completely offscreen
Usage
js
I.dontSee(target: string)
I.dontSee(target: string, options: object)Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | Text or element (by CSS selector or XPath) to assert is not visible. |
options | object | (optional) Configuration options. |
Options
| Option | Type | Description |
|---|---|---|
forAtLeast | number | Minimum duration (in seconds) that the target must remain not visible before the assertion is considered successful. Defaults to 3. |
Returns
Returns a boolean value — true if the target is NOT visible, and false otherwise.
Example
js
I.click("Generate Report")
TEST.commandTimeout = 60
I.dontSee(".loading-spinner")
TEST.commandTimeout = 15
I.see("Monthly Sales Chart")In this example, the test waits for up to 60 seconds for the ".loading-spinner" element to disappear, and fails if it remains visible after the timeout.