This extension integrates CucumberJS with Visual Studio Code Test Runner.
Semlessly integrates with Visual Studio Code new Test Runner showing all files in your workspace and a detailed view of all:
- Features
- Scenarios
- Steps
Now you can view which steps passed or failed directly in your .feature files, and with the help of the official Cucumber extension you can ctrl+click to navigate to your failing step.
After running the test you will see an inline report of the failing tests with extensive details of the error and an history of test results.
You can even debug your tests directly from the Test Runner UI, just click the Debug Test action on a Feature or a Scenario!
We support searching and filtering tests by @Tag (Thanks to psethwick)
Now you can specify environment variables in your settings.json file, so that when you run your tests those variables will be defined.
{
"cucumberTestRunner.env": {
"MY_VARIABLE_1": "foo",
"MY_VARIABLE_2": "bar"
}
}Now you can select a profile to run the tests
const common = {
require: ["features/**/*.{js,ts}"],
requireModule: ["ts-node/register"],
publishQuiet: true,
};
module.exports = {
default: {
...common,
paths: ["features/**/*.feature"],
},
customProfile: {
...common,
},
};{
"cucumberTestRunner.profile": "customProfile"
}Now the extension detects and reports errors in before and after hooks. If possible it reports a problem directly at the line where the error occurred in the source file. The support is still limited, stay tuned for the next updates.
You need to have a working cucumber-js installation in your working folder and a proper cucumber configuration file.
Please follow the documentation on the official cucumber-js website on how to setup the environment.
You need to install the @cucumber/cucumber npm package
npm install @cucumber/cucumberFor typescript support you need to install ts-node
npm install ts-nodeThe extension has been tested with javascript and typescript.
Example of a cucumber.yml file for a typescript setup:
default:
features: ["features/**/*.feature"]
requireModule: ["ts-node/register"]
require: ["features/**/*.{js,ts}"]
publishQuiet: true- At the moment you cannot undefine an existing environment variable, the only thing you can do is set the variable to an empty string.





