Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Cucumber Test RunnerNew to Visual Studio Code? Get it now.
Cucumber Test Runner

Cucumber Test Runner

Preview

Krishna

|
44 installs
| (0) | Free
Run Cucumber tests with code lens support for running and debugging tests
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cucumber Test Runner for VS Code

A powerful VS Code extension that provides code lens support for running and debugging Cucumber tests directly from your feature files.

License VS Code

Features

  • Code Lens Integration: Run and debug individual scenarios or entire features with one click
  • Test Explorer: Tree view showing all features and scenarios in your workspace
  • Works with Cucumber.js
  • Smart Working Directory Detection: Automatically finds and uses the directory containing cucumber.json
  • Configurable Environment Variables: Set custom environment variables for test execution
  • Temporary Console Support: Creates dedicated terminals for test execution
  • Debug Support: Full debugging capabilities with breakpoints and step-through debugging

Code lens in VSCode

Installation

  1. Download the .vsix file from the releases
  2. Open VS Code
  3. Go to Extensions view (Ctrl+Shift+X)
  4. Click the ... menu and select "Install from VSIX..."
  5. Select the downloaded .vsix file

Alternatively, search for "Cucumber Test Runner" in the VS Code Extensions Marketplace.

Usage

Test Explorer

  1. Open the Test Explorer view in the sidebar (Testing tab)
  2. You'll see a "Cucumber Tests" section showing all your feature files
  3. Features are displayed as folders with their scenarios listed underneath
  4. Click on any item to navigate to that location in the file
  5. Use the inline buttons to run or debug specific features or scenarios
  6. Use the refresh button to update the test tree when files change Test Explorer

Note: You can disable the Test Explorer entirely by setting cucumber-test-runner-new.enableTestExplorer to false in your VS Code settings. This will hide the test explorer view and only use code lens functionality.

Running Tests

  1. From Code Lens: Open any .feature file and click the code lens buttons
  2. From Test Explorer: Click the run button next to any feature or scenario
  3. Run All Tests: Click the "Run All Tests" button in the Test Explorer toolbar

Debugging Tests

  1. From Code Lens: Click "Debug Feature" or "Debug Scenario" from the code lens
  2. From Test Explorer: Click the debug button next to any feature or scenario
  3. Set breakpoints in your step definitions
  4. The debugger will stop at breakpoints during test execution

Configuration

Configure the extension through VS Code settings:

{
  "cucumber-test-runner-new.environmentVariables": {
    "NODE_ENV": "test",
    "API_URL": "http://localhost:3000"
  },
  "cucumber-test-runner-new.debugEnvironmentVariables": {
    "DEBUG": "cucumber*",
    "LOG_LEVEL": "debug"
  },
  "cucumber-test-runner-new.testRunner": "cucumber-js",
  "cucumber-test-runner-new.profile": "dev",
  "cucumber-test-runner-new.enableCodeLens": true,
  "cucumber-test-runner-new.enableTestExplorer": true
}

Available Settings

Setting Type Default Description
cucumber-test-runner-new.enableCodeLens boolean true Enable/disable code lens functionality
cucumber-test-runner-new.enableTestExplorer boolean true Enable/disable the Experimental Cucumber Test Explorer view in the Testing sidebar
cucumber-test-runner-new.environmentVariables object {} Environment variables for test execution
cucumber-test-runner-new.debugEnvironmentVariables object {} Additional environment variables for debugging (merged with environmentVariables)
cucumber-test-runner-new.testRunner string "cucumber-js" Test runner: cucumber-js
cucumber-test-runner-new.profile string "" Cucumber profile to use (applies to cucumber-js only)

Environment Variables

The extension supports two types of environment variable configurations:

1. Test Execution Variables

Applied when running tests:

{
  "cucumber-test-runner-new.environmentVariables": {
    "NODE_ENV": "test",
    "API_URL": "http://localhost:3000",
    "DATABASE_URL": "test_database"
  }
}

2. Debug Variables

Additional variables for debugging (merged with test execution variables):

{
  "cucumber-test-runner-new.debugEnvironmentVariables": {
    "DEBUG": "cucumber*",
    "LOG_LEVEL": "debug",
    "VERBOSE": "true"
  }
}

Supported Test Runners

Cucumber.js (Node.js)

  • Default configuration
  • Supports npx cucumber-js commands
  • Full debugging with Node.js debugger

Working Directory Detection

The extension automatically detects the correct working directory by:

  1. Looking for cucumber.json in parent directories
  2. Checking for cucumber configuration in package.json
  3. Using the detected directory as the working directory for test execution

Requirements

  • VS Code 1.74.0 or later
  • Node.js (for Cucumber.js)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

0.0.1

  • Initial release
  • Code lens support for running and debugging tests
  • Multi-framework support (Cucumber.js, pytest-bdd, SpecFlow)
  • Configurable environment variables
  • Smart working directory detection

Support

If you encounter any issues or have questions, please email them to vscode-cucumber-testrunner-new@outlook.com. In coming days code for the extension will be open sourced.

Acknowledgments

  • Built with the VS Code Extension API
  • Supports the Cucumber ecosystem
  • Inspired by the need for better BDD testing tools in VS Code
  • Built with (90%) help of Github copilot.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft