Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.
Ivan Krutov edited this page May 22, 2014 · 7 revisions

Allure report can be generated for any JUnit test. First step you need to get test results:

  • Add AllureRunListener
  • Add AspectJ Weaver javaagent
  • Run tests

An example project of how to do this with Maven: https://github.com/allure-framework/allure-junit-example

Add the following to your pom.xml:

//pom.xml
<properties>
    <aspectj.version>1.7.4</aspectj.version>
    <allure.version>{latest-allure-version}</allure.version>
</properties>

<dependencies>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.14</version>
            <configuration>
                <testFailureIgnore>false</testFailureIgnore>
                <argLine>
                    -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                </argLine>
                <properties>
                    <property>
                        <name>listener</name>
                        <value>ru.yandex.qatools.allure.junit.AllureRunListener</value>
                    </property>
                </properties>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

Then run the build:

$ mvn clean test