我无法使用mvn测试执行黄瓜弹簧集成测试。请参阅下面的pom.xml -
我使用cucumber-spring,cucumber-java8,cucumber-junit。当我尝试运行mvn测试或mvn全新安装功能时,这些功能没有运行。
//Code
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<parallel>both</parallel>
<threadCount>4</threadCount>
<includes>
<include>**/*RunCucumberTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>发布于 2020-06-16 20:50:31
如果您删除vintage engine (它负责在新的junit 5平台上运行旧的junit 3/4测试),您的旧测试将不会被选中。它是检测这些测试并在新平台上运行的junit老式引擎。
不幸的是,cucumber仍然在junit 4上,所以它们没有被采摘。
https://stackoverflow.com/questions/59597351
复制相似问题