Before and after
A representative Playwright spec:checkout.spec.ts
checkout.test.yaml
API mapping
Fixture and helper mapping
What keeps working unchanged
- Storage state.
authLoadreads the exactstorageStateJSON Playwright writes. Your existing auth bootstrap (global setup that saves cookies and localStorage) carries over with no conversion. - Your seed scripts. A
javascriptstep runs Node code in a sandbox withfetch,faker, and file access. Call your existing seed endpoints or database helpers frombefore. - Your CI job. Momentic installs and runs in the same GitHub Actions job; see Run in CI.
- JUnit dashboards.
--reporter junitkeeps your existing test analytics.
What does not map
- Playwright’s element handles and locator chains. Momentic re-resolves a target from its description each run (with a step cache to skip the model call when the page has not changed). There is no way to hold a locator object across steps; express the intent in the target text instead.
- Multi-page
browserContextcontrol. Momentic manages the browser context.newTab,closeTab, andnavigatecover tab workflows, but you do not create isolated contexts mid-test. Use separate tests orauthLoadper test for different identities. page.on("console")-style listeners. There is no equivalent passive console assert; extract what you need with ajavascriptstep.- Codegen. Momentic’s equivalent is the local editor and AI authoring, not a recorder that emits code.
Incremental strategy
- Keep the Playwright suite running. Momentic and Playwright can coexist in the
same repo;
momentic.config.yamldoes not conflict withplaywright.config.ts. - Port the highest-value flows first: login, checkout, the flows that page you.
Give each ported test a label such as
migrated. - Run both suites in CI during the overlap. Gate PRs on the Playwright suite;
run Momentic with
--labels migratedin parallel until you trust it. - Delete a spec only after its Momentic replacement passes several consecutive runs and you have reviewed a failure or two to confirm it catches what it should.
- When Playwright is fully retired, remove its job,
playwright.config.ts, browsers install step, andnode_modulesdependency.
Porting at scale with a coding agent
Point your coding agent at the spec files and themomentic-test skill. A prompt that works well: