You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upgrade_v5.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -51,3 +51,17 @@ Before { _ =>
51
51
```
52
52
53
53
See also the [Hooks documentation](hooks.md).
54
+
55
+
## Under the hood
56
+
57
+
### Instantiate glue classes per scenario
58
+
59
+
Before Cucumber Scala 5.x, glue classes (classes extending `ScalaDsl`) were instantiated only once for a test suite.
60
+
61
+
This means that if you wanted to keep state between steps of your scenarios, you had to make sure the state was not shared to other scenarios by using hooks or manual checks.
62
+
63
+
Starting from Cucumber Scala 5.x, **each scenario creates new glue class instances**.
64
+
65
+
You should not notice any change unless you rely on state kept between scenarios in your glue classes.
66
+
Please note that this is not the proper way to keep a state.
67
+
You might want to use an `object` for this purpose.
0 commit comments