email2vimalraj / CucumberExtentReporter

A plugin to generate the cucumber jvm custom html report using ExtentsReport
http://www.vimalselvam.com/cucumber-extent-reporter/
MIT License
58 stars 75 forks source link

Cucumber Extent Report Issue #44

Closed dattag27 closed 7 years ago

dattag27 commented 7 years ago

I am using extent Report in Cucumber and facing this issue: cucumber.runtime.CucumberException: java.lang.NoClassDefFoundError: com/aventstack/extentreports/reporter/ExtentHtmlReporter

Please help.

Runner Class package cucumber;

import java.io.File;

import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith;

import com.cucumber.listener.ExtentCucumberFormatter; import com.cucumber.listener.Reporter;

import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class) @CucumberOptions( //plugin= {"pretty", "html:target/cucumber-html-report"}, plugin = {"com.cucumber.listener.ExtentCucumberFormatter:output/report.html"}, features= {"src/test/java/cucumber/features"}, glue="step" ) public class CucumberRunner {

 @AfterClass
    public static void setup() {

        /*ExtentCucumberFormatter.class.newInstance();*/

        Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
        Reporter.setSystemInfo("user", System.getProperty("user.name"));
        Reporter.setSystemInfo("os", "Windows");
        Reporter.setTestRunnerOutput("Sample test runner output message");

 }

}

pom.xml

4.0.0 com.eztest.demo EZTestDemo 0.0.1-SNAPSHOT org.seleniumhq.selenium selenium-java 2.53.0 info.cukes cucumber-junit 1.2.2 test junit junit 4.12 test info.cukes cucumber-java 1.2.2 test info.cukes cucumber-picocontainer 1.2.5 test org.codehaus.groovy groovy-all 2.2.1 info.cukes cucumber-core 1.2.5 test info.cukes cucumber-jvm-deps 1.0.3 test info.cukes cucumber-guice 1.2.5 test info.cukes cucumber-needle 1.2.5 test com.vimalselvam cucumber-extentsreport 2.0.4 com.relevantcodes extentreports 2.41.1
email2vimalraj commented 7 years ago

@dattag27 : You are using extentreports v2.41.1. Kindly update to the latest since the cucumber-extentsreport v2.0.4 supports from extentreports v3.x.x. The latest version of extentreports is v3.0.5.

Feel free to reopen in case you need further help.

dattag27 commented 7 years ago

@email2vimalraj Thanks for the help. But as suggested when I am using this dependency:

com.vimalselvam cucumber-extentsreport 1.1.0 com.relevantcodes cucumber-extentreports 3.0.5

I am getting an error in pom.xml like aritifact is missing for extentreports.

And also I cannot see the reports also after the run. I am attaching my codebase . can you please help. EZTestDemo (3).zip

email2vimalraj commented 7 years ago

Kindly ensure the group id and artifact id are correct. Because from 3.x the extent report changed those. Also the latest cucumber-extent report is 2.0.4.

Sent from my iPhone

On Apr 13, 2017, at 11:26 PM, dattag27 notifications@github.com wrote:

@email2vimalraj Thanks for the help. But as suggested when I am using this dependency:

com.vimalselvam cucumber-extentsreport 1.1.0 com.relevantcodes cucumber-extentreports 3.0.5 I am getting an error in pom.xml like aritifact is missing for extentreports.

And also I cannot see the reports also after the run. I am attaching my codebase . can you please help. EZTestDemo (3).zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

dattag27 commented 7 years ago

Not Helpful Sir!!! Anyways Thanks for your effort!!!

email2vimalraj commented 7 years ago

What is not helpful?

Just post your pom.xml file content.

Sent from my iPhone

On Apr 13, 2017, at 11:26 PM, dattag27 notifications@github.com wrote:

@email2vimalraj Thanks for the help. But as suggested when I am using this dependency:

com.vimalselvam cucumber-extentsreport 1.1.0 com.relevantcodes cucumber-extentreports 3.0.5 I am getting an error in pom.xml like aritifact is missing for extentreports.

And also I cannot see the reports also after the run. I am attaching my codebase . can you please help. EZTestDemo (3).zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

dattag27 commented 7 years ago

Pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.eztest.demo</groupId>
  <artifactId>EZTestDemo</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.53.0</version>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.2.2</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.2.2</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-picocontainer</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>
<dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <!-- If possible, its better if this matches 2.1.8 in the plugin definition -->
        <!-- but 2.2.1 worked fine here and allowed me to keep the original pom definition  -->
        <version>2.2.1</version>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-core</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-jvm-deps</artifactId>
    <version>1.0.3</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-guice</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-needle</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>
<!-- <dependency>
    <groupId>com.relevantcodes</groupId>
    <artifactId>extentreports</artifactId>
    <version>1.4</version>
</dependency> -->
<dependency>
    <groupId>com.vimalselvam</groupId>
    <artifactId>cucumber-extentsreport</artifactId>
    <version>1.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>cucumber-reporting</artifactId>
    <version>3.6.0</version>
</dependency>

</dependencies>

</project>

Also Note: The report.html is not coming in output folder. Only in output folder another folder is getting created with name Run13****00417. Please help.

email2vimalraj commented 7 years ago

Try this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.eztest.demo</groupId>
  <artifactId>EZTestDemo</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.0</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <!-- If possible, its better if this matches 2.1.8 in the plugin definition -->
            <!-- but 2.2.1 worked fine here and allowed me to keep the original pom definition  -->
            <version>2.2.1</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-guice</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-needle</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>2.0.4</version>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.0.5</version>
    </dependency>
</dependencies>
</project>

Updated the version of cucumber-extetntsreport and added the dependency of extentreports.

Also kindly read through the instructions given here on how to use this plugin.

dattag27 commented 7 years ago

Thank you @email2vimalraj for your help. It is working now.