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 yruns them with${a}and${b}set.use other.bttakes another file’s flows andsets. 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, thenclick --text Acceptindented below.auth shopper [ttl 30m](s,m,h,d, or plain seconds) holds steps that sign in;as shopperin 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 attl, the saved state is reused by later runs until it is that old.before allruns 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 allruns 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. Plainhandoffwaits for Enter. With no screen it fails at once and says so.
Made from docs/format.md.