BDD Testing with Playwright runner
npm install playwright-bddRun BDD tests with Playwright runner




!license
Documentation |
Example |
Changelog
> [!TIP]
> BDD + MCP: Your thoughts?
- 🤖 Generate feature files from raw business requirements using AI.
- ✅ Refine scenarios with colleagues or AI in plain human language.
- 🛠 Automate test execution using the Playwright runner.
Both Playwright and CucumberJS have their own test runners. You can use the CucumberJS runner with Playwright as a library to execute BDD scenarios. This package offers an alternative: convert BDD scenarios into test files and run them directly with Playwright. You gain all the advantages of the Playwright runner:
- Automatic browser initialization and cleanup
- Auto-capture of screenshots, videos, and traces
- Parallelization with sharding
- Auto-waiting for page elements
- Built-in visual comparison testing
- Power of Playwright fixtures
- ...and more

- 🔥 Advanced tagging by path and special tags
- 🎩 Step decorators for class methods
- 🎯 Scoped step definitions
- ✨ Exporting steps for AI
- ♻️ Re-usable step functions
- Check out examples folder
- Clone the fully working repo: playwright-bdd-example
playwright-bdd supports all non-deprecated versions of Playwright. To check which Playwright versions are currently deprecated, run:
``bash``
npm show @playwright/test@1 deprecated
Feel free to report a bug, propose a feature or share your experience:
* GitHub issues
* Playwright-BDD Discord
A big thank you to all the amazing people and companies already supporting Playwright-BDD! Your help keeps the project alive and growing:
If you find Playwright-BDD useful in your personal or work projects, consider becoming a sponsor. Even small contributions help me dedicate more time to maintenance, new features, and community support.
Have a look on this section.
* @global-cache/playwright - Key-value cache for sharing data between parallel workers.
* request-mocking-protocol - Mock server-side API calls in Playwright.
* playwright-network-cache - Speed up Playwright tests by caching network requests on the filesystem.
* playwright-magic-steps - Auto-transform JavaScript comments into Playwright steps.