Setting-up the Test Automation Framework in Azure Devops with Extent reports in 5 Steps
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
Download the Reports folder structure and you can verify the screenshots locally in to your machine
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