I don't require some book sized story, but seriously, at least some basic info?
What versions of spring are supported?
What does it even do? "Share instances across step definitons" - cool, but how exactly? Is context created per feature or per scenario? I see there are also so txn hooks, anything more?
How to go about enabling it at all?
How to enable annotation-based config?
The best thing I could find is https://zsoltfabok.com/blog/2012/01/cucumber-jvm-di/ but it's not very clear, plus involves quite a few DIY workarounds.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
Sorry no docs yet, but the code is on GitHub.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
Let's keep it open until it's 4yo!
Blogged: https://medium.com/@mlvandijk/managing-state-in-cucumber-jvm-using-spring-a795e9a1dd18 and am working on a README off this.
@mlvandijk nice, what I'm missing is a scope reference. E.g. I recall for Guice you had to use @ScenarioScoped to have a bean live for the duration of the scenario, by default it would create a new instance per each step (which can also be useful). An explicit text about how prototype and singleton scopes are going to behave would be useful.
Since my team already uses Spring in our projects, we鈥檝e opted to use Spring with Cucumber.
@mlvandijk FYI I've been using different DI frameworks for Cucumber glue with good result. You could even argue it's a nice exercise in separation preventing you from accidentally mixing the code (e.g. HK2 for application and Guice for Cuccumber)
@jakub-bochenski The @Scope("cucumber-glue") is in there (unless I'm not understanding your comment correctly?). What's still missing is some more info on using @ContextConfiguration("classpath:cucumber.xml") to mark the StepDefs, or @SpringBootTest(classes = TestConfig.class) if you're using SpringBoot (like we are at our latest project.
@mlvandijk I just mean you never mention one can also use the standard scopes with cucumber, e.g.:
@jakub-bochenski Thnx. I'll have to create some example projects to figure those out and document accordingly :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Blogged: https://medium.com/@mlvandijk/managing-state-in-cucumber-jvm-using-spring-a795e9a1dd18 and am working on a README off this.