A VS Code extension that seamlessly integrates Cucumber feature files with VS Code's Test Explorer. Run and debug your Java Cucumber tests directly from the test panel with a clean, modern interface.
- π§ͺ Test Explorer Integration: All your Cucumber features and scenarios appear in VS Code's Test Explorer panel
- π― Individual Scenario Execution: Run specific scenarios without executing the entire feature
- π Status Bar: Real-time test count and execution status in the status bar
- π Auto-discovery: Automatically finds and displays all feature files in your workspace
- π« Smart Filtering: Excludes build directories (target, build, out) to prevent duplicate tests
- β‘ Fast Refresh: Instantly refresh test list when new features are added
- π§ Auto-configuration: Automatically detects glue path, no manual setup required
- π Optional CodeLens: Enable traditional play buttons in feature files if preferred
- π Internationalization: Available in English and Turkish
The primary way to run Cucumber tests is through VS Code's Test Explorer:
- Open Test Explorer: Click the test tube icon in the activity bar or press
Ctrl+Shift+T - View Your Tests: All feature files and scenarios are automatically discovered and displayed
- Run Tests: Click the play button next to any feature or scenario to run it
- Debug Tests: Click the debug icon to debug with breakpoints
- Refresh: Use the refresh button in Test Explorer to discover new tests
π§ͺ Test Explorer
ββ π Cucumber Java Tests
ββ π Login Feature
β ββ β
Successful login
β ββ β
Failed login with wrong password
β ββ β
Password reset flow
ββ π Shopping Cart Feature
β ββ β
Add item to cart
β ββ β
Remove item from cart
β ββ β
Checkout process
ββ π User Registration Feature
ββ β
Valid registration
ββ β Invalid email format
The extension displays a status bar item at the bottom of VS Code showing:
- Test count:
π§ͺ Cucumber: 42 tests- Total number of discovered tests - Running:
π Running: Scenario name...- Currently executing test - Passed:
β Cucumber: Passed- All tests passed (green background) - Failed:
β Cucumber: Failed- One or more tests failed (red background)
The test count updates automatically when feature files are added, modified, or deleted.
Debug your Cucumber tests with full breakpoint support:
- Set Breakpoints: Add breakpoints in your Java step definition files
- Start Debug: Click the debug icon in Test Explorer or use "Debug" from context menu
- Inspect Variables: Use VS Code's debug panel to inspect variables and step through code
Available debug commands:
Cucumber: Debug Feature- Debug entire feature fileCucumber: Debug Scenario- Debug specific scenarioCucumber: Debug Example- Debug specific example row in Scenario Outline
If you prefer the traditional approach with play buttons in feature files:
- Enable CodeLens: Go to VS Code Settings β Extensions β Cucumber Java Easy Runner
- Check "Enable CodeLens": This will show play buttons directly in your feature files
- Use Play Buttons: Click the buttons that appear on Feature, Scenario, and Example lines
Example feature file with CodeLens enabled:
βΆ Run Feature π Debug Feature
Feature: Shopping Cart
βΆ Run Scenario π Debug Scenario
Scenario: Adding an item to cart
Given I am on the product page
When I click "Add to Cart"
Then the item should be added to my cart
βΆ Run Scenario π Debug Scenario
Scenario Outline: User login
Given I enter "<username>" and "<password>"
Then I should see "<result>"
Examples:
| username | password | result |
βΆ π | admin | admin123 | Welcome! |
βΆ π | user1 | pass123 | Welcome! |You can also right-click on feature files:
- Right-click on a
.featurefile in the file explorer β "Cucumber: Run Feature" - Right-click in an open feature file β "Cucumber: Run/Debug Feature/Scenario/Example"
- Clean, organized view of all tests
- Integrated with VS Code's testing framework
- Shows test status with clear icons
- No visual clutter in feature files
- Supports both Run and Debug
- Traditional play buttons in feature files
- Similar to IntelliJ IDEA experience
- Enable via settings if preferred
- Includes both Run and Debug buttons
Configure the extension behavior in VS Code Settings:
{
"cucumberJavaEasyRunner.enableCodeLens": false,
"cucumberJavaEasyRunner.autoCompileMaven": false,
"cucumberJavaEasyRunner.additionalGluePaths": [],
"cucumberJavaEasyRunner.excludeBuildDirectories": [
"target",
"build",
"out",
"dist",
"node_modules",
".git"
],
"cucumberJavaEasyRunner.objectFactory": "",
"cucumberJavaEasyRunner.logLevel": "info"
}Settings Options:
enableCodeLens(boolean, default: false): Show play buttons in feature files. When disabled, use Test Explorer for a cleaner interface.autoCompileMaven(boolean, default: false): Iftrue, runsmvn compile test-compilebefore each execution. Leavefalsewhen you handle builds yourself for faster runs.additionalGluePaths(string array, default:[]): Extra Java package names that contain step definitions (useful for shared modules).excludeBuildDirectories(string array): Directories ignored during feature discovery. Customize if your build output uses different folder names.objectFactory(string, optional): Custom Cucumber object factory class (e.g.,cucumber.api.spring.SpringFactory).logLevel(string, default: "info"): Controls the verbosity of extension logs in the Output panel. Options:error,warn,info,debug,trace.
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X) - Search for "Cucumber Java Easy Runner"
- Click Install
- Download the
.vsixfile from Releases - Open Extensions view β "..." menu β "Install from VSIX"
- Select the downloaded file
- Java: JDK 8 or higher
- Maven: 3.6 or higher
- Project Structure: Standard Maven layout
- Dependencies: Cucumber-JVM in your pom.xml
- For Debugging: Debugger for Java extension
Zero Configuration Required! The extension works automatically with standard Maven projects:
- β Auto-detects step definition glue path
- β Finds all feature files in your workspace
- β Excludes build directories automatically
- β Integrates with VS Code Test Explorer
- β Supports generated-sources (Swagger, etc.)
If auto-detection fails, you'll be prompted to enter your glue path manually (e.g., com.example.steps).
Automatic: New feature files are detected automatically, test count in status bar updates in real-time Manual: Use the refresh button in Test Explorer or Command Palette β "Refresh Cucumber Tests"
The extension is available in:
- π¬π§ English (default)
- πΉπ· Turkish (TΓΌrkΓ§e)
The language is automatically selected based on your VS Code display language setting.
Tests not showing in Test Explorer:
- Make sure you have
.featurefiles in your workspace - Check that files aren't in excluded directories (target, build, out)
- Use the refresh button in Test Explorer
CodeLens buttons not showing:
- Enable CodeLens in extension settings
- Make sure you're viewing a
.featurefile
Glue path errors:
- Extension will prompt you to enter the path manually
- Use Java package format:
com.example.steps
Test execution issues:
- Verify Maven project structure
- Check Cucumber dependencies in pom.xml
- Ensure Java and Maven are properly installed
Debug not working:
- Make sure you have the Debugger for Java extension installed
- Check that breakpoints are set in
.javafiles, not.featurefiles
Generated sources not found:
- The extension automatically includes
target/generated-sources/*in classpath - Run
mvn compileto generate sources before running tests
# Install dependencies
npm install
# Generate localization files
npm run generate-nls
# Compile
npm run compile
# Package
npx vsce package --no-dependenciesFound a bug or have a feature request? Please report it on GitHub Issues.
Developer: Hakki Etem
Repository: GitHub
