🎭 Playwright BDD Test Runner
A comprehensive VS Code extension for running Playwright BDD tests with advanced debugging and multi-workspace support.

🚀 Quick Start
- Install the Extension: Search for "BDD Test Runner" in the VS Code Marketplace
- Open Your Project: Open a workspace containing
.feature files
- Configure: Access settings via Command Palette → "BDD Test Runner: Settings"
- Run Tests: Use the Test Explorer or Command Palette to execute your tests
- Start Testing: Begin running and debugging your BDD tests
✨ Key Features
🧪 Core BDD Testing
- Full Gherkin Support: Given/When/Then/And/But statements with Scenario Outlines
- Test Discovery: Automatic detection and caching of feature files
- Test Explorer Integration: Native VS Code Test Explorer support
- Step Definition Linking: Navigate from steps to their implementations
- Tag-Based Filtering: Run specific test subsets using
@tag annotations
- Generate Step Definitions: Create step definitions directly from feature files
- Right-click on any step → "Generate Step Definition"
- Bulk generation for entire feature files
- Smart parameter detection (
{string}, {int}, {float})
- Append to existing files or create new ones
🛠️ Advanced Debugging
- Step-by-Step Debugging: Debug individual Gherkin steps with full context
- Visual Breakpoints: Set breakpoints directly on feature file steps
- Variable Inspection: Inspect variables and application state during execution
- Conditional Breakpoints: Advanced breakpoint conditions for complex scenarios
🏢 Multi-Workspace Support
- Workspace Management: Handle multiple projects simultaneously
- Cross-Workspace Search: Search tests across all open workspaces
- Parallel Execution: Run tests across multiple workspaces in parallel
- Workspace Analytics: Track performance and metrics across projects
🔄 CI/CD Integration
- GitHub Actions: Built-in GitHub workflow management
- Workflow Triggers: Trigger CI/CD pipelines directly from VS Code
- Report Integration: Import and view CI/CD test results
- Status Monitoring: Real-time workflow status updates
⚙️ Comprehensive Configuration
- Settings UI: User-friendly configuration interface
- Auto-Discovery: Automatic project configuration detection
- Import/Export: Backup and share configuration settings
- Validation: Built-in configuration validation and error detection
📚 Documentation
📖 Complete Guides
🎯 Quick Links
🛠️ Installation & Setup
Prerequisites
- VS Code: Version 1.101.0 or higher
- Node.js: Version 16 or higher
- Playwright: Installed in your project (
npm install @playwright/test)
- Playwright BDD: Optional, for enhanced BDD support (
npm install playwright-bdd)
Installation Steps
Install Extension:
# Via VS Code Marketplace
code --install-extension rohitsakhawalkar.playwright-bdd-lens
Open Project: Open a workspace containing .feature files
Auto-Configuration: The extension will automatically detect your project structure
Manual Configuration (if needed):
- Open Command Palette (
Ctrl+Shift+P)
- Run "BDD Test Runner: Settings"
- Configure paths and preferences
Project Structure
your-project/
├── features/ # Feature files (.feature)
│ ├── login.feature
│ └── dashboard.feature
├── steps/ # Step definitions
│ ├── login.steps.ts
│ └── common.steps.ts
├── playwright.config.ts # Playwright configuration
└── package.json
🎮 Basic Usage
Running Tests
Via Test Explorer
- Open the Test Explorer panel in VS Code
- Find the "BDD Test Explorer" section
- Click ▶️ to run individual tests or entire features
- View results in real-time
Via Command Palette
Ctrl+Shift+P → "Run Playwright BDD Tests"
- Choose specific scenarios or run all tests
Via CodeLens
- Open any
.feature file
- Click the "Run Scenario" links above each scenario
Debugging Tests
Setting Breakpoints
- Open a
.feature file
- Click in the gutter next to any step to set a breakpoint
- Run the test in debug mode
- Execution will pause at your breakpoint
Step-by-Step Debugging
- Position cursor on a scenario
- Command Palette → "Start Step-by-Step Debugging"
- Step through each Gherkin step individually
🔧 Advanced Features
Multi-Workspace Management
Setting Up Multiple Workspaces
- Open multiple workspace folders in VS Code
- Extension automatically detects all workspaces
- Use "Show Workspaces" command to manage
Cross-Workspace Operations
- Search:
Command Palette → "Search Across Workspaces"
- Run Tests:
Command Palette → "Run Tests Across Workspaces"
- Analytics:
Command Palette → "Workspace Analytics"
CI/CD Integration
GitHub Actions Setup
Configure Token:
- Settings → CI/CD Integration → GitHub Token
- Provide Personal Access Token with workflow permissions
Enable Integration:
- Enable "CI/CD Integration"
- Set "Auto-Trigger Workflows" if desired
Manage Workflows:
Command Palette → "Manage GitHub Workflows"
- Create, trigger, and monitor workflows
Custom Configuration
Environment-Specific Settings
Development:
{
"playwrightBdd.tags": "@dev",
"playwrightBdd.execution.retryCount": 1
}
Production:
{
"playwrightBdd.tags": "@smoke",
"playwrightBdd.execution.retryCount": 3
}
Custom Commands
{
"playwrightBdd.testCommand": "npx playwright test --config=custom.config.ts ${tagsArg}",
"playwrightBdd.featureGenCommand": "npm run generate-features"
}
📊 Configuration Examples
Minimal Setup
{
"playwrightBdd.configPath": "./playwright.config.ts",
"playwrightBdd.featureFolder": "features",
"playwrightBdd.stepsFolder": "steps"
}
Full Featured Setup
{
"playwrightBdd.configPath": "./playwright.config.ts",
"playwrightBdd.featureFolder": "features",
"playwrightBdd.stepsFolder": "steps",
"playwrightBdd.autoDiscoverConfig": true,
"playwrightBdd.execution.retryCount": 2,
"playwrightBdd.execution.retryDelay": 2000,
"playwrightBdd.cicd.enabled": true
}
{
"playwrightBdd.ui.autoRefreshInterval": 0,
"playwrightBdd.stepsFilePattern": "**/*.steps.{js,ts}"
}
🤝 Contributing
We welcome contributions! Here's how to get started:
Development Setup
# Clone the repository
git clone https://github.com/Rohit5688/playwright-bdd-runner.git
# Install dependencies
cd playwright-bdd-runner
npm install
# Build the extension
npm run compile
# Run tests
npm test
Contributing Guidelines
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Areas for Contribution
- 🐛 Bug Fixes: Help us identify and fix issues
- ✨ Features: Implement new functionality
- 📚 Documentation: Improve guides and examples
- 🧪 Testing: Add test coverage
- 🎨 UI/UX: Enhance user experience
📝 Changelog
Version 0.4.2 (Latest)
- ✨ NEW: Generate Step Definition command for creating individual step definitions
- ✨ NEW: Generate All Step Definitions for bulk creation from feature files
- ✨ NEW: Smart parameter detection with Cucumber expression placeholders
- 🐛 FIXED: File append logic now correctly appends to existing step files
- 🛠️ IMPROVED: Debug logging for step generation operations
Version 0.4.1
- 🐛 FIXED: Step definition navigation with scenario outline placeholders
- 🐛 FIXED: Real-time step validation warnings in feature files
- ✨ NEW: Diagnostic provider for missing step definitions
- 🛠️ IMPROVED: Pattern matching for complex parameter types
Version 0.4.0
- ✨ NEW: Comprehensive Settings UI with all configuration options
- ✨ NEW: Retry mechanism with configurable count and delay
- ✨ NEW: Import/Export settings functionality
- 🛠️ IMPROVED: Enhanced error analysis and debugging
- 🛠️ IMPROVED: Better test discovery performance with caching
- 🛠️ IMPROVED: Multi-workspace support and management
- 🛠️ IMPROVED: CI/CD integration with GitHub Actions
See CHANGELOG.md for complete version history.
🆘 Support & Help
Getting Help
- Documentation: Check our comprehensive docs directory
- Settings Validation: Use "Validate Configuration" in Settings UI
- Output Panel: Check the "Playwright BDD" output for error details
- Issues: Report bugs on GitHub Issues
Common Issues & Solutions
| Issue |
Solution |
| Tests not discovered |
Check featureFolder setting and file structure |
| Step definitions not found |
Verify stepsFolder and stepsFilePattern |
| Performance issues |
Disable autoRefreshInterval for better performance |
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Playwright Team: For the excellent testing framework
- VS Code Team: For the robust extension platform
- BDD Community: For valuable feedback and contributions
- Contributors: Everyone who has helped improve this extension
Made with ❤️ for the testing community
⬆️ Back to top