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-bdd | Saffron | |
|---|---|---|
| What you write | Feature files, plus a step definition in TypeScript or JavaScript for every step | Feature files only |
| How steps run | Your 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 time | None | None on replay; the agent records new steps and heals broken ones |
| Cost per run | Free | Free on replay; recording and healing use your AI subscription |
| When the UI changes | You update the step code | The replay heals into a proposal you review |
| Assertions | Whatever your step code checks | Never healed by default, enforced by the runner |
| Playwright features | All of Playwright Test: fixtures, projects, reporters, visual comparisons | Its own runner on Playwright: parallel, shards, five browsers, traces, its own reports |
| Licence | MIT, open source | Free to use, including commercially; source closed |
| Leaving | Your step code is yours | saffron 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.