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

BeforeAll and AfterAll hooks #33

Open
manuelbernhardt opened this issue Sep 17, 2013 · 2 comments
Open

BeforeAll and AfterAll hooks #33

manuelbernhardt opened this issue Sep 17, 2013 · 2 comments

Comments

@manuelbernhardt
Copy link
Contributor

It would be great to have those hooks in order to allow usage in environments that require global set-up & shut down, such as the Play framework. Using the SBT setting hooks cucumberBefore and cucumberAfter does not seem to be easily possible in this case because running the Play testing environment (which also launches database plugins, etc.) is only available in Play code, and the SBT build itself won't have those in scope.

Strangely enough I was able to initialize the Play environment in the previous version of the plugin (0.7.2) by calling the Play.start() method directly in the test class, however this no longer seems to work now.

@skipoleschris
Copy link
Owner

Unfortunately that's not something I have control over really. In fact, when running the cucumber task, the plugin forks a new JVM and executes the cucumber-jvm main method. So, there's really no scope for supporting BarofeAll/AfterAll hooks at this level. This feels like something that should be handled by cucumber-jvm itself. In fact, there's an issue specifically related to this: cucumber/cucumber-jvm#515

There may be some possibility to support this within the test task integration model and I'm planning on revisiting this implementation in the near future, so I'll see what might be possible.

@manuelbernhardt
Copy link
Contributor Author

Thanks! In the meantime I found out that the problem I'm facing is more likely due to a regression with Play 2.2, so I'm looking into this now. The hooks would still be convenient but there should be a way to work without them.

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