courgette-jvm configuration no information on the source of the error

324 Views Asked by At

test result

runner class

<dependency>
        <groupId>io.github.prashant-ramcharan</groupId>
        <artifactId>courgette-jvm</artifactId>
        <version>6.3.0</version>
    </dependency>
    <!--CUCUMBER DEPENDENCIES -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.1.0</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java8</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
<dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surfire.plugin.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven.surfire.plugin.version}</version>
    </dependency>

I have no information about the cause of the error. I added courgette dependency to pom.xml. What could be causing the problem?

1

There are 1 best solutions below

0
On

It seems some issue with your maven goal test . You can utilize this below config that I am using to run courgette-jvm and testNG tests . It uses failsafe plugin and a maven profile named acceptanceTests . All config is in this profile . The command I use to run this is mvn clean verify -P acceptanceTests -X in intelliJ

  </dependency>
          <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>test</scope>
    </dependency>
          <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>6.9.1</version>
    </dependency>
          <dependency>
        <groupId>io.github.prashant-ramcharan</groupId>
        <artifactId>courgette-jvm</artifactId>
        <version>5.11.0</version>
    </dependency>
      <dependency>
  <!-- httpclient dpendendecy is to resolve courgette-jvm error -  NoClassDefFoundError: org/apache/http/conn/ssl/TrustAllStrategy -->        
 <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.10</version>
</dependency>

 <profiles>
<profile>
      <id>acceptanceTests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>

        <plugins>
             <plugin>
                    <groupId>org.codehaus.mojo</groupId> 
                    <artifactId>properties-maven-plugin</artifactId> 
                    <version>1.0.0</version> 
                    <executions> 
                        <execution> 
                            <phase>generate-resources</phase> 
                            <goals> 
                                <goal>write-project-properties</goal> 
                            </goals> 
                            <configuration> 
                                <outputFile>${project.build.outputDirectory}/my.properties</outputFile> 
                            </configuration> 
                        </execution> 
                    </executions> 
             </plugin>

 <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <executions>
                 <execution>
                  <id>integration-test</id> 
                <goals>
                  <goal>integration-test</goal>
                  
                </goals>
                     <configuration>
                        <parallel>methods</parallel>
                         <threadCount>4</threadCount>
                        <useUnlimitedThreads>true</useUnlimitedThreads>
                           <systemPropertyVariables>
                                <hub.port>${hub.p}</hub.port>
                                 
                          </systemPropertyVariables>
                      </configuration>
              </execution>
         
            </executions>
   
          </plugin>
           <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>8</source>
          <target>8</target>
        </configuration>
             
      </plugin>
           
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>failsafe-report-only</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
  </plugins>
  
  </build>

</profile>
 </profiles>

Runner class is

@Test
@CourgetteOptions(
        threads = 10,
        runLevel = CourgetteRunLevel.SCENARIO,
        rerunFailedScenarios = true,
        rerunAttempts = 1,
        showTestOutput = true,
        reportTitle = "Courgette-JVM Example",
        reportTargetDir = "build",
        environmentInfo = "browser=chrome; git_branch=master",
        cucumberOptions = @CucumberOptions(
                features = "src/test/resources/com/test/",
                
                glue = "com.test.stepdefs",                  
                tags = {"@firefox or @chrome"},                                     
                publish = true,
                plugin = {
                        "pretty",
                        "json:target/cucumber-report/cucumber.json",
                        "html:target/cucumber-report/cucumber.html"}
        ))
class AcceptanceIT extends TestNGCourgette {
}