Setup
bl wait
Wait for an element, URL, text, page load, or JS condition
Wait for an element, URL, text, page load, or JS condition
Usage
bl wait [selector] [OPTIONS]
bl wait <command>Arguments
| Argument | Description |
|---|---|
[selector] | CSS selector of the element to wait for |
Options
| Option | Description |
|---|---|
--state <value> | State to wait for: attached, visible, hidden (default attached) |
--timeout <value> | Timeout in milliseconds (default 30000) |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl wait "div.loaded"
# Wait for element to exist in DOM
bl wait "div.loaded" --state visible
# Wait for element to be visible
bl wait "div.spinner" --state hidden --timeout 5000
# Wait for spinner to disappearbl wait url
Wait until the page URL contains a substring
Usage
bl wait url <pattern> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<pattern> | Substring the URL must contain |
Options
| Option | Description |
|---|---|
--timeout <value> | Timeout in milliseconds (default 30000) |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl wait url "/dashboard"
# Wait until URL contains "/dashboard"
bl wait url "success" --timeout 10000
# Wait up to 10 secondsbl wait text
Wait until text appears on the page
Usage
bl wait text <text> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<text> | Text to wait for on the page |
Options
| Option | Description |
|---|---|
--timeout <value> | Timeout in milliseconds (default 30000) |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl wait text "Welcome"
# Waits until "Welcome" appears on the page
bl wait text "Success" --timeout 10000
# Wait with custom timeout (10 seconds)bl wait load
Wait until the page is fully loaded
Usage
bl wait load [OPTIONS]Options
| Option | Description |
|---|---|
--timeout <value> | Timeout in milliseconds (default 30000) |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl wait load
# Wait until document.readyState is "complete"
bl wait load --timeout 10000
# Wait up to 10 secondsbl wait fn
Wait until a JS expression returns truthy
Usage
bl wait fn <expression> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<expression> | JS expression to evaluate until truthy |
Options
| Option | Description |
|---|---|
--timeout <value> | Timeout in milliseconds (default 30000) |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl wait fn "document.readyState === 'complete'"
# Wait for page to be fully loaded
bl wait fn "window.ready === true" --timeout 10000
# Wait for custom condition with timeout