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

Feature Request: Match Specific Features to Specific Steps #303

Open
reynoldsbj opened this issue Nov 15, 2019 · 4 comments
Open

Feature Request: Match Specific Features to Specific Steps #303

reynoldsbj opened this issue Nov 15, 2019 · 4 comments

Comments

@reynoldsbj
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link

donaldpipowitch commented Dec 20, 2019

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
Copy link

mcm-ham commented Aug 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants