Integration of Allure Report with Jenkins

HOME

In this tutorial, we are going to learn how we can integrate Allure Report with Jenkins.

Before proceeding, I strongly advise you to read this blog to learn How to Setup Allure Report with Selenium TestNG.

Implementation Steps

  1. Download the Allure Jenkins Plugin
  2. Configure Allure
  3. Create a new Maven Jenkins job

Download Allure Jenkins Plugin

To generate Allure Report in Jenkins, we need to download Allure Plugin. Please refer to this tutorial to install the plugin – How to install Plugins in Jenkins

Configure Allure

Go back to the Manage Jenkins link as shown below:

When we click on the “Manage Jenkins” link, we are redirected to the Manage Jenkins page, where we can see various types of options, including the “Global Tool Configuration” option.

We need to set the Allure Commandline in Jenkins as shown below.

Click on the Allure Command line installations button. By default, Install Automatically will be checked, so since we are going to use the Allure installed on our local machine, Install automatically will install the latest version of Allure.

Provide the Name as ALLURE_HOME because that is what is currently installed on my machine, and also provide the path of Allure in the ALLURE_HOME textbox.

Click on the Apply and Save buttons.

Create a new Maven Jenkins job

Step 1: Create a new project using the Maven project plugin

  1. Give the Name of the project.
  2. Click on the Maven project. 
  3. Click on the OK button.

In the General section, enter the project description in the Description box.

Select Source Code Management as None if the project is locally present on the machine

Step 2: Build Management

Go to the Build section of the new job.

  1. In the Root POM textbox, enter pom.xml
  2. In the Goals and options section, enter “clean test

Click on the Advanced button.

Step 3: Select a custom workspace

Mention the full path of the project in the directory.

Step 4: Select “Allure Reports” from “Post Build Actions

Scroll down to ‘Post Build Actions’ and click on the ‘Add Post Build Actions’ drop-down list. Select “Allure Report“. 

Enter the Result Path as “allure-results” and click on the “Save” button.

Click on the Apply and Save buttons.

We have created a new Maven project AllureReportWithSelenium_Demo” with the configuration to run the Selenium with TestNG Tests and also to generate Allure Report after execution using Jenkins.

Step 5: Execute the tests

Let’s execute it now by clicking on the “Build Now” button. 

Right-click on Build Number (here in my case it is #1).

Click on Console Output to see the result.

Step 6: View the Allure Report

Once the execution is completed, we could see a link to view the ‘Allure Report’.

Click on the Allure Report. It displays the summary of the tests.

There is another way to create Allure Report in Jenkins, which is by using the Jenkins pipeline. To know more about this, please refer to this tutorial – How to create Jenkins pipeline for Allure Report.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Additional Tutorials

Integration Of Jenkins With Selenium WebDriver
How to install Maven Plugin in Jenkins
Integrate Gradle project with Jenkins
Jenkins GitLab Integration
How to generate HTML Reports in Jenkins
Integration of Cucumber Report with TestNG in Jenkins
Serenity with Jenkins
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s