Unable to generate allure report using testng and maven

Amr Kamel :

TestNG Version

7.1.0

Expected behavior

mvn test command should execute the test normally, knowing that same POM was working fine before until I update testNG and some other dependencies, I'm using allure with testNG and maven as well, now if I disabled allure-TestNG test will be executed but allure won't generate any report

Actual behavior

I'm getting this error Please refer to C:\Users\warrior\Desktop\MobileAutomationTest\target\surefire-reports for the individual test results. Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. There was an error in the forked processorg/testng/IInvokedMethodListener2 org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked processorg/testng/IInvokedMethodL istener2

Is the issue reproducible on a runner?

  • [x] Maven
  • [x] IntelliJ

Test case sample

POM file

         <?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>MobileAutomationTest</groupId>
    <artifactId>SafeApp</artifactId>
    <version>1.0-SNAPSHOT</version>


    <properties>
        <jre.level>1.8</jre.level>
        <jdk.level>1.8</jdk.level>
        <aspectj.version>1.9.5</aspectj.version>
    </properties>

    <build>
        <plugins>
            <!-- Compiler plug-in -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${jdk.level}</source>
                    <target>${jdk.level}</target>
                </configuration>
            </plugin>
            <!-- Added Surefire Plugin configuration to execute tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/java/TestNG.xml/</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.testng/testng -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.1.0</version>
        </dependency>
<!--        &lt;!&ndash; https://mvnrepository.com/artifact/io.qameta.allure/allure-testng &ndash;&gt;-->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.13.0</version>
        </dependency>
        <!--https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server-->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.141.59</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
            <dependency>
                <groupId>io.appium</groupId>
                <artifactId>java-client</artifactId>
                <version>7.3.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/junit/junit -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13</version>
                <scope>test</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.relevantcodes/extentreports -->
            <dependency>
                <groupId>com.relevantcodes</groupId>
                <artifactId>extentreports</artifactId>
                <version>2.41.2</version>
            </dependency>
            <!-- log4j2 -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>1.7.29</version>
            </dependency>
        </dependencies>
        <reporting>
            <excludeDefaults>true</excludeDefaults>
            <plugins>
                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>2.10.0</version>
                    <configuration>
                        <reportDirectory>${basedir}\target\allure-report</reportDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </reporting>

    </project>
Krishnan Mahadevan :

The problem here is with Allure reports which is NOT compatible with TestNG 7.1.0.

TestNG 7.1.0 removed the listener IInvokedMethodListener2 interface.

This needs to be fixed in Allure reports.

I have also added more information in the github issue that was logged for this : https://github.com/cbeust/testng/issues/2246

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Cucumber-JVM 3 - Allure 2 Test Report with Maven

How to generate html report for issues reported using sonarqube-5.4 and maven?

Spring Maven - Unable to generate WSDL

Unable to generate a report with SAP Crystal report

Using Bazel to generate coverage report

unable to generate HTML report using Webpack-bundle-analyser

How to generate Allure2 report for Xunit.net project

Parallel execution in testNG using Maven

getting 404 error when generating allure report in protractor using allure command line tool

Unable to run testNG tests from maven

hudson.FilePath is missing error when generate allure report via pipeline script

Unable to generate the extent-report

Where is TestNG report file when running Maven/Jenkins

Allure Framework: using @Step and @Attachment annotations with TestNG and Maven

Allure empty report being generated using Karma

Unable to generate report using html screen shot in protractor

Unable to generate a php library project using maven

Allure Framework: unable to use @Step , @Parameter and @Attachments annotation with TestNG and Maven already AspectJ enabled

How to generate Allure xml when running project as TestNG Suite in eclipse?

Selenium WebDriver Report Generation using Allure Reporting tool

Allure: How to rerun all Broken Tests and then generate report

Can't run test from Maven in TeamCity with testNG and Allure

Allure xml files created with steps. Index.html inside site folder is empty - Allure Maven TestNG

Generate a report using DFSORT

Allure/TestNG/Maven: org.testng.ITestNGListener: Provider io.qameta.allure.testng.AllureTestNg could not be instantiated

Allure results don't generate on Maven build

Is Allure report supported by Travis?

Unable to generate javadocs using frame with maven-javadoc-plugin

How to generate Allure Report when unique URL browsed and single TestNG Test method?