trivago/cucable-plugin

Issue in Cucable 1.8.0

mkondapur opened this issue · 6 comments

Here i am trying to update to Cucuble version to 1.8.0 where i am getting unexpected error and causing report generation
however all the created scenarios Json files are appearing empty.

Tried with Cucuble report :2.3.4 and 2.5.0,occurred same issue.

Error:
java.lang.NoClassDefFoundError: gherkin/deps/net/iharder/Base64
Caused by: java.lang.ClassNotFoundException: gherkin.deps.net.iharder.Base64

It is really hard to understand without some code. Where is this message coming from? Cucable, Cucumber or Cluecumber?
Can you paste your pom.xml here so I can have a look?

Where is this message coming from? : We have implemented parallel automation testing using Cucable earlier which was working fine , now we would like to update 1.8.0 version to achieve multiple tags -DTag = "@pre and @SampleTest" .

Some of the test case execution are getting terminated in between and few of them are executes fine but all the json files are coming blank and end up our test execution with below error in the console however Cluecumber report is empty.

Console Error:
java.lang.NoClassDefFoundError: gherkin/deps/net/iharder/Base64
Caused by: java.lang.ClassNotFoundException: gherkin.deps.net.iharder.Base64

image
image

POM.xml


4.0.0

<groupId>com.test</groupId>
<artifactId>NitroWebCage</artifactId>
<version>1.1.0</version>
<repositories>
    <repository>
        <id>nexus</id>
        <url>https://nexus-proxy.almuk.santanderuk.corp/repository/maven-public/</url>
    </repository>
    <repository>
        <id>Selenium_Repository</id>
        <url>https://nexus-proxy.almuk.santanderuk.corp/repository/maven-releases/</url>
    </repository>
</repositories>

<properties>
    <maven.failsafe.plugin.version>3.0.0-M4</maven.failsafe.plugin.version>
    <maven.build.helper.plugin.version>3.0.0</maven.build.helper.plugin.version>
    <generated.runner.directory>${project.build.directory}/parallel/runners</generated.runner.directory>
    <generated.feature.directory>${project.build.directory}/parallel/features</generated.feature.directory>
    <runParallelTests>false</runParallelTests>
    <skipSurefire>true</skipSurefire>
    <Tag>@sampleTest</Tag>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
                <execution>
                    <id>copy</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.santander.util</groupId>
                                <artifactId>kafkaReport</artifactId>
                                <version>1.1.0</version>
                                <type>jar</type>
                                <overWrite>false</overWrite>
                                <outputDirectory>${project.build.directory}</outputDirectory>
                                <destFileName>kafkautil.jar</destFileName>
                            </artifactItem>
                        </artifactItems>
                        <outputDirectory>${project.build.directory}/jars</outputDirectory>
                        <overWriteReleases>true</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>add-test-source</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>${generated.runner.directory}</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.20.1</version>
            <executions>
                <execution>
                    <id>Run parallel tests</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>integration-test</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
                <forkCount>10</forkCount>
                <reuseForks>false</reuseForks>
                <argLine>-Dfile.encoding=UTF-8</argLine>
                <disableXmlReport>true</disableXmlReport>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.trivago.rta</groupId>
            <artifactId>cucable-plugin</artifactId>
            <version>1.8.0</version>
            <executions>
                <execution>
                    <id>generate-test-resources</id>
                    <phase>generate-test-resources</phase>
                    <goals>
                        <goal>parallel</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <sourceRunnerTemplateFile>src/test/java/com/test/TestRunnerParallel.java</sourceRunnerTemplateFile>
                <sourceFeatures>src/test/resources/features/</sourceFeatures>
                <generatedFeatureDirectory>${project.build.directory}/parallel/features</generatedFeatureDirectory>
                <generatedRunnerDirectory>${project.build.directory}/parallel/runners</generatedRunnerDirectory>
                <includeScenarioTags>
                    ${Tag}
                   <!-- <param>${Tag}</param>-->
                </includeScenarioTags>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.trivago.rta</groupId>
            <artifactId>cluecumber-report-plugin</artifactId>
            <version>2.3.4</version>
            <executions>
                <execution>
                    <id>report</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>reporting</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <sourceJsonReportDirectory>${project.build.directory}/cucumber-report</sourceJsonReportDirectory>
                <generatedHtmlReportDirectory>${project.build.directory}/generated-report</generatedHtmlReportDirectory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <skip>${skipSurefire}</skip>
            </configuration>
           <!-- <configuration>
                <forkCount>5</forkCount>
                <testFailureIgnore>true</testFailureIgnore>
                <reuseForks>true</reuseForks>
                <skipTests>${runParallelTests}</skipTests>
                <argLine>-Xmx512m</argLine>
            </configuration>-->
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.test.santander.automation.framework</groupId>
        <artifactId>NitroWebKit</artifactId>
        <version>4.1.7</version>
    </dependency>

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.7</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.2.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.0.0-M4</version>
    </dependency>
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>com.santander.util</groupId>
        <artifactId>kafkaReport</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.11</version>
    </dependency>
    <dependency>
        <groupId>com.trivago.rta</groupId>
        <artifactId>cluecumber-report-plugin</artifactId>
        <version>2.3.4</version>
    </dependency>
    <dependency>
        <groupId>com.trivago.rta</groupId>
        <artifactId>cucable-plugin</artifactId>
        <version>1.8.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.13.2</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

Could be a transitive dependency issues since your Cucumber version is rather old and probably includes a much older Gherkin version than Cucable. Is it possible for you to upgrade to a newer Cucumber version?
If that does not help, if possible, please create a minimal project (also without Cluecumber as this is not the issue here) to isolate the problem. Your pom file just includes too many dependencies to see what is going on easily.
If you generate a dependency tree using mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:tree this might already give some insight.

Also it might be a clash with extentreports-cucumber4-adapter which should not be necessary if you use Cucable and Cluecumber.

Did you try the suggestions, @mkondapur ?

Closed due to no reaction.