jenkins doesn't execute my cucumber test

472 views
Skip to first unread message

ama...@bufetedemarketing.com

unread,
Feb 20, 2018, 6:56:19 PM2/20/18
to Cukes
Hi guys! 
I have a problem with my Jenkins and Cucumber test... My Jenkins doesn't execute my Cucumber tests and I don't know why...

The console output from Jenkins show the following:

Running paquete.RunTest
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@612fc6eb
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.657 sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ Cucumber_Test ---
[INFO] Building jar: /data/jenkins/QA - CucumberMaven/workspace/CucumberTest/target/Cucumber_Test-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ Cucumber_Test ---
[INFO] Installing /data/jenkins/QA - CucumberMaven/workspace/CucumberTest/target/Cucumber_Test-0.0.1-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/Cucumber_Test/Cucumber_Test/0.0.1-SNAPSHOT/Cucumber_Test-0.0.1-SNAPSHOT.jar
[INFO] Installing /data/jenkins/QA - CucumberMaven/workspace/CucumberTest/pom.xml to /var/lib/jenkins/.m2/repository/Cucumber_Test/Cucumber_Test/0.0.1-SNAPSHOT/Cucumber_Test-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.045 s
[INFO] Finished at: 2018-02-20T12:56:55+01:00
[INFO] Final Memory: 26M/87M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /data/jenkins/QA - CucumberMaven/workspace/CucumberTest/pom.xml to Cucumber_Test/Cucumber_Test/0.0.1-SNAPSHOT/Cucumber_Test-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /data/jenkins/QA - CucumberMaven/workspace/CucumberTest/target/Cucumber_Test-0.0.1-SNAPSHOT.jar to Cucumber_Test/Cucumber_Test/0.0.1-SNAPSHOT/Cucumber_Test-0.0.1-SNAPSHOT.jar
channel stopped
Finished: SUCCESS
 

My estructure is the following:



My pom.xml is:

  
  <modelVersion>4.0.0</modelVersion>
  <groupId>Cucumber_Test</groupId>
  <artifactId>Cucumber_Test</artifactId>
  <version>0.0.1-SNAPSHOT</version>

<build>
    <sourceDirectory>src</sourceDirectory>
    
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>

  <dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.5.1</version>
  <type>maven-plugin</type>
  </dependency>
 
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>6.1</version>
    </dependency>
 
  <dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.19.1</version>
  <type>maven-plugin</type>
  </dependency>
  <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.12</version>
  </dependency>
  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-firefox-driver</artifactId>
  <version>3.4.0</version>
  </dependency>
  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>3.4.0</version>
  </dependency>
  <dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.11</version>
  </dependency>
 
  <dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-core</artifactId> 
    <version>1.2.5</version> 
</dependency>
  <dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-java</artifactId> 
    <version>1.2.5</version> 
</dependency>
<dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-junit</artifactId> 
    <version>1.2.5</version> 
</dependency>
<dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-jvm-deps</artifactId> 
    <version>1.0.5</version> 
</dependency>
    <dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>gherkin</artifactId> 
    <version>2.12.2</version> 
</dependency>
     
    <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
</dependency>
  </dependencies>
  
</project>

My RunTest.java is:

package paquete;


import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/" 
,glue={"paquete"}
,monochrome = true
)

public class RunTest {

}

-------------------------------------------------------------------------
What am I doing wrong? From my local computer everything works fine.

Thanks so much for your help!

Koen Prins

unread,
Feb 21, 2018, 12:36:45 AM2/21/18
to cu...@googlegroups.com
The problem is in your RunTest.java, more specific in the location of your features. Try using `features = "resources"` as it will look in the resources classpath for the folder you specify in there. Can you run the RunTest.java without issues from Eclipse using TestNg diretly?

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages