How to configure Allure reports with Historic Trends

Problem : Configuring allure reports is quite straight forward, but getting historical trends in the reports is not 😔.

Getting historical test results in the report is quintessential to know the health of the system under tests over a period of time. Without it, we won’t be able to gaze whether a test failing today is due to recent code changes or was failing since last week.

Steps to configure Allure Reports with java project :

  1. Open the source code in your choice of IDE.
  2. Add the following lines in pom.xml file.
<properties>
<aspectj.version>1.8.10</aspectj.version>
</properties>

<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.13.0</version>
</dependency>
<build>
<plugins>
<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>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

NOTE : aspectjweaver is required to be added in pom.xml file in order to show @Steps and @Attachments in the allure report.

3. Execute the test cases from the terminal / TestNG.xml file.

4. Perform the below mentioned commands only for the 1 time setup :

allure generate allure-results

Copy the history folder from your previous allure-report folder to your current allure-results folder

allure serve allure-results

5. Now again execute the test cases.

Then run the following command in order to view the allure report in your local browser.

allure serve allure-results.

*** Hurrayyyy, you have successfully completed the configuration part. From now on, you will be able to see the historic trends in your allure reports 🥳✌️

Allure report with historic trends