Run BDD tests with Playwright runner
🚀 Getting Started
📚 Documentation
Behavior-Driven Development (BDD) describes product requirements as Given / When / Then scenarios written in plain-text:
Feature: Buying a pizza
Scenario: Success order
Given I am on the "Pepperoni" pizza page
When I add 2 pizzas to the cart
And I complete checkout
Then I see an order confirmation:
| Product | Pepperoni |
| Quantity | 2 |In the AI era, these scenarios become valuable artifacts for agents because they are both:
- ✅ Readable: You can easily draft and refine scenarios with an agent to clearly define the behavior.
- ✅ Executable: The same scenarios can be executed as automated tests to verify the implementation.
Unlike plain Markdown specs, BDD does not just describe a feature; it makes the spec live and keeps it aligned with the codebase.
Watch the 1-minute workflow overview or read the blog post to see agentic BDD in action. The ultimate goal: review only feature files and let automated guardrails check code quality and scenario compliance.
To bring this workflow to your project, set up Playwright-BDD and add the playwright-bdd skill for your AI coding agent.
Playwright provides both browser automation APIs and a powerful test runner. Playwright-BDD converts .feature files into native Playwright tests, so you can use all Playwright runner capabilities:
- 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
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
examplesfolder - Clone the fully working repo: playwright-bdd-example
playwright-bdd supports the latest stable Playwright release and the 10 previous releases.
Check out the latest changes in the CHANGELOG.md.
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.
Feel free to report a bug, propose a feature or share your experience:
Your contributions are welcome! Please review CONTRIBUTING.md for the details.
- 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-webext - Testing browser extensions with Playwright.
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! 🎉


