Skip to content

vitalets/playwright-bdd

Playwright-BDD

Run BDD tests with Playwright runner

lint test npm version npm downloads license

Documentation | Example | Changelog

Why BDD?

In the era of AI, you can take BDD approach to the next level:

  • 🤖 Generate feature files from raw business requirements using AI.
  • Refine scenarios with colleagues or AI in plain human language.
  • 🛠 Automate test execution using the Playwright runner.

Why Playwright Runner?

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

How It Works

Extras

Playwright-BDD has several unique features:

Documentation

Check out the documentation website.

Examples

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

Feedback & Community

Feel free to report a bug, propose a feature or share your experience:

Changelog

Check out the latest changes in the CHANGELOG.md.

Contributing

Your contributions are welcome! Please review CONTRIBUTING.md for the details.

💖 Sponsors

A big thank you to all the amazing people and companies already supporting Playwright-BDD! Your help keeps the project alive and growing:

User avatar: Currents.devUser avatar: 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.

How to make BDD valuable for my project?

Have a look on this section.

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