+1 vote
1 view
in Devops and Agile by (25k points)

I am new to allure reporting. I am having selenium testng tests and using maven to run them. After mvn test, an XML file is generated allure-result folder. Can anyone tell me how to generate an index.html file with this? Do I need to add something in pom.xml? Here is my pom.xml :

<properties>

    <allure.version>1.4.13</allure.version>

    <aspectj.version>1.8.10</aspectj.version>

</properties>

<dependencies>

    <dependency>

        <groupId>io.qameta.allure</groupId>

        <artifactId>allure-testng</artifactId>

        <version>2.0-BETA14</version>

        <scope>test</scope>

    </dependency>

    <dependency>

        <groupId>ru.yandex.qatools.allure</groupId>

        <artifactId>allure-testng-adaptor</artifactId>

        <version>1.5.3</version>

        <exclusions>

            <exclusion>

                <groupId>junit</groupId>

                <artifactId>junit</artifactId>

            </exclusion>

        </exclusions>

    </dependency>

    <dependency>

        <groupId>org.testng</groupId>

        <artifactId>testng</artifactId>

        <version>6.11</version>

        <scope>test</scope>

    </dependency>

    <build>

        <plugins>

            <plugin>

                 <groupId>io.qameta.allure</groupId>

                 <artifactId>allure-maven</artifactId>

                 <version>2.8</version>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-surefire-plugin</artifactId>

                <version>2.20</version>

                <configuration>

                <argLine>

                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"

                </argLine>

                <suiteXmlFiles>

                    <suiteXmlFile>testng.xml</suiteXmlFile>

                </suiteXmlFiles>

            </configuration>

            <dependencies>

                <dependency>

                    <groupId>org.aspectj</groupId>

                    <artifactId>aspectjweaver</artifactId>

                    <version>1.8.10</version>

                </dependency>

            </dependencies>

        </plugin>

    </plugins>

</build>

<reporting>

    <excludeDefaults>true</excludeDefaults>

    <plugins>

        <plugin>

            <groupId>ru.yandex.qatools.allure</groupId>

            <artifactId>allure-maven-plugin</artifactId>

            <version>2.6</version>

            <configuration>

                  <outputDirectory>${basedir}/target/allure-reports/</outputDirectory>

                    <allureResultsDirectory>${basedir}/target/allure-results</allureResultsDirectory>

            </configuration>

        </plugin>

    </plugins>

</reporting>

I tried running the MVN site but that did not work. Thanks!!

1 Answer

0 votes
by (63.3k points)

The problem is that you are using the old reports (Allure 1) together with a new adaptor (that is only supported by Allure 2).

You can find the full documentation here https://docs.qameta.io/allure/2.0/#_testng

Also, there is working example available https://github.com/prabhpreetkb/allure-testng-example

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...