Skip to content
项目

关于

使用 Playwright 运行器进行 BDD 测试。

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+7
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Playwright-BDD

Run BDD tests with Playwright runner

lint test npm version npm downloads license

🚀 Getting Started  📚 Documentation  ▶️ Example  📝 Changelog 🔥 Try v10 (beta)

BDD in the Era of AI

Behavior-Driven Development (BDD) describes product requirements as Given / When / Then scenarios written in plain-text format:

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 because they are:

  • ✅ Readable: You can easily draft and refine scenarios with agents.
  • ✅ Executable: You can run the scenarios as automated tests.

Unlike plain Markdown docs, BDD makes the spec live and keeps it aligned with the codebase.

Watch the YouTube 1-minute workflow overview or read the blog post to see agentic BDD in action.

To bring this workflow to your project, set up Playwright-BDD and add the playwright-bdd skill for your AI coding agent.

[!NOTE] The ultimate goal: review only feature files and let automated guardrails do the rest.

How Playwright-BDD works

Playwright-BDD transforms feature files into Playwright tests and wires up step implementations:

Feature file transformed into a Playwright test

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

Extras

Playwright-BDD has several unique features:

Documentation

Check out the documentation website.

[!TIP] Playwright-BDD v10 is available in beta. Try new features →

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:

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

探索相关项目

加载中…