Migrate from other tools

Convert existing Playwright, Cypress, Selenium, Puppeteer, or Mabl suites into .molar.md scenarios with molar migrate.

Migrate from other tools

Already have a test suite? molar migrate converts existing end-to-end tests into .molar.md scenarios so you keep your coverage while gaining self-healing, Clones, Guard PR gating, and Trace replay.

Note:

You don't have to migrate everything at once. Molar runs .molar.md scenarios and compiled Playwright side by side — migrate your flakiest or highest-value flows first and leave the rest untouched.

Supported sources

FromCommandNotes
Playwrightmolar migrate --from playwright <glob>Selectors and assertions map directly; test.step → scenario steps
Cypressmolar migrate --from cypress <glob>cy.* commands translated; custom commands flagged for review
Seleniummolar migrate --from selenium <glob>WebDriver calls → intents; explicit waits become assertions
Puppeteermolar migrate --from puppeteer <glob>Page actions mapped; network stubs suggested as Clones
Mablmolar migrate --from mabl <export>Import a Mabl journey export

How it works

molar migrate --from playwright "tests/e2e/**/*.spec.ts" --out .molar/scenarios --json
  1. Parse — each source test is parsed into an intermediate action graph.
  2. Lift to intents — brittle selector chains become plain-English intents (click the "Checkout" button) that the agent re-grounds at run time. This is what makes migrated tests self-heal.
  3. Detect vendors — outbound calls to Stripe, Twilio, email, auth, and S3 are flagged and wired to Clones so migrated tests run hermetically.
  4. Emit .molar.md — one scenario file per source test, with a # Migrated from provenance header.
  5. Report — anything that couldn't be translated cleanly is listed with a TODO(review) marker instead of being dropped silently.
{
  "ok": true,
  "migrated": 42,
  "needs_review": 3,
  "out_dir": ".molar/scenarios",
  "review": [
    { "file": "tests/e2e/upload.spec.ts", "reason": "custom fixture not resolvable" }
  ]
}

After migrating

molar scenarios validate           # lint the generated .molar.md
molar scenarios compile            # back to Playwright, now self-healing
molar run                          # execute via the Guard runner

Then commit the scenarios and install the Guard GitHub App to gate every PR.

Review checklist

  • Confirm TODO(review) markers — custom commands, non-deterministic fixtures, and third-party stubs need a human pass.
  • Replace network stubs with the matching Clone for stateful, vendor-faithful behavior.
  • Set auth aliases so logins resolve through Clones or agent comms OTP.