In our last post, we discussed the power of TestProject’s API for integrating with Azure DevOps Service and running automated tests in TestProject as part of your CI/CD flow. In this post, we will take it even further by utilizing TestProject’s OpenSDK for our CI/CD flow! 🚀
TestProject OpenSDK
In a nutshell, TestProject’s OpenSDK allows us to write native Selenium/Appium code with either C#, Java or Python, and all while being able to enjoy the power of TestProject’s features. We discussed the OpenSDK in much detail in this earlier post.
CI/CD with Azure DevOps and TestProject OpenSDK
Here is the high-level overview of what we are going to achieve in this post and how we can leverage the power of Azure DevOps to perform CI/CD of TestProject Open SDK:
Pre-requisites
The following signups are required before we begin with the actual integration:
- TestProject signup (100% free)
- Azure DevOps service signup (free to signup)
In addition, this guide is assuming you have a working OpenSDK code which is already discussed in this post. To learn more about getting started with TestProject, check out their official maintained documentation or this complete tutorial video series I have created.
Azure DevOps Build Pipeline
Now we have the complete code available in Azure Repo (imported from GitHub repo) and we can start creating our Azure Build Pipeline.
In this case, we are going create Azure Classical Pipeline editor to create a Maven pipeline as shown below:
The only change we need to make on the pipeline is to add all the files to copy for the artifact creation as shown below:
Azure DevOps Release Pipeline
Once the build is baked and ready from the build pipeline, we then need to add to the release pipeline the stages as shown below:
Artifacts are the build from the build pipeline and the Stage1 is tasks that are going to looks something like this:
These are the Maven steps of the Azure Release pipeline needed in order to invoke the pom.xml file of our maven project and to invoke the test goal of maven.
Azure DevOps Release Pipeline Variables
Azure Variables are a convenient way to hold the system variables and user-defined variables. In this case, we are going to use both to hold the release numbers and build numbers along with our TestProject secret tokens as shown below:
These system variables are used in our code as discussed in our earlier post as shown below:
TestProject Test Reports
Here is how the automatic test report generated out from Azure Release pipeline is going to look like in our TestProject platform:
As you can see, the above report has the following items generated dynamically:
- Test Report name as Build Number and Release number
- Automatically connected with TestProject agent via TestProject secret token passed in the Release pipeline variables.
👀👉 This entire tutorial is also available in a video tutorial format for you to enjoy: