Skip to content
Spana scout mascot surveying Web, iOS, Android, Electron, and Electrobun

One selector model. Five platforms. Zero Appium.

Web-first, TypeScript-native E2E testing across Web, Capacitor/React Native (iOS & Android), Electron, and Electrobun — engineered for sub-5 ms agent workflows and 5× faster CI.
bun add -d spana-test  # or: npm install -D spana-test

npm · llms.txt · llms-full.txt

BUILT FOR AI AGENTS

One paste to onboard your coding agent

Copy either prompt into Claude Code, Codex, Cursor, or Antigravity — or point any agent directly at /llms.txt and /llms-full.txt.

PROJECT SETUP

Set up Spana in your repo

Paste into Claude Code, Codex, Cursor, or Antigravity to install spana-test, generate spana.config.ts, write a smoke flow, and run spana doctor.

Set up spana (spana-test) for fast, TypeScript-native E2E testing in this repository.

Follow these steps:
1. Inspect the workspace to detect our targets (Web, Capacitor iOS/Android, React Native, Electron, or Electrobun) and package manager (bun / npm / pnpm).
2. Install spana-test as a devDependency (`bun add -d spana-test` or `npm install -D spana-test`).
3. Create `spana.config.ts` using `defineConfig` from `spana-test`:
   - Configure `apps` for our detected targets (e.g. `apps.web.url`, `apps.android`, `apps.ios`).
   - Enable fast web defaults: `execution.web: { warmBrowser: true, instantAnimations: true }`.
   - Configure `artifacts: { outputDir: ".spana/artifacts", captureOnFailure: true }` and `reporters: ["console", "html"]`.
   - If this repo uses GitHub Actions, also show how to add `--changed-since origin/main --reporter console,github` with `decisionFilter` / `pathRuleFilter`.
4. Add a first realistic smoke flow in `flows/smoke.flow.ts` using `flow()` and stable `{ testID }` selectors (use `systemUI()` only for native OS sheets/OAuth).
5. Run `npx spana doctor`, `npx spana validate-config`, `npx spana validate ./flows`, and verify `npx spana test` passes.

Docs & full LLM reference: https://spana.antonwester.se/llms-full.txt
SKILLS + MCP

Install Spana Skill & MCP Server

Give your coding agent the spana-testing skill, sub-5 ms stdio MCP tools (spana mcp), and llms-full.txt reference in one paste.

Install the Spana E2E agent skill and connect the Spana MCP server so you can drive live web/mobile/desktop sessions and export verified TypeScript flows.

Follow these steps:
1. Fetch the official Spana testing skill from:
   https://raw.githubusercontent.com/wezter96/spana/main/.agents/skills/spana-testing/SKILL.md
   (or copy `node_modules/spana-test/.agents/skills/spana-testing/SKILL.md` if `spana-test` is already installed)
   and install it in this project's or my global agent skills directory as `spana-testing/SKILL.md`.
2. Register Spana's model-free stdio MCP server in my MCP config:
   - Command: `npx` (or `bunx`)
   - Args: `["spana", "mcp"]`
   This exposes `spana_session_start`, `spana_observe`, `spana_tap`, `spana_input_text`, `spana_assert_visible`, `spana_diagnostics`, `spana_screenshot`, and `spana_export_flow`.
3. When I ask you to test a flow or debug a UI issue, drive the app via `spana mcp` (or `spana selectors` / `spana hierarchy`), verify assertions pass, and export a deterministic `.flow.ts` file.
4. Keep https://spana.antonwester.se/llms-full.txt as the canonical API reference for `spana-test`.

Dual-Channel Web-First Engine

{ testID } queries resolve in ~1 ms via PlaywrightDomChannel, spana-bridge, Android CDP, Lightpanda CDP, or iOS WebKit Inspector — paired with direct UiAutomator2 / WDA native touches and systemUI().

Sub-5 ms Model-Free MCP Server

Run spana mcp to let Claude Code, Codex, Cursor, and Antigravity observe screens (~273 tokens), tap in 2.8 ms, read console/JS errors, and export verified .flow.ts files.

PR-Aware CI Filters & Replay Cache

Skip unaffected flows on PRs with —changed-since (1-token KV-cache logprob judge or deterministic path rules) and replay cached agent steps in 6 ms with —strict-cache.

Flashwright-Grade Speed

MutationObserver reactive DOM waits, optional failFastWhenIdle, warm Chromium/WDA/UA2 daemons, speculative CLI pre-launch, instantAnimations, and auto-persisted longest-first —parallel scheduling.

Benchmarks

Reproducible head-to-head runs on Apple M4 Pro (Bun 1.4.5, Headless Chrome) comparing Spana against Playwright and WebdriverIO on 20 multi-step flows (280 interactions), plus live MCP tool latency.

Spana vs Playwright vs WebdriverIO 20-flow benchmark chart
Spana MCP tool latency and live agent benchmark chart

Dual-Channel Architecture

Selector lookup stays on a ~1 ms DOM channel (piercing Shadow DOM and same-origin iframes) while pointer input and system sheets stay native — with zero Appium locally and first-class BrowserStack / Sauce Labs support in the cloud.

Spana dual-channel web-first architecture diagram
Dual-channel optical circuit showing 1ms DOM fast lane paired with direct native touch

Five Targets, One TypeScript Suite

Run the exact same .flow.ts (or Gherkin .feature) tests across Web, Android, iOS, Electron, and Electrobun.

One selector model fanning out to Web, iOS, Android, Electron, and Electrobun