Performing user interface (UI) testing as part of the release pipeline is a great way of detecting unexpected changes, and need not be difficult.Azure Pipelines formerly known as Visual Studio Team Services(VSTS) is a Microsoft product. It is a Continuous Integration (CI) server, which automates the build and deploy process of your web applications. By running your Selenium test suite in Azure Pipelines, you also automate testing as part of the build process.
This post will explain how selenium tests can be run in azure pipeline using maven project.
- An azure Devops account if you don’t have ,then you can create a free trial account from here.
- Selenium tests with maven project.
Creating Azure Pipeline
- Login to your azure devops account ,create a organization and project.
2. Click the project
3. Click “pipeline” option from left side menu
4. Click “Create Pipeline” button
5. Click the text “Use the classic editor” and create a connection with your source code tool whatever you are using and select the selenium project. Click “Continue”.
6.Click on Empty job.
7.Click on “pipeline” task ,give your pipeline name , pool and agent .( I am using default agent provided by azure ).you can setup your machine to make it a agent from here.
8. Search “Maven” task in the search box and click “Add”.
Also add ” Publish build artifacts” task to publish the report (so that you can download the reports like html , emailable reports etc from pipeline).
Path to publish – provide the path of your result/artifact folder which you want to publish
Artifact Name – Give artifact a name
9.In Maven task , do below settings to run your selenium tests
Display Name – Provide task name
Maven POM file – Give name of POM file (select the … dots and select the POM file)
Goal(s) – test
Publish to azure pipelines – Ensure checkbox is checked
Test run title – provide test run title name
Test results files – provide the path of test result file (i am using default)
10 . Click “Save and queue” button, then click “Save and run”
11. Click on Agent Job 1 ,to see the job logs
Reports and Artifact
After successful completion , click on ” Tests” tab to see the results in azure pipeline.
Click “Published” link to see the artifacts
You can find the reports here which you can download and use.