Skip to main content
Momentic tests are YAML files with natural-language targets and AI assertions. You do not port your Playwright code line by line; you port the user journeys your specs exercise. A coding agent connected to the MCP server with the coding agent skills does most of this port for you.

Before and after

A representative Playwright spec:
checkout.spec.ts
The same test in Momentic:
checkout.test.yaml
Run it:

API mapping

Fixture and helper mapping

What keeps working unchanged

  • Storage state. authLoad reads the exact storageState JSON Playwright writes. Your existing auth bootstrap (global setup that saves cookies and localStorage) carries over with no conversion.
  • Your seed scripts. A javascript step runs Node code in a sandbox with fetch, faker, and file access. Call your existing seed endpoints or database helpers from before.
  • Your CI job. Momentic installs and runs in the same GitHub Actions job; see Run in CI.
  • JUnit dashboards. --reporter junit keeps 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 browserContext control. Momentic manages the browser context. newTab, closeTab, and navigate cover tab workflows, but you do not create isolated contexts mid-test. Use separate tests or authLoad per test for different identities.
  • page.on("console")-style listeners. There is no equivalent passive console assert; extract what you need with a javascript step.
  • Codegen. Momentic’s equivalent is the local editor and AI authoring, not a recorder that emits code.

Incremental strategy

  1. Keep the Playwright suite running. Momentic and Playwright can coexist in the same repo; momentic.config.yaml does not conflict with playwright.config.ts.
  2. Port the highest-value flows first: login, checkout, the flows that page you. Give each ported test a label such as migrated.
  3. Run both suites in CI during the overlap. Gate PRs on the Playwright suite; run Momentic with --labels migrated in parallel until you trust it.
  4. 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.
  5. When Playwright is fully retired, remove its job, playwright.config.ts, browsers install step, and node_modules dependency.

Porting at scale with a coding agent

Point your coding agent at the spec files and the momentic-test skill. A prompt that works well:
The agent writes valid YAML, resolves targets from the spec’s intent rather than its selectors, and verifies each port by running it.