1
votes

I am new to allure reporting. I am having selenium testng tests and using maven to run them. After mvn test, a xml file is generated allure-result folder. Can anyone tell me how to generate 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 MVN site but that did not work. Thanks!!

1
add your pom.xml in the question.Sangam Belose
also add your selenium test code and what you have tried so farSangam Belose
added pom.xml aboveSeleniumTester

1 Answers

0
votes

The problem is that you are using old report (Allure 1) together with 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/allure-examples/allure-testng-example