I was trying to debug Cucumber scenarios in Visual Studio code and made below changes in the launch.json
.
{
"name": "e2e",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}\\node_modules\\.bin\\cucumber-js",
"stopOnEntry": false,
"args": ["--no-timeouts", "--colors"],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"outFiles": [
"${workspaceRoot}\\features\\step_definitions\\*.js"
]
},
However, I am not able run a debug session using the above configuration. The step def. files I created in JavaScript. So, just need a help on the script above if that looks fine?
Tweaking the answer from Mukesh Rawat plus ensuring additional file paths were correct, got it working for me, :
Launch.json
Workspace.json
Package.json
CucumberTest.feature
You could try below configuration to make your debug working in VS Code. In the
outFiles
give your feature file path.============================================
UPDATE AS OF cucumber ^5.0.2:
If you want to debug only CURRENT feature, add this to launch.json
When working with Ruby, it could be used on this way to run specific feature files: