mardi 11 avril 2017

Cucumber tests execute fine on local machine, but fail while running in jenkins

I'm new to maven and eclipse. Working on a project ran into an issue while trying to integrate with jenkins. Executing "clean test" or "clean install" goal, runs tests fine in the Eclipse on local machine, but using same goal in Jenkins fails the tests with:

Failure in before hook:StepDefinitionsMyProject.before(Scenario)

Message: cucumber.runtime.CucumberException: Failed to instantiate class com.myCompany.stepDefinitions.StepDefinitionsProject.

My files are located in src/main/java The cukeRunnerTest is in src/test/java Feature files are in src/test/resources

POM snippet..

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.0</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.0</version>
   </dependency>
  </dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.4.3</version>
            <executions>
                <execution>
                    <id>default-test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.4</version>
        </plugin>
    </plugins>
</build>

Any thoughts on as to why this might be happenning?

Aucun commentaire:

Enregistrer un commentaire