Scenario file

A scenario is a YAML file (usually in qa/flows/) that describes one flow: its steps, the arrows between them and what each step must meet. Its format is qawalk.scenario.v1; kaloko validate <file> checks a file against it. How to write one step by step: Write a scenario.

schema: qawalk.scenario.v1
id: WEB-12-checkout
title: Checkout
locales: [en, cs]
viewports: { desktop: [1280, 800], mobile: iphone-15 }
environments: [local, staging]
nodes:
  - id: cart
    kind: screen
    title: { en: Cart, cs: Košík }
    path: /cart
    purpose: The shopper sees what they are buying and can continue.
    execution: { strategy: playwright, script: steps/cart.mjs, instructions: Add one product and open the cart. }
    criteria:
      - { id: AC1, text: Shows the total, check: { type: deterministic, assert: exists, selector: .cart-total } }
  - id: payment
    kind: screen
    title: Payment
    path: /checkout/payment
    packs: [a11y]
edges:
  - { from: cart, to: payment }

Top-level keys

schema, id, title, nodes and edges are required.

KeyWhat it holds
schemaalways qawalk.scenario.v1
idthe scenario's id (lowercase letters, digits, dashes); a ticket in it (WEB-12-…) links the issue
titlea name for people
kindtask (default) or flow
archivedtrue hides a retired scenario from the list; its runs stay reachable
sourcepath to the acceptance plan (ACCEPTANCE.md), used by kaloko validate --coverage
versiona number you raise when the flow changes
localeslanguages to walk, e.g. [en, cs]
viewportsnames with a size ([1280, 800]), a device preset (iphone-15, ipad-landscape), or a list of preset names
browserschromium (default), webkit, firefox
color_schemeslight, dark
reduced_motionno-preference, reduce
forced_colorsnone, active (Windows high contrast)
display_modesbrowser, standalone (an installed web app)
devicesapp scenarios: the emulators, simulators or phones to walk on
environmentsenvironments of the config the scenario may run on
readonlytrue for a scenario that only reads; required on a read-only environment
platformweb (default), android, ios, electron, desktop, windows
tagsfree labels
nodesthe steps (below)
edgesarrows between steps (below)
laneslabels of the rows on the canvas, index = lane number
issuethe ticket: number, repo (owner/name), key (Jira or Linear, ENG-42), url, title
sessionspeople in the flow, each with title, optional mailbox, account, blocked_on
projectthe Kaloko project for its runs; overrides the config
product, modulewhich product and module of products: the flow shows, for the changelog and docs
capturecapture quality for every step (below)

Step keys (nodes)

Every step needs id, kind and title.

KeyWhat it holds
idthe step id, used in links, --steps and step references (kaloko:<scenario>/<step>)
kindscreen, email, external (a third-party screen), decision, stack (many pages of one template)
titletext, or one per language ({ en: Cart, cs: Košík })
paththe address relative to base_url, or one per language; a deep link in app scenarios; {random} makes an address that cannot exist
purposeone sentence about what the step is for; the evaluator reads it
lanethe row on the canvas
readonlythis step only reads
executionstrategy (playwright, script, agent, manual), script (path to the step script), instructions (required), requires (e.g. browser)
maile-mail steps: subject and to
criteriawhat the step must meet (below)
sessionwhich person from sessions does this step
affectsfile globs that shape the step, for kaloko walk --affected, or always
packsready-made sets of criteria: seo, usability, a11y, perf, console, errors, app, design
capturecapture quality for this step only
recordtrue records this step even when the walk does not; false never
ignoreregions left out of pixel comparisons: { selector } or { rect: [x, y, w, h], viewport }, optionally limited by viewports, locales, with a note
itemsstack steps: where the pages come from (urls, file, sitemap with match/exclude, crawl, script)
fieldsstack steps: up to 12 columns of the stack index (id, label, from)

Criteria

Each criterion has an id (AC1, AC12b), a text for people, an optional highlight (a CSS selector to outline on the screenshot) and exactly one check: deterministic, semantic or manual. Every check type and option is listed in Criteria, checks and packs.

Edges

KeyWhat it holds
from, tostep ids
labeltext on the arrow, e.g. the choice at a decision
kindmain (default) or alt for an alternative path

Capture

KeyWhat it holds
formatwebp (default) or png (lossless, for print)
scale1 or 2 (device pixels of the screenshot)
qualityWebP quality from 0.3 to 1
maskCSS selectors covered by a solid box on the image
annotatenumbered marks on the elements of criteria with highlight
full_pagethe whole page (default) or, with false, the first screen
recordtrue, step, flow, failed or off; see kaloko walk --record
tracekeep a trace of actions, requests and console per step (default true)

A step's capture wins over the scenario's, and the scenario's over the config's.

Kaloko · latest · 2026-10-06