Use of BeforeAll/AfterAll in Kotlin-based Cucumber suite does not work as expected #2934
Labels
π documentation
Improvements or additions to documentation
Milestone
π What did you see?
@BeforeAll
in a Kotlin-based Cucumber suite did not work as expected, even though placed in acompanion object
and annotated@JvmStatic
β What did you expect to see?
I expected the
@JvmStatic
and@BeforeAll
annotated method to be picked up by Cucumber without problems, as a before-all initializer method.π¦ Which tool/library version are you using?
cucumber-java 7.20.1 kotlin 2.0.x
π¬ How could we reproduce it?
See screenhots: in Kotlin, write a suite or a test and have a beforeAll method. See the error appear.
Debug this and set a breakpoint in
io.cucumber.java.MethodScanner::scan
; you'll see thebeforeAll
method is "seen" twice, once as a static final method (whish is OK) and once as a non-final method (in the companion object), which triggers the error.π Any additional context?
No response
The text was updated successfully, but these errors were encountered: