Getting started
Cairn is an autonomous QA agent: it observes your app, grounds every locator, designs methodical test cases, generates self-repairing Playwright specs, and judges the result. This guide walks the full cycle once.
v0.6.0Apache-2.0Node 20+
-
Install and configure
Section titled “Install and configure”Terminal window npm install -g @plune-ai/cairnCreate a
.env(copy.env.example) with at least your LLM key:ANTHROPIC_API_KEY=sk-ant-...# or: OPENROUTER_API_KEY=sk-or-... and LLM_PROFILE=openrouter -
Capture a session (for pages behind login)
Section titled “Capture a session (for pages behind login)”Terminal window cairn session capture --url https://app.example.com/login --name myappA browser opens; log in manually, then press Enter. Cookies + localStorage are saved to
.auth/myapp.storageState.jsonand reused for every run — no credentials in code. Skip this step for public pages. (cairn loginis a shorthand; inside the reponpm run session:save -- …works too.) -
Design test cases — no code yet
Section titled “Design test cases — no code yet”The easiest first run is the interactive TUI —
cairnwith no arguments. Prefer the command line?Terminal window cairn design --url https://app.example.com/page --session myappThe agent observes the page, verifies every locator against it, and writes cases using EP, BVA, decision tables, and state transitions (ISO/IEC/IEEE 29119-4) into
runs/<id>/testcases/.Steer what it covers with an optional checklist:
cairn design … --checklist plan.md.ATCAutomatable — read-only checks on verified locators. The bot generates Playwright code for these.
MTCManual — form submits, security/XSS, visual judgment, irreversible actions. Left to humans on purpose.
-
Review the cases
Section titled “Review the cases”Each
ATC-*.md/MTC-*.mdfile has a title, preconditions, steps, expected result, and recorded selectors. In the TUI: Browse past runs → open your run → Cases tab. -
Promote a manual case (optional)
Section titled “Promote a manual case (optional)”Reviewed an
MTCand decided it’s actually safe to automate? Convert it to anATCin place:Terminal window cairn promote --run runs/<id> --cases MTC-LOGIN-001 -
Automate & validate
Section titled “Automate & validate”Terminal window cairn automate --run runs/<id> --validate --session myappGenerates POM-style
@playwright/testspecs from theATCcases, runs them, classifies pass / fail / flaky, and self-repairs failures. Keep-best: a repair never makes the suite worse.Run result12 specs 11 green · 91.7% 1 flaky → repaired ◆ Pilot: PASS (92%)
…or run everything at once:
cairn explore --url https://app.example.com/page --session myapp