Run BDD tests with Playwright runner
Tip
Try the Fix with AI button in the HTML reporter.
In the era of AI, you can take BDD approach to the next level:
- 🤖 Generate: Ask any AI model to generate feature files by raw business requirements.
- ✅ Validate: Refine the generated scenarios with AI or colleagues, collaborate in human language instead of code.
- 🛠 Automate: Use existing steps to run the tests and prevent codebase growth.
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

Playwright-BDD has several unique features:
- 🔥 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 the documentation website.
- Check out
examples
folder - Clone the fully working repo: playwright-bdd-example
Feel free to report a bug, propose a feature or share your experience:
Check out the latest changes in the CHANGELOG.md.
Your contributions are welcome! Please review CONTRIBUTING.md for the details.
Many thanks to our sponsors for their generous support ❤️ Become a sponsor






Have a look on this section.
- 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.
This project is licensed under the MIT License, allowing you to use, modify, and share the code freely, even for commercial purposes. Enjoy building something amazing! 🎉