Awesome
<div align="center"> <a href="https://vitalets.github.io/playwright-bdd"> <img width="128" alt="playwright-bdd" src="./docs/logo.svg"> </a> </div> <h2 align="center">Playwright-BDD</h2> <div align="center"> </div> <div align="center">Run BDD tests with Playwright runner
</div>[!TIP] :fire: Check out what's new in Playwright-BDD v8
Why BDD?
AI takes BDD approach to the next level:
- 🤖 Easy to generate: drop business requirements to AI chat and get structured, human-readable tests.
- ✅ Easy to validate: refine BDD scenarios with subsequent prompts, check updates in clear text, no low-level syntax.
- 🛠 Easy to maintain: instruct LLM model to re-use existing steps.
Why Playwright runner?
Both Playwright and CucumberJS have their own test runners. You can use CucumberJS runner with Playwright as a library to execute BDD scenarios. This package offers an alternative way: convert BDD scenarios into test files and run them with Playwright. Such approach brings all the benefits of Playwright runner:
- Automatic browser initialization and cleanup.
- Auto-capture of screenshots, videos and traces.
- Parallelization with sharding.
- Auto-waiting of page elements.
- Out-of-box visual comparison testing.
- Power of Playwright fixtures.
- ...a lot more.
Extras
Some features were developed in Playwright-BDD on top of Playwright and BDD approaches:
- 🔥 Advanced tagging by path and special tags.
- 🎩 Step decorators for class methods.
- 🎯 Scoped step definitions.
- ✨ Export steps for AI.
- ♻️ Re-using step functions.
Documentation
Check out the documentation website.
Examples
There are several examples in examples
folder and a separate fully working repo playwright-bdd-example.
Community
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
Changelog
Check out the latest changes in the CHANGELOG.md.
Contributing
Your contributions are welcome! Please review CONTRIBUTING.md for the details.
Sponsors
Huge thanks to the sponsors of the Playwright-BDD project ❤️ Become a sponsor
<!-- sponsors --><a href="https://github.com/currents-dev"><img src="https://github.com/currents-dev.png" width="60px" alt="User avatar: Currents.dev" /></a><a href="https://github.com/jzaratei"><img src="https://github.com/jzaratei.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/NikkTod"><img src="https://github.com/NikkTod.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/alescinskis"><img src="https://github.com/alescinskis.png" width="60px" alt="User avatar: Arturs Leščinskis" /></a><a href="https://github.com/kahuna227"><img src="https://github.com/kahuna227.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/alexhvastovich"><img src="https://github.com/alexhvastovich.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/FrancescoBorzi"><img src="https://github.com/FrancescoBorzi.png" width="60px" alt="User avatar: Francesco Borzì" /></a><a href="https://github.com/cassus"><img src="https://github.com/cassus.png" width="60px" alt="User avatar: Adam Banko" /></a><!-- sponsors -->How to make BDD valuable for my project?
Have a look on this section.
My other Playwright tools
- playwright-network-cache - Speed up Playwright tests by caching network requests on the filesystem.
- playwright-magic-steps - Auto-transform JavaScript comments into Playwright steps.