Open hardymj opened 1 year ago
This code change enables breakpoints to work for me https://github.com/hardymj/cucumber-test-runner/tree/enableBreakpointsInDebugMode
Hey @hardymj
thanks again for the feedback, I've done some tests to find the cause of this problem and I was able to reproduce your problem only when not using ts-node
as a runner. I'll take a look to your change and see if it works for ts-node too, otherwise I need to find a solution that works for both.
Hey @hardymj
thanks again for the feedback, I've done some tests to find the cause of this problem and I was able to reproduce your problem only when not using
ts-node
as a runner. I'll take a look to your change and see if it works for ts-node too, otherwise I need to find a solution that works for both.
thanks
I think there is some extra work needed on this change. It does not use the config settings within the settings.json or cucumber.js for some reason
Hi, Did you chance to find a change that would work when not using ts-node as a runner?
Hey @hardymj
thanks again for the feedback, I've done some tests to find the cause of this problem and I was able to reproduce your problem only when not using
ts-node
as a runner. I'll take a look to your change and see if it works for ts-node too, otherwise I need to find a solution that works for both.
I've created a very basic test.
The test
@Test @Examples Feature: Test Examples
Background:Before Test Scenarios Scenario:2 This is a Test When I do something
The steps.js file just prints out a number to a console.
const {Given, When, Before, After, setDefaultTimeout, Status} = require('@cucumber/cucumber'); setDefaultTimeout(60 * 1000); Given('I do something', async function() { await new Promise(resolve => setTimeout(resolve, 5000)); await console.log("1"); });
When i go to click on the Debug option within Test Explorer, it runs the test even though there are breakpoints in the Steps file.
Within the cucumber.js file i have the following.
module.exports = { default: { ...common, }, cli: { ...common, paths: ['journeys///*.feature'], }, };
I've created a launch.json file and this does run in stop at breakpoints { "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Debug Cucumber Tests", "program": "node_modules/@cucumber/cucumber/bin/cucumber-js", "args": [ "--require", "features/support/*.js", "features" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" } ] }
Any ideas how to get the Button within Visual Studio Code to use breakpoints?