DukeMe
DukeMe

Reputation: 166

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

I'm having some problems getting my cucumber/phantomJs test to run against the docker container. My plan is to start the tomcat docker container at the maven pre-integration-test phase. Then at the integration-test phase i want to run the cucumber tests. For this i have disabled the surefire plugin to run test phase and included the failsafe plugin. Though some how the integration-test phase does nothing. I have no idea whats wrong with it.

The docker containers work fine and are started at the pre-integration-test phase. They also stop at the post-integration-test phase. The war is deployed and runs like it should run. No problems there.

The cucumber tests run at the test phase when the surefire plugin is enabled for test. In the sample project you can change this by editing the pom at the section for the surefire plugin with to

<configuration>
    <skip>true</skip>
</configuration>

I have created a sample project at https://github.com/abroer/cucumber-integration-test.git

The project can be run using mvn clean verify

Any suggestions on how to fire the cucumber tests at maven integration-test phase are appriciated.

Upvotes: 0

Views: 996

Answers (1)

Mykola Gurov
Mykola Gurov

Reputation: 8695

Your cucumber test runner is called RunCukesTest. This pattern is not included by default by the failsafe plugin, see https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#includes . You have either to rename your class to say RunCukesIt or adjust the configuration of the failsafe plugin.

Upvotes: 1

Related Questions