extent-framework / extentreports-cucumber4-adapter

Cucumber4 Adapter for Extent Framework
http://extentreports.com/docs/versions/4/java/cucumber2.html
Apache License 2.0
39 stars 22 forks source link

Extent Report is not being generated in test-output folder #31

Closed cucumberQATester1428 closed 4 years ago

cucumberQATester1428 commented 5 years ago

Cucumber4-Adapter is not generating the desired extent report in the test-output folder only index.html report is being generated

package mortgage.runners;

import org.junit.runner.RunWith;

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

@RunWith(Cucumber.class) @CucumberOptions( plugin = {"pretty" , "html:target/CucumberResults", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"}, features = {"./src/test/resources/features/"}, glue = {"mortgage.stepdefinitions"}, //dryRun = true, tags = "@RegressionTest", monochrome = true)

public class CukesRunner {

}

This the pom.xml <?xml version="1.0" encoding="UTF-8"?> <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">

4.0.0
<groupId>org.cucumber.mortgage.crm</groupId>
<artifactId>org.cucumber.mortgage.crm</artifactId>
<version>1.0.0</version>
<name>Cucumber Framework -- Mortgage Module</name>

<properties>
    <cucumber.version>4.2.0</cucumber.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>
org.project.excelTools org.project.excelTools 1.0.2 org.apache.poi poi 4.1.0 org.apache.poi poi-ooxml 4.1.0 org.apache.logging.log4j log4j-api 2.12.1 org.apache.logging.log4j log4j-core 2.12.1 org.seleniumhq.selenium selenium-java 3.141.59 io.github.bonigarcia webdrivermanager 3.2.0 io.cucumber cucumber-java ${cucumber.version} test io.cucumber cucumber-junit ${cucumber.version} test junit junit 4.12 test com.aventstack extentreports-cucumber4-adapter 1.0.7 com.aventstack extentreports 4.0.9
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.14.1</version>
            <configuration>
            </configuration>
        </plugin>
    </plugins>
</build>
<packaging>pom</packaging>

Below is the extent.properties file

extent.properties

for more details about this file go to:

http://extentreports.com/docs/versions/4/java/extentservice.html

extent.reporter.avent.start=false extent.reporter.bdd.start=false extent.reporter.cards.start=false extent.reporter.email.start=false extent.reporter.html.start=false extent.reporter.klov.start=false extent.reporter.logger.start=true extent.reporter.tabular.start=false

extent.reporter.avent.config=src/test/resources/extent-config.xml extent.reporter.bdd.config= extent.reporter.cards.config= extent.reporter.html.config= extent.reporter.klov.config= extent.reporter.logger.config= extent.reporter.tabular.config=

extent.reporter.avent.out= extent.reporter.bdd.out=test-output/ExtentBddReport extent.reporter.cards.out= extent.reporter.email.out= extent.reporter.html.out= extent.reporter.logger.out= extent.reporter.tabular.out=test-output/LoggerReport

thomasdeurloo commented 5 years ago

hi! you specified: extent.reporter.logger.start=true but with extent.reporter.logger.out=

i think you should specify the output dir of the logger.

you did specify extent.reporter.bdd.out=test-output/ExtentBddReport but this BDD reporter is not started

if you want the html report with the cucumber plugin you should:

extent.reporter.html.start=true
extent.reporter.html.out=output/report.html
mounikaakuthota12 commented 4 years ago

Hi, I am facing the same issue, it does not create extent report folder under test-output.Below is my extent dependency in pom.xml file

4.2.0 3.141.59 1.2.1 1.7.21 4.7.2 2.7.0 1.3.2 3.4 1.18.8 3.2.0 7.0.0 1.6 2.22.2 1.6.0 3.1.0 3.8.1 4.8.0 6.14.2 UTF-8 2.5 1.8 5.1.6 2.6.3
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin}</version>
            <configuration>
                <encoding>${utf-8}</encoding>
                <source>${java-version}</source>
                <target>${java-version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire-plugin}</version>
            <executions>
                <execution>
                    <id>test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <threadCount>4</threadCount>
                        <perCoreThreadCount>true</perCoreThreadCount>
                        <forkCount>4</forkCount>
                        <reuseForks>false</reuseForks>
                        <argLine>-Duser.language=en</argLine>
                        <argLine>-Xmx1024m</argLine>
                        <argLine>-XX:MaxPermSize=256m</argLine>
                        <argLine>-Dfile.encoding=UTF-8</argLine>
                        <useFile>false</useFile>
                        <includes>
                            <include>${testToRun}</include>
                        </includes>
                        <testFailureIgnore>true</testFailureIgnore>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${mojo-exec-maven-plugin}</version>
            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <mainClass>com.cbs.test.ReportMerger</mainClass>
                <arguments>
                    <argument>target/cucumber-report/</argument>
                </arguments>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>${maven-resource-plugin}</version>
            <configuration>
                <!-- specify UTF-8, ISO-8859-1 or any other file encoding -->
                <encoding>${utf-8}</encoding>

                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>

            </configuration>
        </plugin>

        <plugin>
            <groupId>net.masterthought</groupId>
            <artifactId>maven-cucumber-reporting</artifactId>
            <version>${maven-cucumber-reporting}</version>
            <executions>
                <execution>
                    <id>execution</id>
                    <phase>test</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <projectName>cucumbertests</projectName>
                        <outputDirectory>target/cucumber-report/cucumber-html-reports</outputDirectory>
                        <inputDirectory>target/cucumber-report</inputDirectory>

                        <jsonFiles>
                            <!-- supports wildcard or name pattern -->
                            <param>**/*cucumber.json</param>
                        </jsonFiles>

                    </configuration>
                </execution>
            </executions>
        </plugin>

    </plugins>

    <!-- Instructing the resources plugin to filter certain directories -->
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

<dependencies>

<dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.7</version>
        <exclusions>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>

            </exclusion>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java8</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>${cucumber.version}</version>
        <scope>test</scope>
    </dependency>

And the runner class where I have the extent pluigin

package com.cbs.test;

import cucumber.api.CucumberOptions; import cucumber.api.testng.AbstractTestNGCucumberTests;

//import cucumber.api.CucumberOptions; //import cucumber.api.testng.AbstractTestNGCucumberTests;

@CucumberOptions(features = "target/test-classes", tags = { "@mobilesa" }, monochrome = true, plugin = { "pretty", "html:target/cucumber-report/webapp", "json:target/cucumber-report/webapp/cucumber.json", "rerun:target/cucumber-report/webapp/rerun.txt", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" }, glue = { "com.cbs.test.framework.hooks", "com.cbs.test.step_definitions.mobile" }) public class RunAndroidAppSuite extends AbstractTestNGCucumberTests {

public RunAndroidAppSuite() {
    DriverObject.android();
}

}

extent.properties:

extent.reporter.html.start=true
extent.reporter.logger.start=true extent.reporter.spark.start=true

extent.reporter.html.config=src/test/resources/extent-config.xml extent.reporter.logger.config=src/test/resources/extent-config.xml extent.reporter.spark.config=src/test/resources/extent-config.xml

extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html extent.reporter.logger.out=test-output/Logger extent.reporter.spark.out=test-output/Spark

screenshot.dir=test-output/HtmlReport/

Could you please look into the issue?

anshooarora commented 4 years ago

Hi - what is the location of extent.properties?

anshooarora commented 4 years ago

Also - please use only 1 type of Reporter. Multiple Rich reporters are not supported.

extent.reporter.html.start=false
extent.reporter.logger.start=false
extent.reporter.spark.start=true
Zbr123 commented 3 years ago

I am facing this issue. unable to generate the report. No error is displayed

jagadeeshmadhura commented 3 years ago

i'm also facing issue only spark and pdf reports generated

below is my extent.properties file

extent.reporter.spark.start=true extent.reporter.spark.out=target/SparkReport/Spark.html

extent.reporter.pdf.start=true extent.reporter.pdf.out=target/PdfReport/ExtentPdf.pdf

extent.reporter.html.start=true extent.reporter.html.out=target/extent/HtmlReport/ExtentHtml.html

extent.reporter.bdd.start=true extent.reporter.bdd.out=target/extent/BddReport/

achavva commented 1 year ago

Hi could someone please help with the resolution of this issue I just started using extent report adapter 4 in my project and when I run a scenario I am seeing Passed 0 failed 0 and no error same happened with cucumber >6 version but I couldnt resolve that

Please help me in fixing this issue