Skip to content

Commit e8b3ec1

Browse files
committed
Add upgrade documentation
1 parent 1c3ea40 commit e8b3ec1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/upgrade_v5.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,18 @@ Before("@tag1 or @tag2", 1) { _ =>
3333
}
3434
```
3535

36-
See also the [Hooks documentation](hooks.md).
36+
See also the [Hooks documentation](hooks.md).
37+
38+
## Under the hood
39+
40+
### Instantiate glue classes per scenario
41+
42+
Before Cucumber Scala 5.x, glue classes (classes extending `ScalaDsl`) were instantiated only once for a test suite.
43+
44+
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.
45+
46+
Starting from Cucumber Scala 5.x, **each scenario creates new glue class instances**.
47+
48+
You should not notice any change unless you rely on state kept between scenarios in your glue classes.
49+
Please note that this is not the proper way to keep a state.
50+
You might want to use an `object` for this purpose.

0 commit comments

Comments
 (0)