Skip to content

About

BDD testing with Playwright runner

Topics

Resources

Code of conduct

Contributing

Stars

797 stars

Watchers

21 watching

Forks

Repository files navigation

Playwright-BDD

Run BDD tests with Playwright runner

lint test npm version npm downloads license

🚀 Getting Started  📚 Documentation  ▶️ Example  📝 Changelog

BDD in the Era of AI

Behavior-Driven Development (BDD) describes product requirements as Given / When / Then scenarios written in plain-text files. In the AI era, these scenarios become valuable artifacts for agents for two reasons:

  • ✅ 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 agent-generated code.

Unlike plain Markdown specs, BDD does not just describe the feature; it makes the spec live and keeps it aligned with the codebase.

The ultimate dev flow: review only feature files + apply automated checks for code quality and scenario compliance.

Install the playwright-bdd skill and check out the blog post on using BDD in agentic workflows.

Feature: Agentic development

  Scenario: Implement a new feature
    Given business requirements
    When a human defines the behavior as BDD steps
-   Then the human implements the feature and verifies it with tests
+   Then the agent implements the feature and verifies it with tests

Why Playwright Runner?

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

How It Works

Extras

Playwright-BDD has several unique features:

Documentation

Check out the documentation website.

Demos

Playwright Versions Support

playwright-bdd supports the latest stable Playwright release and the 10 previous releases.

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:

Currents

TestMu AI

User avatar: Arturs LeščinskisUser avatar: User avatar: Francesco Borzì

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.

My Other Playwright tools

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! 🎉

About

BDD testing with Playwright runner

Topics

Resources

Code of conduct

Contributing

Stars

797 stars

Watchers

21 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages