{"id":11438,"date":"2019-09-06T11:29:48","date_gmt":"2019-09-06T11:29:48","guid":{"rendered":"http:\/\/abstracta.us\/blog\/?p=11438"},"modified":"2025-05-05T21:23:15","modified_gmt":"2025-05-05T21:23:15","slug":"how-to-quickly-set-up-test-automation-in-cicd","status":"publish","type":"post","link":"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/","title":{"rendered":"How to Quickly Set Up Test Automation in CI\/CD"},"content":{"rendered":"<h2><span class=\"ez-toc-section\" id=\"Heres_a_mechanism_to_shorten_the_setup_time_for_automated_tests_using_Selenium_inside_a_Jenkins_pipeline\"><\/span><span style=\"font-weight: 400;\">Here&#8217;s\u00a0a mechanism to shorten the setup time for automated tests using Selenium inside a Jenkins pipeline<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Something you often hear about Continuous Integration (CI) is that it helps identify problems earlier, but does it really? CI is a practice whereby a team of developers integrates code changes as often as possible, sometimes even several times a day. The idea behind this workflow is that by doing this, you can avoid the problems that arise when having to integrate multiple branches in a hurry, in order to meet a deadline. By reducing the time between branching and merging, the codebase isn\u2019t allowed to change underneath our feet or at least not <\/span><i><span style=\"font-weight: 400;\">much<\/span><\/i><span style=\"font-weight: 400;\">, making the process of integrating changes much smoother.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But, CI by itself does not help identify problems earlier. It\u2019s the tests that you add to run along the CI pipeline that do. Testing is CI\u2019s best friend, since CI can be summarized as automatically validating that your code meets certain quality expectations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">At Abstracta, we often find ourselves working with the same recommended tool stack for different clients, and so, we got to thinking, <\/span><b>how could we get test automation set up and running in CI\/CD even faster?\u00a0<\/b><\/p>\n<p>In this post, we will share with you a helpful resource we\u2019ve put together to help you save time.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Why_Automate_Testing_in_CICD\"><\/span><strong><span style=\"color: #00b674;\">Why Automate Testing in CI\/CD?<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">First of all, let\u2019s talk about why it\u2019s so important to set up test automation in a CI\/CD environment. The graphic below shows what the CI process entails:<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-11439\" src=\"http:\/\/abstracta.us\/wp-content\/uploads\/2019\/09\/unnamed-300x189.png\" alt=\"test automation in CI\/CD\" width=\"700\" height=\"440\" \/><\/p>\n<p>In CI, there is a separate server which fetches the new changes from the source\u00a0<span style=\"font-weight: 400;\">control server which makes a new build and tests it for each change in the code.\u00a0<\/span><span style=\"font-weight: 400;\">This is done frequently, at least once a day, if not more.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When teams prepare the build automatically, they run the different tests that\u00a0<\/span><span style=\"font-weight: 400;\">they\u2019ve prepared and everyone receives a notification if anything has gone wrong\u00a0<\/span><span style=\"font-weight: 400;\">or if everything is okay with the new build.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Every single test that runs alongside your pipeline adds robustness to the code that is entering your branch. Take automated <\/span><a href=\"https:\/\/www.seleniumhq.org\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Selenium<\/span><\/a><span style=\"font-weight: 400;\"> UI tests for example, you can automatically add checks to see how your web app\u2019s latest build has modified its behavior to avoid any unexpected outcomes. Or maybe you want to run some <\/span><a href=\"https:\/\/abstracta.us\/blog\/performance-testing\/gatling-tool-review-performance-tests-written-scala\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Gatling<\/span><\/a><span style=\"font-weight: 400;\"> tests against your application to check that the new version hasn\u2019t suffered any performance degradations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The possibilities are endless, but the core idea is that the more testing you integrate into your CI pipeline, the better the quality of the product coming out of it will be.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Getting_Started\"><\/span><strong><span style=\"color: #00b674;\">Getting Started<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This doesn\u2019t mean that continuous integration is easy or quick to prepare and assemble. It\u2019s not. When it comes to getting started, there\u2019s a plethora of tools to choose from for almost every single task you would want to do inside your pipeline. There\u2019s also quite a deal of setup that must take place beforehand.\u00a0<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Ansible\"><\/span><strong><span style=\"color: #3056a2;\">Ansible<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">We recommend using <\/span><a href=\"https:\/\/www.ansible.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Ansible<\/span><\/a><span style=\"font-weight: 400;\">, as it\u2019s a really powerful tool for managing configuration and provisioning on your servers, since it allows you to describe its desired state and then it takes care of making it happen for you. The way to use Ansible is by writing playbooks which are YAML files describing the desired state we just mentioned. One such playbook is what we we are sharing with you in this article.\u00a0<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Our_Playbook\"><\/span><strong><span style=\"color: #3056a2;\">Our Playbook<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>We\u2019ve made a playbook for provisioning a Jenkins server so that you don\u2019t have to deal with the installation and setup process.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Why did we do this? Many times, a client of ours is already using <\/span><a href=\"https:\/\/jenkins.io\/\"><span style=\"font-weight: 400;\">Jenkins<\/span><\/a><span style=\"font-weight: 400;\"> for some process inside their organization and wants to add test automation to an existing pipeline or by itself. Other times, they aren\u2019t using the tool yet, but see its value and want to start running their tests using Jenkins and keep track of the results.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Whatever the case is, we will often find ourselves setting up pipelines to run tests or setting up Jenkins servers, so we decided we should streamline that process in order to get up and running within minutes instead of hours, giving us more time to focus on adding more and different tests in order to help improve the quality of the product.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Access_the_Playbook\"><\/span><strong><span style=\"color: #3056a2;\">Access the Playbook<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You can head over to Abstracta\u2019s Github <\/span><a href=\"https:\/\/github.com\/abstracta\/selenium-jenkins-ansible\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">repository<\/span><\/a><span style=\"font-weight: 400;\"> which has a <\/span><a href=\"https:\/\/github.com\/abstracta\/selenium-jenkins-ansible\/blob\/master\/getting-started\/README.md\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">getting started section<\/span><\/a><span style=\"font-weight: 400;\"> to help you get a feel for what you can do with these tools. This guide will walk you through the process of setting up your first Jenkins pipeline to run Selenium tests.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you want to dive deeper, we have a few \u201c<\/span><a href=\"https:\/\/github.com\/abstracta\/selenium-jenkins-ansible\/tree\/master\/how-tos\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">How To<\/span><\/a><span style=\"font-weight: 400;\">\u201d guides (that we are still adding to) in order to help you solve common problems often faced when building Jenkins pipelines.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Closing\"><\/span><strong><span style=\"color: #00b674;\">Closing<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">We believe that teams should automate as much as possible in order to improve the effectiveness and efficiency in the process of adding value to the business and to users. We presented here a very easy way to have an automated pipeline with Jenkins and different testing tools, even if you have never heard of Ansible, Jenkins or Selenium.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We hope this helps you to adopt what we believe is part of the foundations of a modern software development process.<\/span><\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Recommended_for_You\"><\/span><span style=\"font-weight: 400;\">Recommended for You<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/abstracta.us\/blog\/tools\/12-top-test-automation-tools\/\" target=\"_blank\" rel=\"noopener noreferrer\">12 Top Test Automation Tools to Try in Your Next Project<\/a><br \/>\n<a href=\"https:\/\/abstracta.us\/blog\/devops\/testing-driver-devops-culture\/\" target=\"_blank\" rel=\"noopener noreferrer\">Testing as the Driver Towards a DevOps Culture<\/a><\/p>\n<p><!-- Go to www.addthis.com\/dashboard to customize your tools --><script src=\"\/\/s7.addthis.com\/js\/300\/addthis_widget.js#pubid=ra-58d80a50fc4f926d\" type=\"text\/javascript\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s\u00a0a mechanism to shorten the setup time for automated tests using Selenium inside a Jenkins pipeline Something you often hear about Continuous Integration (CI) is that it helps identify problems earlier, but does it really? CI is a practice whereby a team of developers integrates&#8230;<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[222,223],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Quickly Set Up Test Automation in CI\/CD | Abstracta<\/title>\n<meta name=\"description\" content=\"To get feedback early on about the quality of your code, its necessary to set up test automation in CI\/CD. Here is a shortcut we created to get it going!\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Quickly Set Up Test Automation in CI\/CD | Abstracta\" \/>\n<meta property=\"og:description\" content=\"To get feedback early on about the quality of your code, its necessary to set up test automation in CI\/CD. Here is a shortcut we created to get it going!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AbstractaQA\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-06T11:29:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-05T21:23:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/abstracta.us\/wp-content\/uploads\/2019\/09\/Copy-of-blog-image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"560\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AbstractaUS\" \/>\n<meta name=\"twitter:site\" content=\"@AbstractaUS\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/abstracta.us\/blog\/#website\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\",\"description\":\"AI-powered quality engineering\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/abstracta.us\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/abstracta.us\/wp-content\/uploads\/2019\/09\/unnamed-300x189.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/#webpage\",\"url\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\",\"name\":\"How to Quickly Set Up Test Automation in CI\/CD | Abstracta\",\"isPartOf\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/#primaryimage\"},\"datePublished\":\"2019-09-06T11:29:48+00:00\",\"dateModified\":\"2025-05-05T21:23:15+00:00\",\"author\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/4e7912c2f3a610b7acef5263c4a1de89\"},\"description\":\"To get feedback early on about the quality of your code, its necessary to set up test automation in CI\/CD. Here is a shortcut we created to get it going!\",\"breadcrumb\":{\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/\",\"url\":\"https:\/\/abstracta.us\/blog\/test-automation\/\",\"name\":\"Test Automation\"}},{\"@type\":\"ListItem\",\"position\":3,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\",\"url\":\"https:\/\/abstracta.us\/blog\/test-automation\/how-to-quickly-set-up-test-automation-in-cicd\/\",\"name\":\"How to Quickly Set Up Test Automation in CI\/CD\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/4e7912c2f3a610b7acef5263c4a1de89\",\"name\":\"Juan Pablo Sobral\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/abstracta.us\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/65d46e8d821932c443b4928460a43e2a?s=96&d=blank&r=g\",\"caption\":\"Juan Pablo Sobral\"},\"description\":\"Performance Tester, Abstracta\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/11438"}],"collection":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/comments?post=11438"}],"version-history":[{"count":9,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/11438\/revisions"}],"predecessor-version":[{"id":15909,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/11438\/revisions\/15909"}],"wp:attachment":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/media?parent=11438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/categories?post=11438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/tags?post=11438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}