[Go to site: main page, start]

Skip to content

Debugging ​

Interactive breakpoints for step-by-step flow debugging.

$breakpoint(label?, context?) ​

Set an interactive breakpoint. When breakpoint mode is enabled, the run pauses and a REPL opens where you can run arbitrary JavaScript, inspect variables, take screenshots, and continue when ready.

js
await $breakpoint('after-login', { user: username, cookies: cookieCount });

Breakpoint mode is enabled with ENABLE_BREAKPOINT=true or automatically by the php artisan flow:run command. Otherwise, $breakpoint calls are skipped.

REPL commands ​

CommandDescription
continue or cResume the run.
screenshot or sTake a debug screenshot (saved with timestamp).
url or uPrint the current page URL.
helpList available commands.
Any JS expressionEvaluate in the flow context with access to all globals and helpers.

Context ​

The context parameter lets you expose additional variables inside the REPL:

js
const rows = await $bridgeEvaluate(() => document.querySelectorAll('tr').length);
await $breakpoint('check-table', { rows, expectedCount: 10 });
// In the REPL: `rows` and `expectedCount` are available

All standard globals ($page, $browser, $input, $context, $client) and helper functions ($sleep, $fillInput, $gotoUrl, $gotoTab, $screenshot, etc.) are available in the REPL.