Run BDD tests with Playwright runner
Tip
🔥 Check out what's new in Playwright-BDD v8
With AI, you can bring the BDD approach to the next level:
- 🤖 Generate: Drop business requirements to AI chat and get structured, human-readable features.
- ✅ Validate: Refine the generated scenarios with AI or colleagues, collaborate in plain text 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 extends Playwright with BDD capabilities, offering:
- 🔥 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.
There are several examples in examples
folder and a separate fully working repo playwright-bdd-example.
Feel free to get in touch:
- Open an issue on GitHub to report a bug or propose a new feature
- Join Playwright-BDD Discord server to connect with other developers, ask questions and share your BDD experience
Check out the latest changes in the CHANGELOG.md.
Your contributions are welcome! Please review CONTRIBUTING.md for the details.
A huge thanks to our sponsors for their support ❤️ Become a sponsor
Have a look on this section.
- playwright-network-cache - Speed up Playwright tests by caching network requests on the filesystem.
- playwright-magic-steps - Auto-transform JavaScript comments into Playwright steps.