alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 82 forks source link

Feature Request: Match Specific Features to Specific Steps #303

Open reynoldsbj opened 4 years ago

reynoldsbj commented 4 years ago

Describe the feature I would like to be able to specify which features correspond to which steps.

To Reproduce To elaborate, I am working on two applications, and have a folder structure as such where certain steps are shared and certain steps are independent: tests --app a ----steps --app b ----steps --shared ----steps features --app a --app b test-runners --app a --app b

I am using the features and glue attributes for @CucumberOptions to line up features with steps accordingly.

Expected behavior I would like to set up my settings.json to be something like this:

{
   "multiple-configs":
    [
        {
            "cucumberautocomplete.steps": [
                "tests/shared/steps/*.java",
                "tests/app a/steps/*.java"
            ],
            "cucumberautocomplete.syncfeatures": "features/app a/*.feature"
            "cucumberautocomplete.strictGherkinCompletion": true
        },
        {
            "cucumberautocomplete.steps": [
                "tests/shared/steps/*.java",
                "tests/app b/steps/*.java"
            ],
            "cucumberautocomplete.syncfeatures": "features/app b/*.feature"
            "cucumberautocomplete.strictGherkinCompletion": true
        }
    ]
}
}

I would like this to line up those features with those tests.

andreasmarkussen commented 4 years ago

It is a bad practice to have step definitions that mean different things, and this is not supported by cucumber as far as I am informed.

reynoldsbj commented 4 years ago

It is a bad practice to have step definitions that mean different things, and this is not supported by cucumber as far as I am informed.

I'm not sure what you mean by this. Can you elaborate? I think you think I'm saying something I'm not.

donaldpipowitch commented 4 years ago

Some tools like https://github.com/TheBrainFamily/cypress-cucumber-preprocessor allow to use such a behavior. In this specific example you have (at least by default) global step definitions in ./cypress/integration/common/**/*.js and there are step definitions per .feature file (e.g. ./cypress/integration/my-custom-test.feature would load all global step definitions and the ones defined in (./cypress/support/step_definitions/my-custom-test.js|./cypress/support/step_definitions/my-custom-test/**/*.js)).

It would be nice, if this extension could express the behavior as well.

And thank you for the extension! Very nice work.

mcm-ham commented 1 year ago

I would love this feature too. Our scenario of multiple applications could be solved in VSCode too #32693. For now a clunky workaround is https://stackoverflow.com/a/50305853/222748.