README.md
July 17, 2026 ยท View on GitHub
Playwright-BDD
Run BDD tests with Playwright runner
๐ Getting Startedย ๐ Documentationย โถ๏ธ Exampleย ๐ Changelog
BDD in the Era of AI
Behavior-Driven Development (BDD) describes product features through concrete scenarios written as Given / When / Then steps in .feature files. In modern AI-assisted development, these scenarios take on a new role: they become a valuable artifact for AI agents because they are readable and executable. You can refine them during planning to make sure the agent understands the feature correctly. Later, the agent can run the same scenarios as tests to automatically verify the implementation and keep the spec aligned with the code over time.
Unlike plain markdown specs, BDD does not just describe the behavior, it makes the spec live.
Install the playwright-bdd skill and check out the practical walkthrough of the agentic BDD workflow:
โก๏ธ Why I Prefer BDD over SDD for Agentic Development
Why Playwright Runner?
Playwright can be used as a browser automation library with any test runner, such as CucumberJS or Vitest. However, it is most powerful when used with the Playwright test runner. Playwright-BDD converts BDD scenarios into native Playwright tests, so you get all Playwright runner features out of the box:
- Automatic browser setup and cleanup
- Auto-waiting for page elements
- Auto-capture of screenshots, videos, and traces
- Parallel execution and sharding
- Built-in reports and visual comparison testing
- Playwright fixtures
- ...and more
How It Works
Extras
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
Documentation
Check out the documentation website.
Demos
- Check out
examplesfolder - Clone the fully working repo: playwright-bdd-example
Playwright Versions Support
playwright-bdd supports all non-deprecated versions of Playwright. To check which Playwright versions are currently deprecated, run:
npm show @playwright/test@1 deprecated
Changelog
Check out the latest changes in the CHANGELOG.md.
๐ Sponsors
Great thanks to 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.
Feedback & Community
Feel free to report a bug, propose a feature or share your experience:
Contributing
Your contributions are welcome! Please review CONTRIBUTING.md for the details.
Other Playwright tools
- playwright-timeline-reporter - Interactive timeline report for Playwright test runs.
- @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.
License
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! ๐


