docker 上的黄瓜测试不会在集成测试阶段触发

cucumber tests on docker won't fire at the integration-test phase

我在针对 docker 容器将 cucumber/phantomJs 测试设为 运行 时遇到了一些问题。 我的计划是在 maven pre-integration-test 阶段启动 tomcat docker 容器。然后在集成测试阶段我想 运行 黄瓜测试。为此,我在 运行 测试阶段禁用了 surefire 插件,并包含了 failsafe 插件。虽然有些集成测试阶段什么都不做。我不知道它有什么问题。

docker 容器工作正常,并在预集成测试阶段启动。他们也停止在 post-integration-test 阶段。 war 已部署,运行 应该 运行。没问题。

黄瓜测试 运行 在测试阶段启用 surefire 插件进行测试。在示例项目中,您可以通过使用 to

编辑 surefire 插件部分的 pom 来更改此设置
<configuration>
    <skip>true</skip>
</configuration>

我在 https://github.com/abroer/cucumber-integration-test.git

创建了一个示例项目

项目可以 运行 使用 mvn clean verify

关于如何在 Maven 集成测试阶段启动黄瓜测试的任何建议都适用。

您的 Cucumber 测试运行器名为 RunCukesTest。默认情况下,故障安全插件不包含此模式,请参阅 https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#includes 。您必须将 class 重命名为 RunCukesIt 或调整故障安全插件的配置。