Comparison

Saffron vs playwright-bdd

Both let you write tests in Gherkin and run them on Playwright. The difference is what sits under each step: in playwright-bdd it is code you write, in Saffron it is a recording an AI agent made once. That one choice decides most of the rest.

Side by side

playwright-bddSaffron
What you writeFeature files, plus a step definition in TypeScript or JavaScript for every stepFeature files only
How steps runYour step code, inside Playwright Test (npx bddgen, then npx playwright test)A recording the AI agent made once, replayed in Playwright browsers
AI at run timeNoneNone on replay; the agent records new steps and heals broken ones
Cost per runFreeFree on replay; recording and healing use your AI subscription
When the UI changesYou update the step codeThe replay heals into a proposal you review
AssertionsWhatever your step code checksNever healed by default, enforced by the runner
Playwright featuresAll of Playwright Test: fixtures, projects, reporters, visual comparisonsIts own runner on Playwright: parallel, shards, five browsers, traces, its own reports
LicenceMIT, open sourceFree to use, including commercially; source closed
LeavingYour step code is yourssaffron eject (beta) writes the recordings as Playwright Test specs you own

playwright-bdd details come from its README and its example project. Check them there for the current version.

When playwright-bdd is the better choice

  • You want no AI anywhere in your tests. playwright-bdd is deterministic code from the first run. Saffron needs an AI agent to record each new step.
  • Your steps do more than drive a page. Custom fixtures, network mocks, database setup inside a step: that is natural in step code.
  • You need an open-source licence, or want to read and change the runner itself.
  • You live inside Playwright Test and want its projects, reporters and visual comparisons unchanged.
  • You already have a good step library and it rarely breaks.

When Saffron is the better choice

  • Step definitions are the part you are tired of. In Saffron the feature file is the whole test. See Cucumber without step definitions.
  • Your UI changes often. A broken replay heals into a reviewable proposal instead of a ticket to fix selectors, and assertions are never healed by default.
  • People who do not write TypeScript write the tests. A tester or product owner can add a scenario in plain language and record it.
  • You want the AI cost to stop after the first run. Replays use no AI and no tokens.

Using both

They do not exclude each other. Feature files are plain Gherkin in both, so you can try Saffron on a few features and keep the rest where they are. And if Saffron is not for you, saffron eject (beta) leaves you with Playwright Test specs.

Try it on your app

npm i -D saffron-ai, then npx saffron init --examples installs a small example suite to run. Free to use, including commercially. Read the docs or watch the short videos.