Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Flows, sign-ins and hooks

Steps shared between scenarios: flows, optional steps and conditions, signing in once per run, the hooks around scenarios, and handing a step to a person.

  • flow name(a, b) at the top level holds steps; run name x y runs them with ${a} and ${b} set. use other.bt takes another file’s flows and sets. A failure inside a flow names the flow’s own line.
  • optional <step>: a step that may not apply (a cookie banner that only sometimes shows); its failure is noted, not fatal.
  • if <expect clause> with steps indented under it runs them when the clause holds now (or within its --timeout-ms): if --selector "#banner" visible, then click --text Accept indented below.
  • auth shopper [ttl 30m] (s, m, h, d, or plain seconds) holds steps that sign in; as shopper in a scenario starts it signed in. The block runs once per run, in a browser context of its own, the first time a scenario needs it (the other workers wait for it), and its cookies and storage are saved under .bitti/auth/ (keep that out of git). With a ttl, the saved state is reused by later runs until it is that old.
  • before all runs once for the file, before its first scenario, and every scenario of the file sees what it saves. If it fails, none of them run. after all runs once after the last one (a failure there is reported as (after all)).
  • handoff until <expect clause>: the steps only a person can do (2FA, a CAPTCHA). When the clause already holds, nothing happens; else the browser comes on screen, the run waits for the clause (5 minutes, or its --timeout-ms) or Enter, and the browser goes back off screen. Plain handoff waits for Enter. With no screen it fails at once and says so.

Made from docs/format.md.