Helpers — flows & mocks
For the complete documentation index, see llms.txtHelpers are ordinary JS functions in unotest/e2e/_helpers/. There are two
kinds, and keeping them separate keeps scenarios clean.
Flows — replay a UI journey
flow_* functions wrap a repeated user journey: sign-in, checkout, onboarding.
Write once, call from any scenario.
function flow_signin(email, password) { goto("/login"); fill(getByLabel("Email"), email); fill(getByLabel("Password"), password); click(getByRole("button", { name: "Sign in" }));}An agent can also replay a flow live (explore_run_flow) to seed state, then
record a new test on top of it.
Mocks — seed & reset data
Use the sandbox helpers to put the app into a known state before a test and clean up after. Connection details are pinned in config — a scenario can’t redirect them.
function seed_cart(userId) { dbExec("INSERT INTO carts (uid) VALUES ($1)", userId); apiCall("POST", "/test/checkout/reset");}| Helper | Use |
|---|---|
dbQuery / dbExec | parameterized SQL (postgres / mysql / sqlite) |
apiCall | relative-path HTTP against apiBaseUrl |
shell | run a binary (execFile, no shell interpretation) |