Having trouble running a single cucumber scenario in VSCode? This extension can save you!

Install Cucumber-Quick

Create Cucumber-Quick Configuration

  • Protractor Cucumber
  • WebDriverIo Cucumber
  • Cypress Cucumber Pre-processor
  • Native CucumberJS
  • Serenity-JS
  1. create settings.json file under .vscode folder (ignore if already created)
  2. create the cucumber-quick option for the specific tool you are using. The configuration structure is shown below:
// .vscode > settings.json{
"cucumber-quick": {
"tool": "tool-name",
"script": "npx tool-name relative-path/to/configurations"
}
}

Protractor-Cucumber/ SerenityJS Configuration

// .vscode > settings.json{
"cucumber-quick": {
"tool": "protractor",
"script": "npx protractor relative-path/to/protractor.conf.js"
}
}

WebDriverIO Configuration

  • Make sure the WebDriverIO-cucumber setup uses wdio-test-runner, that means, it should have cucumberOpts enabled. Remember, the cucumber-boilerplate provided by WebDriverIO uses yadda as a cucumber framework. In that case, this extension will not work. But once you switch to wdio-test-runner, this extension will work like magic!
// .vscode > settings.json{
"cucumber-quick": {
"tool": "webdriverio",
"script": "npx wdio relative-path/to/wdio.conf.js"
}
}

Cypress-Cucumber-Preprocessor Configuration

  • Cypress cucumber preprocessor currently supports ruining specific features. Running specific scenario by scenario name is still not supported by cypress-cucumber-preprocessor. It supports to run a specific scenario by TAGS. You need to right-click on the Tags name in this case.
  • Cucumber-Quick only supports Cypress-Cucumber-Preprocessor V 2.1.0 or higher.
  • For other tools, execution happens in the VSCode Output terminal, but for Cypress, execution happens in the Integrated terminal.
// .vscode > settings.json
{
"cucumber-quick": {
"tool": "cypress",
"script": "npx cypress-tags"
}
}

Native Cucumber-JS Configuration

// .vscode > settings.json
{
"cucumber-quick": {
"tool": "cucumberjs",
"script": "npx cucumber-js relative- path/to/**/*.feature --require relative-path/to/**/*.js"
}
}

Let's have a Demo!

Raise your concern

--

--

--

Tech Lead Manager @Postman 🚀 | Space Movie Lover 🪐 | Coder 👨‍💻 | Traveller ⛰️

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Reduce your flutter web app loading time

10 Common JavaScript Method You Need to Know

DIFFERENCE BETWEEN VAR, LET & CONST IN JAVASCRIPT

How to use padStart & padEnd — ES7

What is Cryptography? And What’s the RSA algorithm?

Introduction to Web Components

“Vanilla” Javascript vs. React, and when to use Redux

Objects in JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinaba Ghosh

Abhinaba Ghosh

Tech Lead Manager @Postman 🚀 | Space Movie Lover 🪐 | Coder 👨‍💻 | Traveller ⛰️

More from Medium

The curious case of creating Salesforce custom objects through the API

Streamline Your Oracle Cloud Migration with Intelligent Test Automation

TOP 5 TIPS TO IMPLEMENT UAT

A practical guide to Visual Regression Testing with Cypress