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

How to change the default behaviour of FeatureContext for Cucumber Tests #980

Open
EAlf91 opened this issue Mar 26, 2023 · 1 comment
Open

Comments

@EAlf91
Copy link

EAlf91 commented Mar 26, 2023

Currently I'm facing the issue that I want to disable my features when running cucumber tests to not interfere with the old behaviour of the app.

I configured the TestFeatureManager for this and added this for my feature files and the test steps

@Autowire 
FeatureManager featureManager

@Before("@FeaturesDisabled")
public void disableFeatures(Scenario scenario) {

    featureManager.disable(MyFeatures.HELLO_WORLD);
}

Unfortunately, while the featuremanager get's properly injected in my tests, the application code uses the enum method, which always returns some FallBacktestFeatureManager:

FeatureContext.getFeatureManager() //does not return the configured Featuremanager

Is it possible to customize the FeatureContext?

@brunojanvier77
Copy link

We also need the same thing. +1
Possibility to customize so that the default test behavior is that the flags are disabled to match production conditions.

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

No branches or pull requests

2 participants