Question

i'm writing tests via selenium web driver here's my code :

Pom.xml

<project>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.24.1</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>SeleniumebDriverProject</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <!-- Skip the normal tests, we'll run them in the integration-test phase-->
                    <skip>false</skip> 
                </configuration>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                        </configuration>
                    </execution> 
                </executions>
            </plugin>
        </plugins> 
    </build>
</project>

My test class named GoogleTest.java. after reading this post : failsafe plugin won't run on one project but will run on another -- why?

I changed the name of my class so it's:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.11</version>
    <configuration>
        <!-- Skip the normal tests, we'll run them in the integration-test phase-->
        <skip>false</skip> 
    </configuration>

    <executions>
        <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
        </execution>
    <executions>
</plugin>

But the problem persist.

Was it helpful?

Solution

The goal of the maven-failsafe-plugin is named integration-test instead of test. Furthermore if you changed your naming convention to the convention of maven-failsafe-plugin than you don't need any configuration which includes etc. files. Just use the defaults. Furthermore i assume you have started running the integration tests via:

mvn verify
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top