Fetching documentation…
morph test — Headless E2E RunnerStatus: future · Priority: medium · Depends on: Time-Travel Debugger (replay), Platforms (shipped — CI images exist)
Note: This is a future plan, not a commitment. The syntax and API shown here are proposals — they can be completely different when actually implemented.
Robots clicking buttons so humans don't have to. Today verification is <binary> --morph-self-test plus screenshot-by-hand (import -window <id>); there is no assertion-based runner a CI pipeline can gate on. morph test closes that gap: drive windows, assert state, screenshot on failure.
// tests/checkout.test.mx
import { test, expect } from 'morph/test'
test("two windows stay in sync", async () => {
const a = await Window.open("/shop")
const b = await Window.open("/shop")
await a.click("Add to cart")
expect(await b.text("Cart:")).toBe("Cart: 1") // cross-window sync asserted
await expect(a.screenshot()).toMatchSnapshot() // pixel gate
})--headed for local debugging, because watching the robot work never gets olddata-testid attributes (stripped from release binaries, zero cost in prod)| Piece | State |
|---|---|
<binary> --morph-self-test (headless runtime check) |
✅ Shipped |
tests/runtime/run-selftests.sh fixture sweep |
✅ Shipped |
Manual screenshots via import -window |
✅ Shipped (manual) |
morph test runner + morph/test assertions |
❌ Not built |
data-testid stripping in release builds |
❌ Not built |
| Snapshot store + diff + failure artifacts | ❌ Not built |
click, toBe, toMatchSnapshot) for zero learning cost, or Morph-native naming?--headed flagmorph/test minimal API (test, expect, window handles, click/text queries)data-testid pipeline (parse → runtime lookup → release strip)morph test gates the fixture sweep in CI