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

@ScenarioState fields are not transferred to @ScenarioStage when no method in injected stage is invoked #303

Open
nikowitt opened this issue Feb 13, 2017 · 2 comments

Comments

@nikowitt
Copy link
Contributor

Hi there,

I'm using a global configuration object that is shared across the stages via @ScenarioState. When an additional stage with @ScenarioStage is used, I have to invoke a method there, otherwise the @ScenarioState is not shared. As this global configuration is also used in the after methods, it is important that @ScenarioState fields are also shared as this has some side-effects since I don't have to use the injected stage in all cases.

Best regards, Niko

@janschaefer
Copy link
Contributor

Ok. This behavior is basically by design. As long as you don't call a method on a stage, the stage is not considered to be part of the scenario. Although @BeforeScenarion and @AfterScenario methods are still executed. So I guess we would have to introduce some additional mechanism/annotation for that.

@nikowitt
Copy link
Contributor Author

I see. Then I think it is actually more consistent if beforescenario/afterscenario are also not invoked, but this might be tricky in some cases.

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

2 participants