Migrating to a modern CI/CD process provides several benefits for application builds, deployments, testing, and even monitoring. By leveraging Azure DevOps and other services such as Test Projects, organizations can focus on the development of apps rather than the management of the supporting infrastructure.
1. Pre-requisite – The following signups are required before we begin with the actual integration:
- Test Project signup (Open source)
- Azure DevOps service signup (Open source)
- Download and install Test Project Agent for Windows/Mac Operating systems
- SDK setup
I am assuming you have one working test or job created in Test Project, in my case I have already created a job as shown below. Test Project’s SDK is a complete coding solution for test automation. Automate Web, Mobile, and even API’s with a simple and familiar syntax of Selenium and Appium.
GUI of Test Project
Adding a Team
Now that we have everything in place – Let us get started with the actual integration!
2. Test Projects API
Test Project has a rich set of API and they are very sophisticated to do almost everything you can do in Test Project platform, we can also access from Test Project API.
We are going to make use of one of the many awesome APIs of Test Project which helps us trigger executing a TestJobthat we have already created, as seen above (EA Local Test). In our case, we will be using the following API endpoint:
To execute the API, we need to supply the following from Test Project web portal:
Record and Play back
Run Manual Test
User can run the Test manually and generate the results as shown below.
3. Azure DevOps Service
Now we need to configure Test Project to “talk” with Azure DevOps Service. Since Azure DevOps Service is from Microsoft and it supports many tools out in the market, it also supports generic APIs to trigger as a part of its build and release pipeline. Hence, we are going to leverage the same power of Azure DevOps using what is called asService Hooks.
In Azure, go to your project settings, from there navigate toService hooks, and proceed toCreate a subscription.
NOTE: User should have valid Azure Subscription to perform this task
Then, select theWeb Hooksservice to provide event communication via HTTP, and press next.
4. Setting Trigger
Here is where the trigger for theWeb Hookshappens from Azure DevOps to Test Project Platform, and the following is most important to specify:
When to trigger the API?
Which Release pipeline to trigger?
We need to associate the triggering of Azure Service hooks for any specific release in Azure of Azure release pipeline.
We are going to add the Web Hooks and enter the following details which we grabbed from Test Project in the above section.
API should end up looking something like this:
User do not need to fill in the Basic authentication username and password, however user will need to fill in the HTTP headers field with your API key, and that key must have access to the project you intend to use.
The correct format is:
Once all the details are filled, press Test button to check the handshake of Azure DevOps with Test Project platform and see if the API is triggered. Once successful, user will get the message as below
5. Azure Release Pipeline Integration
Now, make sure the release pipeline specified in the Web Hook is working properly and gets executed once the build pipeline in Azure DevOps is fully completed, which can be done by enabling CD trigger (Continuous Deployment) as shown below:
6. CI/CD with Azure DevOps and Test Project
Now, once any build gets executed while you do code check-in, this will call the Release pipeline to execute, which will then call the Test Project API specified with required environment in the Web Hooks of Azure DevOps to execute and run the test in the Agent specified in the Job.