{"id":11741,"date":"2021-03-31T06:14:00","date_gmt":"2021-03-31T06:14:00","guid":{"rendered":"https:\/\/viewmyprojects.com\/winwirewp\/?p=11741"},"modified":"2024-04-02T05:52:49","modified_gmt":"2024-04-02T05:52:49","slug":"cicd-with-azure-devops-testproject","status":"publish","type":"post","link":"https:\/\/viewmyprojects.com\/winwirewp\/blog\/cicd-with-azure-devops-testproject\/","title":{"rendered":"How to design a CI\/CD with Azure DevOps and TestProject"},"content":{"rendered":"\n<p>Migrating to a modern CI\/CD process provides several benefits for application builds, deployments, testing, and even monitoring. By leveraging&nbsp;Azure DevOps&nbsp;and other services such as Test Projects, organizations can focus on the development of apps rather than the management of the supporting infrastructure.<\/p>\n\n\n\n<p>This blog will showcase how we can leverage Test Project\u2019s API\u2019s power to integrate with&nbsp;<a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/devops\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure DevOps Service<\/a>&nbsp;and run automated tests in the&nbsp;<a href=\"https:\/\/testproject.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Test Project platform<\/a>&nbsp;as a part of CI\/CD flow.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Deployment Scenario<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Pre-requisite \u2013 The following signups are required before we begin with the actual integration:<\/h3>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li><a href=\"https:\/\/app.testproject.io\/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Test Project signup<\/a>&nbsp; &nbsp;(Open source)<\/li>\n\n\n\n<li><a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/devops\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure DevOps service signup<\/a>&nbsp; (Open source)<\/li>\n\n\n\n<li>Download and install Test Project Agent for Windows\/Mac Operating systems<\/li>\n\n\n\n<li>SDK setup<\/li>\n<\/ul>\n\n\n\n<p>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\u2019s SDK is a complete coding solution for test automation. Automate Web, Mobile, and even API\u2019s with a simple and familiar syntax of Selenium and Appium.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture1-1-5.webp\" alt=\"\" class=\"wp-image-11742\"\/><\/figure>\n\n\n\n<p><strong>GUI of Test Project<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture2-1-3.webp\" alt=\"\" class=\"wp-image-11743\"\/><\/figure>\n\n\n\n<p><strong>Adding a Team<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture3-1-2.webp\" alt=\"\" class=\"wp-image-11744\"\/><\/figure>\n\n\n\n<p>Now that we have everything in place \u2013 Let us get started with the actual integration!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Test Projects API<\/strong><\/h3>\n\n\n\n<p>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&nbsp;<a href=\"https:\/\/api.testproject.io\/docs\/v2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Test Project API<\/a>.<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture4-3.webp\" alt=\"\" class=\"wp-image-11745\"\/><\/figure>\n\n\n\n<p>To execute the API, we need to supply the following from Test Project web portal:<\/p>\n\n\n\n<p>URL:&nbsp;<a href=\"https:\/\/app.testproject.io\/#\/home\" target=\"_blank\" rel=\"noopener\">https:\/\/app.testproject.io\/#\/home<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture5-3.webp\" alt=\"\" class=\"wp-image-11746\"\/><\/figure>\n\n\n\n<p><strong><em>Record and Play back<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture6-4.webp\" alt=\"\" class=\"wp-image-11747\"\/><\/figure>\n\n\n\n<p><strong><em>Run Manual Test<\/em><\/strong><\/p>\n\n\n\n<p>User can run the Test manually and generate the results as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture7-3.webp\" alt=\"\" class=\"wp-image-11748\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture8-3.webp\" alt=\"\" class=\"wp-image-11749\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Azure DevOps Service<\/strong><\/h3>\n\n\n\n<p>Now we need to configure Test Project to \u201ctalk\u201d 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 as<strong><em>Service Hooks<\/em><\/strong><em>.<\/em><\/p>\n\n\n\n<p>In Azure, go to your project settings, from there navigate toService hooks, and proceed toCreate a subscription.<\/p>\n\n\n\n<p><strong>NOTE<\/strong>: User should have valid Azure Subscription to perform this task<\/p>\n\n\n\n<p>Then, select theWeb Hooksservice to provide event communication via HTTP, and press next.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture9-3.webp\" alt=\"\" class=\"wp-image-11750\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Setting Trigger<\/strong><\/h3>\n\n\n\n<p>Here is where the trigger for theWeb Hookshappens from Azure DevOps to Test Project Platform, and the following is most important to specify:<br><em>When to trigger the API?<\/em><br><em>Which Release pipeline to trigger?<\/em><\/p>\n\n\n\n<p>We need to associate the triggering of Azure Service hooks for any specific release in Azure of Azure release pipeline.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture10-300x298-1.webp\" alt=\"\" class=\"wp-image-11751\"\/><\/figure>\n\n\n\n<p>We are going to add the Web Hooks and enter the following details which we grabbed from Test Project in the above section.<\/p>\n\n\n\n<p>API should end up looking something like this:<br><strong>vST9Uz4yiA6zKzdkOxmRckP9m6yo-LP8ncv5FpO-gpU1<\/strong><\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>The correct format is:<br><strong>Authorization: {API_KEY}<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture11-3.webp\" alt=\"\" class=\"wp-image-11752\"\/><\/figure>\n\n\n\n<p>Once all the details are filled, press&nbsp;<strong>Test<\/strong><em>&nbsp;<\/em>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<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture12-300x260-1.webp\" alt=\"\" class=\"wp-image-11753\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Azure Release Pipeline Integration<\/strong><\/h3>\n\n\n\n<p>Now, make sure the release pipeline specified in the&nbsp;<strong>Web Hook<\/strong>&nbsp;is working properly and gets executed once the build pipeline in Azure DevOps is fully completed, which can be done by enabling&nbsp;<strong>CD trigger (Continuous Deployment)<\/strong>&nbsp;as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture13-1024x312-1.webp\" alt=\"\" class=\"wp-image-11754\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture14-2.webp\" alt=\"\" class=\"wp-image-11755\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. CI\/CD with Azure DevOps and Test Project<\/strong><\/h3>\n\n\n\n<p>Now, once any build gets executed while you do code&nbsp;<strong>check-in,<\/strong>&nbsp;this will call the&nbsp;<strong>Release pipeline<\/strong>&nbsp;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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Picture15-1024x575-1.webp\" alt=\"\" class=\"wp-image-11756\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Migrating to a modern CI\/CD process provides several benefits for application builds, deployments, testing, and even monitoring. By leveraging&nbsp;Azure DevOps&nbsp;and other services such as Test Projects, organizations can focus on the development of apps rather than the management of the supporting infrastructure. This blog will showcase how we can leverage Test Project\u2019s API\u2019s power to&hellip; <a class=\"more-link\" href=\"https:\/\/viewmyprojects.com\/winwirewp\/blog\/cicd-with-azure-devops-testproject\/\">Continue reading <span class=\"screen-reader-text\">How to design a CI\/CD with Azure DevOps and TestProject<\/span><\/a><\/p>\n","protected":false},"author":51,"featured_media":16422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-11741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry"],"acf":[],"featured_image_src":"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp","author_info":{"display_name":"Sujit","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/sujit\/"},"views":4270,"uagb_featured_image_src":{"full":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp",800,440,false],"thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure-150x150.webp",150,150,true],"medium":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure-300x165.webp",300,165,true],"medium_large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure-768x422.webp",750,412,true],"large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp",750,413,false],"1536x1536":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp",800,440,false],"2048x2048":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp",800,440,false],"post-thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/10\/CI-CD-Azure.webp",800,440,false]},"uagb_author_info":{"display_name":"Sujit","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/sujit\/"},"uagb_comment_info":0,"uagb_excerpt":"Migrating to a modern CI\/CD process provides several benefits for application builds, deployments, testing, and even monitoring. By leveraging&nbsp;Azure DevOps&nbsp;and other services such as Test Projects, organizations can focus on the development of apps rather than the management of the supporting infrastructure. This blog will showcase how we can leverage Test Project\u2019s API\u2019s power to&hellip;&hellip;","_links":{"self":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/comments?post=11741"}],"version-history":[{"count":2,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11741\/revisions"}],"predecessor-version":[{"id":18022,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11741\/revisions\/18022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media\/16422"}],"wp:attachment":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media?parent=11741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/categories?post=11741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/tags?post=11741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}