我已经按照文档www.example.com构建了一个简单的项目结构https://github.com/karatelabs/karate#folder-structure
runner类:
public class HealthCheckRunner {
@Karate.Test
Karate healthCheck(){
return Karate.run("healthCheck").relativeTo(getClass());
}
}
输出:
java.lang.RuntimeException: not found: steps/healthcheck/healthCheck.feature
我尝试过的方法:
return Karate.run().relativeTo(getClass()); -> org.opentest4j.AssertionFailedError: no features or scenarios found: [classpath:steps/healthcheck]
return Karate.run("healthCheck"); -> org.opentest4j.AssertionFailedError: no features or scenarios found: [healthCheck]
return Karate.run("classpath:steps/healthcheck/healthCheck.feature"); -> java.lang.RuntimeException: not found: steps/healthcheck/healthCheck.feature
我试过从Run_API_Test运行,它是一个运行器above特性文件,得到了相同的结果
我可以用intellij cucumber插件直接运行功能文件。但不使用junit runner。
我的POM:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.0-M1</version>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>1.2.0</version>
</dependency>
1条答案
按热度按时间1rhkuytd1#
在您的pom.xml文件中,您应该添加testResources,如下图所示