Heddle SDK

Web QA SDK that plays the scenarios Selvage and Shuttle run, in a browser through Playwright

A Node.js package that compiles the same scenario YAML as Selvage and Shuttle and plays it in a browser through Playwright.

  • •An unknown key, command or argument is a compile error with its line and column
  • •A step a browser cannot do is reported as skipped with its reason
  • •By default a failing scenario leaves one bug report archive, and every file in it passes through redaction first
  • •A local dashboard lists scenarios, runs one and shows its steps live
  • •A test-time tool: nothing in it belongs in a production bundle
Private Repository
WIP
Status

Tech Stack

TypeScriptPlaywrightNode.js

A scenario, step by step

Checklist/03-add-on-the-web.yamlyaml
  1. appId: https://app.example/checklist
  2. name: A typed item is added to the top of the list
  3. tags: [checklist, smoke]
  4. ---
  5. - launchApp: {clearState: true}
  6. - assertVisible: checklist_title_label
  7. - tapOn: item_title_field
  8. - inputText: {id: item_title_field, text: "Book a table"}
  9. - pressKey: Enter
  10. - assertVisible: {id: checklist_item_label, index: 0, text: "Book a table"}
  11. - assertCount: {id: checklist_item_label, count: 3}
  12. - takeScreenshot: item-added
Step 1 of 8
A scenario in the same YAML dialect, compiled by Heddle and played in a browser on a made-up checklist page. An illustration, not a recording.

How it works

A scenario is written once in YAML, compiled to canonical JSON and played against the app. Every run leaves evidence and a verdict.

Authorscenario YAMLheddle compilesame wire formatWeb · HeddlePlaywrightEvidenceredactedReportverdict · files
The same scenario files also run on iOS with Selvage and on Android with Shuttle.

A run, step by step

  1. 01

    Write the scenario

    One file holds two YAML documents split by ---: the config (appId, name, tags, seed, mocks, lanes) and the list of steps. It sits at Scenarios/Modules/<Module>/<Screen>/<id>.yaml. Sub-flows live in Common/Shared and are pulled in with runFlow, and Common/compiler.yaml holds the settings both compilers read.

    Reads the same YAML. The role and css selectors are web only and belong in a sub-flow with when: {platform: web}; assertUrl exists only on the web.

  2. 02

    Compile and check

    The compiler turns each file into canonical JSON with its sub-flows inlined. An unknown key, command or argument is an error that names file:line:column, prints the line and puts a caret under the fault.

    Its own compiler matches the kernel's bytes on the golden fixtures, except that a scenario naming no platforms also lists web.

  3. 03

    Gates before anything runs

    Cheap checks come first, so a broken catalogue never costs a build or a device.

    heddle compile --check reports every error without opening a browser. A compile error met during a run ends it with exit 2.

  4. 04

    Seed and launch

    After sub-flows are inlined the first step is launchApp, exactly one per scenario, and an openLink right after it is folded into the launch. The seed (locale, link and the app's own values) travels with the launch. onFlowStart runs before it, onFlowComplete after the steps whether they passed or not.

    Each launch opens a new browser context, and window.FLOW_ENV carries the launch environment the other platforms pass to the app.

  5. 05

    Play the steps

    Each step resolves its selector (id, text, index and the rest) and acts: tap, type, scroll, wait. repeat, retry, runFlow and measure nest, and ${VARIABLES} resolve at run time.

    Playwright plays the steps in Chromium, Firefox or WebKit. A step a browser cannot do passes with a warning that names the reason.

  6. 06

    Assert

    assertVisible, assertNotVisible, assertCount, assertTrue and assertNetwork check what the screen and the network promised. A failed assertion fails the scenario on that step.

    Visible means rendered with a size, not necessarily inside the viewport. assertUrl checks the address and is web only.

  7. 07

    Collect evidence, redacted

    While the steps run, each SDK records what happened: screens, network, logs. Secrets are masked before anything is written to disk.

    A failing scenario leaves one heddle-report-<id>-<time>.zip: trace, video, HAR, console, page errors, interaction trail, DOM and screenshots. Redaction makes two passes over every file and cannot be switched off.

  8. 08

    Verdict and report

    The run ends with a status per scenario and files a person and a machine can both read.

    run.json and junit.xml in the report folder, heddle-report/ by default, and one line per scenario on the terminal.

Locally and in CI

HeddleWeb

Locally

Node 20 or later and a Playwright browser. The repository carries a notes app to try it on.

npm install && npm run build
npx playwright install chromium
npm run sample
npx heddle run sample/scenarios --base-url http://127.0.0.1:4173
npx heddle compile <folder> --check
npx heddle serve scenarios/ --base-url http://127.0.0.1:3000
npm run check
  • run prints one line per scenario and, for a failure, the path of its bug report. --bundle always writes the archive for a passing scenario too.
  • --browser picks chromium, firefox or webkit, and --headed shows the window.
  • serve binds to 127.0.0.1:7357 and every page and socket request needs the token.
  • The mock lane is not served yet, so a scenario that runs only on mock is skipped with that reason.
In CI
Workflow: .github/workflows/ci.yml · Triggers: workflow_dispatch

The workflow file runs only when started by hand (workflow_dispatch), not on a push: ubuntu-latest, Node 20, a 20-minute limit, and Chromium as the only browser.

npm ci
npx playwright install --with-deps chromium
npm run lint
npm run typecheck
npm test
npm run test:integration
npm run test:fixture
npm run gate
  • Any failing step fails the job. No artifacts are uploaded.
  • In a project's own CI the contract is the exit status and run.json plus junit.xml in the --report folder.
  • Inside an existing Playwright Test suite, the test fixture runs a scenario and attaches its bug report to the failing test.
Exit status
  • 0 every scenario passed
  • 1 a scenario failed
  • 2 usage or compile error

What Heddle adds

  • Its own strict compiler for the same YAML, with a hand-written reader that refuses anchors, aliases and tags
  • A browser runner from the command line, a programmatic API or a Playwright Test fixture
  • One bug-report zip per failing scenario, redacted in two passes before it is written
  • A local dashboard that speaks the same WebSocket frames as the iOS dashboard

Features

Scenario Compiler

Reads the scenario YAML and compiles it to the shared wire format.

  • •Strict: an unknown key, command or argument is an error with its line and column
  • •A runFlow with when: {platform: web} keeps web-only steps off the other platforms
  • •Its own YAML reader refuses anchors, aliases and tags

Browser Runner

Plays the compiled steps through Playwright.

  • •From the command line, a programmatic API, or a fixture inside a @playwright/test suite
  • •--browser picks Chromium, Firefox or WebKit
  • •A step a browser cannot do passes with a warning that names the reason

Bug Report and Dashboard

By default a failing scenario leaves one archive, and a local page follows runs.

  • •Console, page errors, interaction trail, DOM and screenshots, plus the trace, video and HAR unless switched off
  • •Every file passes through redaction before the archive is written; the README lists what it cannot reach, such as pixels and values with no key or shape
  • •heddle serve binds to 127.0.0.1 by default and every request needs a token

Privacy & terms