cucumber-scala instantiates step definition classes per test JVM instead of per scenario
mpkorstanje opened this issue · 2 comments
From: cucumber/cucumber-jvm#755
From https://groups.google.com/forum/#!topic/cukes/eOhisAzEvQo, written by @tristanmccarthy:
"The problem I am hitting is that step def classes appear to be instantiated only once, at the start of the test run. Based on reading around (and previous experience with Java) I'd expect the glue code classes to be instantiated once per scenario instead, and the way I am trying to set everything up requires this."
"...I've stuck a quick and dirty example up on github for some context:
https://github.com/tristanmccarthy/cucumber-scala-webtest"
Related to #4
We workaround this by using traits but 100% agree we should not need traits.
By default, each scenario should have its own context, with new instance classes.