
虽然我已经添加了cucumber依赖项,但是@Given,@When etc注释没有被解析。
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.6</version>
<scope>test</scope>
</dependency> 发布于 2021-10-29 11:54:23
您需要导入@Given和@When的类:
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;以及您可能使用的任何其他内容:
import cucumber.api.java.en.And;
import cucumber.api.java.en.Then;目前,您只导入了:
import cucumber.api.PendingException这就是为什么在上面的示例中已经解决了以下问题:
public void user_login_into_application_with_username_and_password
throw new PendingException()https://stackoverflow.com/questions/69763599
复制相似问题