Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to run a single test, other tests from other feature files are also ran #4

Closed
hardymj opened this issue May 12, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@hardymj
Copy link

hardymj commented May 12, 2023

Hi,

I have two feature files as an example
image

They both contain 2 tests each that currently only print out the name of the test.

image

If I select TestFive to run on its own by pressing the Run Test or Debug Test, it will run TestFive but also TestSeven and TestEight from the other FeatureFile.
The only test it does not run is the other test within the same FeatureFile.

image

If I add another simple test to FeatureOne and run a single Test, it will ignore the tests within the same FeatureFile

image

My cucumber.js file is as follows

module.exports = {
default: {
parallel: 1,
retry:0,
format: ['html:cucumber-report.html'],
paths:['journeys///.feature'],
require:['features/support/
.js'],
publishQuiet: true
}
}

@Balrog994 Balrog994 added the bug Something isn't working label May 15, 2023
@Balrog994 Balrog994 self-assigned this May 15, 2023
@Balrog994
Copy link
Owner

Hi, thanks for your feedback!

I tracked down your problem to be the same mentioned in #1.
More precisely the problem lies in how cucumber-cli handles arguments from the command line and your configuration file.

To solve the problem I suggest creating 2 profiles in your cucumber.js file one called default used by the runner (in the future I'll allow you to select a profile name from the extension) and one named as you prefer to run the test directly from terminal.

The following is an example you can use to change your cucumber.js file:

const common = {
    parallel: 1,
    retry:0,
    format: ["html:cucumber-report.html"],
    require:['features/support/.js'],
    publishQuiet: true
};

module.exports = {
  default: {
    ...common,
  },
  cli: {
    ...common,
    paths: ['journeys|/|.feature'],
  },
};

If it works let me know so I can close the issue.

Thanks

@Balrog994 Balrog994 added question Further information is requested and removed bug Something isn't working labels May 15, 2023
@hardymj
Copy link
Author

hardymj commented May 15, 2023

Hi @Balrog994 ,
Yes you are correct.
I created the profiles as suggested in the cucumber.js file and it does indeed only run one of the tests now within Test Explorer
For the command line, I added in the -p cli to the script to run or else it defaults back to default.
Thanks

@hardymj hardymj closed this as completed May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants