Setting-up the Test Automation Framework in Azure Devops with Extent reports in 5 Steps

DINESH REDDY JETTI
3 min readJul 27, 2023

--

In the Test Automation world , it is always needed to execute the test automation scripts in cloud without intervene from our local machines , In this article we are discussing mainly on the setting up the Azure Devops Build pipeline for Test Automation Framework with Extent Reports

5 Steps to follow to achieve this goal in ADO

Step1 : Clone the below repo code into the Azure Repos

Step2 : Setting up the build pipeline by using pipelines yaml , below is the yaml code for maven test execution for testng.xml

Note: you can generate these tasks in ADO directly by using the below option , click on the maven task , fill all the required values and then click on ADD button, and automatically you can see the yaml code in the left side editor

  - task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
goals: 'package'
options: 'test -Dsurefire.suiteXmlFiles=testng.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
condition: succeededOrFailed()
displayName: "ProjectA Test Results"

Step3 : Right after the maven test we need to copy the artifacts /reports to the staging directory

Copying the Reports folder for the extent reports


- task: CopyFiles@2 - Extent Reports
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**/reports/**'
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()

Step4 : Publish the artifacts/reports into the drop default folder in build pipelines

 - task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()

Step5 : you can verify the reports at the published section

Artifact pubished from the above pipeline
Refer the Extent Reports at the reports folder

Download the Reports folder structure and you can verify the screenshots locally in to your machine

Extent Reports steps execution result with screenshots
Screenshot evidence from Extent Reports
Extent Report Dashboard for the Business/stakeholder verification

Conclusion : We have achieved test Automation Framework setup in the ADO cloud environment in simple 5steps , next we will discuss more on the agentstup, Cucumber Reports and Classic pipeline setup in the ADO

--

--

DINESH REDDY JETTI

Cloud Infra Devops. Lead @ Zuellig Pharma | DevOps, Security , Automation, Azure, AWS, GCP