@Before doesn't execute in java Cucumber Step

前端 未结 7 1690
一生所求
一生所求 2021-02-04 06:19

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         


        
7条回答
  •  深忆病人
    2021-02-04 06:35

    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 be public rather than private

    The @Before method must be public.

提交回复
热议问题