I\'ve got a Cucumber Step class that i\'m attempting to initialise a page model for all scenarios. So I added a @Before annotated method :
@Before()
private void
There is an accepted answer to this question, but I wanted to point out the comment made by Matt Watson which solved the issue for me and for which I have not seen similar advice elsewhere:
I've had a play about with some of my cucumber-jvm tests and I think I've spotted it. Your
@Before
method should bepublic
rather thanprivate
The @Before
method must be public
.