BDD Mode with Playwright-BDD
Auto-Browse seamlessly integrates with playwright-bdd to enable behavior-driven development. This integration allows you to write expressive feature files and implement steps using natural language commands.Setup
Installation
- Install required dependencies:
- Configure
playwright.config.ts
:
Writing Tests
Feature Files
Create Gherkin feature files to describe your test scenarios:Step Definitions
Implement your steps using Auto-Browse’s natural language commands: Note, you only need one step definition for theWhen
step, as it will handle all actions.
(It can be when, given or then either of one step)
Example Implementation
Here’s a complete example showing how to test a login flow:Feature File
Step Definitions
Next Steps
- Learn about Standalone Mode
- Explore Test Mode
- Check out Supported Actions