确保您使用
cucumber.annotation.Before
而不是org.junit.Before
。黄瓜将不处理JUnit注释。(有关更多信息,请参见此博客文章的“场景挂钩”部分。)确保您的@Before方法
public
不是private
。

确保您使用
cucumber.annotation.Before而不是
org.junit.Before。黄瓜将不处理JUnit注释。(有关更多信息,请参见此博客文章的“场景挂钩”部分。)
确保您的@Before方法
public不是
private。