top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

How to Publish Reports in Jenkins

Launch the command prompt on your desktop before navigating to the Jenkins website.


In command prompt enter “cd and path of Jenkins war file” like below


 

Then, instead of typing "java -jar jenkins.war",

Enter "java -Dhudson.model.DirectoryBrowserSupport.CSP="" -jar jenkins.war" to obtain appealing reports with updates.


 

Open a web browser and type “http://localhost:8080/” into it to start Jenkins. Next, to access the Jenkins dashboard, enter your username and password.


 

To Publish Allure Reports in Jenkins Using Freestyle Project

 

Click "New Item" when the Jenkins dashboard opens.



Enter a new name for an item name as it appears below, choose "Freestyle project," and click "OK".



A configure page will appear as a result. After choosing "Advanced" and "Use custom workspace" under the very first options, enter "complete path of your project".

 


After that, go down, locate “Post-build Actions” click dropdown button with “Add post-build actions”, and select “Allure Report”.

                 


Next, provide the complete path of the allure-results as shown below and save it. 

              


We can now see that the Allure report has been published in the workspace.


 

To Publish Allure Reports in Jenkins Using Maven Project

 

Click "New Item" when the Jenkins dashboard opens. Enter a new name for an item name as it appears below, choose "Maven project", and click "OK".

 

  

It will lead to a configure page. Navigate to "Build", select "Use custom workspace" from the "advanced" dropdown menu and enter the "complete path of the project".


 

Then follow the same steps done on freestyle project and select “Allure Report” from “Add post-build actions” dropdown then you can be able to see the published allure report as shown below.

  

 

To Publish HTML Reports in Jenkins (Extent Report)


Click on "Manage Jenkins" in the Jenkins dashboard.



In “Manage Jenkins” page scroll down and click “Plugins”



In following “Plugins” page select “Available plugins” and search for “HTML  publisher plugin” and Install it.


                             

Next, establish a "maven project". On the "configure" page, scroll down to the "build” option, and provide the full path for the "pom.xml" which you can obtain from Eclipse. In the "Goals and options" portion, type "clean install", as shown below.

 

 

Copy the path above and paste it as indicated below.


 

Alternatively, you can obtain the path from a folder on your desktop and then join with "\pom.xml" on the end.


 

Next in "Add post-build actions" dropdown, choose "Publish HTML reports".

 


In the "HTML directory to archive" box, enter the "complete path of surefire-reports" and customize the "Report title" fields. Now save it as shown below.


 

If the report is not generated in HTML format, go to the Jenkins dashboard, choose "Manage Jenkins", then scroll down and select "Script Console". Enter "System.setProperty("hudson.model.DirectoryBrowserSupport.csp", " ")" and press "Run" to see the result.



Now we will be able to see the published HTML report (Extent report) as shown below.



To Publish Cucumber Reports in Jenkins

 

Navigate to "Manage Jenkins" on the Jenkins dashboard, click "Plugins", search for "Cucumber reports", and install them from "Available plugins" like above. Then create maven project.

On the "configure" page, scroll down to the "build” option, and provide the full path for the "pom.xml" which you can obtain from Eclipse or from the desktop folder along with “\pom.xml”. In the "Goals and options" portion, type "clean install" as shown above.

Next in "Add post-build actions" dropdown, choose "Cucumber reports".

In the "Cucumber reports" box, enter the title you want, then give complete path of your project along with “\target”, in “Build Result” change “-1” to “0” for all options and save it as shown below.



Now we will be able to see the published Cucumber report as shown below.



68 views0 comments

Recent Posts

See All
bottom of page