<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DeviQA</title>
    <description>The latest articles on DEV Community by DeviQA (@deviqa-solutions).</description>
    <link>https://dev.to/deviqa-solutions</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2246%2F1020eebc-ed36-4ce1-aaa0-8176743ab887.png</url>
      <title>DEV Community: DeviQA</title>
      <link>https://dev.to/deviqa-solutions</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deviqa-solutions"/>
    <language>en</language>
    <item>
      <title>Complete Guide on How to Build a Maintainable Selenium Framework</title>
      <dc:creator>DeviQA</dc:creator>
      <pubDate>Thu, 28 Jan 2021 10:38:55 +0000</pubDate>
      <link>https://dev.to/deviqa-solutions/complete-guide-on-how-to-build-a-maintainable-selenium-framework-15n5</link>
      <guid>https://dev.to/deviqa-solutions/complete-guide-on-how-to-build-a-maintainable-selenium-framework-15n5</guid>
      <description>&lt;p&gt;Selenium is second to none when it comes to &lt;a href="https://www.deviqa.com/blog/best-automation-testing-tools/"&gt;automation testing tools&lt;/a&gt;. Thousands of automation QA engineers efficiently use it every day to facilitate the execution of testing. If you are a newbie and want to get the philosophy of Selenium, there are some tips on how to get the most out of it and create a maintainable and robust Selenium automation framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  A brief overview of the Selenium framework
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.selenium.dev/"&gt;Selenium&lt;/a&gt; framework can be defined as a set of testing tools, patterns, and practices that provide opportunities for efficient &lt;a href="https://www.deviqa.com/services/automation-testing-services/"&gt;test automation&lt;/a&gt;, code readability, and easy code maintenance.&lt;/p&gt;

&lt;p&gt;A plenty of automation framework types are differentiated. Still, if you prefer to work with Selenium, you can build three of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data-driven framework&lt;/strong&gt; splits test script logic off from test data. It gives an opportunity to store test data in external storage. For this purpose, a QA engineer can use MS Excel Sheets, SQL Database, CSV files, text files, XML files, ODBC sources, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keyword-driven framework&lt;/strong&gt; speeds up the process of automated testing. Each set of functions and instructions also stored in an external file has a particular keyword. As a result, QA engineers can easily pick up functions for testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As its name implies, &lt;strong&gt;a hybrid framework&lt;/strong&gt; is a combination of two previous frameworks. Either test data or keywords are externalized. While keywords are placed in a segregated Java class file, test data is located in an Excel file or Properties file.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a great volume of data should undergo testing, a data-driven framework is definitely the best choice. If you are going to deal mostly with functionalities, it is better to apply a keyword-driven framework. In situations when a large volume of either data or functions should be tested, it makes sense to leverage a hybrid framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need A Selenium Framework?
&lt;/h2&gt;

&lt;p&gt;Selenium framework considerably simplifies the work of automation QA engineers. Code and data would be kept together without a framework, and it would heavily affect reusability and readability. When it is properly developed and implemented, the Selenium framework brings multiple advantages such as code reuse and readability, better portability, easier code maintenance, minimum human intervention during test running, maximum test coverage, easy reporting, and many others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ioo5hcXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2o4jrhsvactppl7jbuou.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ioo5hcXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2o4jrhsvactppl7jbuou.jpg" alt="Advantages Selenium Framework"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Merits of the Selenium automation framework
&lt;/h2&gt;

&lt;p&gt;Numerous merits make the Selenium automation framework so popular among QA experts from different corners of the world. Let's have a look at its main advantages to understand why it is an unbeatable automation testing tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Availability&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium is freely available, and everyone can use it without paying a penny whereas most other solutions are commercial.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Most user actions can be reproduced&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium WebDriver can copy the most various user actions. Therefore, QA engineers can automate various inputs like dragging and dropping, mouse-clicking, button pressing, clicking and holding, and so on.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;User-friendliness&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium automation framework is easily implemented and easy-to-use. Its interface is pretty simple as well. Besides, QA experts can enrich their frameworks with different extensions according to their needs and project requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The most various scenarios can be covered&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium provides various options; that is why every QA expert most likely finds something that suits their scenario.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multilingual capability&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is indeed a helpful feature of Selenium. QA experts enjoy freedom while choosing a programming language. Building the Selenium automation framework they can use Java, C#, JavaScript, Python, Ruby, Perl, or PHP.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cross-browser compatibility&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium supports all commonly used browsers — Safari, Chrome, Opera, Firefox, Edge, Internet Explorer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Support of various operating systems&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium supports such OSs as Windows, Linux, Mac, UNIX, etc.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Integration with numerous tools&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To significantly simplify automated testing, Selenium smoothly integrates with numerous tools. For instance, integration with TestNG &amp;amp; JUnit enables test case management and report generation. Integration with &lt;a href="https://maven.apache.org/"&gt;Maven&lt;/a&gt;, &lt;a href="https://www.jenkins.io/"&gt;Jenkins&lt;/a&gt;, and &lt;a href="https://www.docker.com/"&gt;Docker&lt;/a&gt; gives an opportunity for deployment process automation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reusability&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Created scripts are compatible with different browsers. As a result, QA engineers can run numerous testing scenarios utilizing the same base.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Maintainability&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;QA experts can quickly modify code and easily maintain scripts due to an opportunity to refactor and group their test cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Community Support&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Selenium community is indeed wide and active. As a result, a ton of information can be found, and valuable pieces of advice can be received when QA experts need them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unique options&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Selenium WebDriver, QA experts can reproduce clicking on the browser “back” and “forward” buttons. This feature can be pretty useful in some situations and most other solutions do not offer it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to build maintainable Selenium framework
&lt;/h2&gt;

&lt;p&gt;A maintainable and reliable test automation framework is 50% of test automation success as it enables QA experts to create effective test scripts. Below you can find some aspects you should take into consideration to build a robust Selenium automation framework.&lt;/p&gt;

&lt;p&gt;To create a framework that would satisfy all your needs, it is vital to identify processes that should be automated. That is why you should study the internal structure and workflows of your application to understand which processes can be and must be automated and define requirements for your future test automation framework.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Programming language&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As we have already mentioned, Selenium supports plenty of programming languages and you should decide which one to use for your framework design. In this case, we advise you consider a language that has been used for your application development or a language at which most of your colleagues are good.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Framework architecture&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium framework architecture consists of the Selenium Core component and the Selenium Test component. It is advised to begin with the Selenium Core component which controls browser instances and element interactions. As soon as your Selenium Core component is ready, you can proceed to the Selenium Test component. You can use a page object model (POM) to design this component. It is indeed very useful due to its ability to eliminate code redundancy and cut down testing expenses.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unit framework&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unit framework is utilized for test verification and test case grouping and prioritization. Working on your automation framework development you should choose a unit framework that will be integrated. In these terms, TestNG is considered as one of the best unit frameworks for Selenium as it offers multiple benefits, among which are such valuable features as parameterizing, sequencing, annotations, and grouping.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CI/CD implementation&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To get the most out of your automation framework you should also consider CI/CD implementation. In these terms, a range of helpful tools should be integrated with your framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dependency managers like Maven, NuGet, Gradle, NPM, and Ant give an opportunity to efficiently manage dependencies and librarie. Build tools also come in handy when it comes to source code writing, dependent library creation, and test running.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Version control systems as GitHub, Bitbucket, or TFS significantly simplify work on the source code of your tests. Still, if your source code should be kept private, it is highly advised to implement your own version control system using Git.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To speed up product delivery and get a competitive advantage, it is essential to integrate automated tests into CI/CD pipelines. That is why, integration with one of the CI tools such as Jenkins, TFS, or Bamboo is a must.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Report generation&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A reliable test automation framework should also provide test results generating accurate testing reports. These reports should be clear, readable, and available for either technical or non-technical staff who need them. As Selenium does not provide a built-in report option, you should integrate an external tool. For instance, you can utilize TestNG or JUnit. However, reports generated by these tools are not readable. To create human-readable reports, external libraries like ExtentReport or Allure should be used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Test automation can significantly simplify and optimize testing processes. However, to achieve excellent results, it is essential to prepare a strong foundation, i.e., create an effective test automation framework. In these terms, Selenium is the best choice. It provides almost everything you need, while options that are not available still can be used due to integration with multiple tools. While building your Selenium automation framework, you should take into consideration numerous aspects as project requirements, processes that should be automated, programming language, framework architecture, unit framework, report generation, CI/CD implementation, etc. Still, at the end of the day, all efforts will be justified because a well-thought framework enables QA team members to create effective automated scripts and maintain them easily.&lt;/p&gt;

</description>
      <category>selenium</category>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>Manual Testing Guide</title>
      <dc:creator>DeviQA</dc:creator>
      <pubDate>Tue, 29 Sep 2020 08:40:32 +0000</pubDate>
      <link>https://dev.to/deviqa-solutions/manual-testing-guide-565k</link>
      <guid>https://dev.to/deviqa-solutions/manual-testing-guide-565k</guid>
      <description>&lt;p&gt;Testing is one of the most important stages of the software development life cycle. These days, there are two main approaches to software testing: manual and automated. Most QA teams skillfully combine both approaches as they are not entirely interchangeable and have either advantages or disadvantages. We are going to consider manual testing in detail. So let's start from scratch and consider the manual testing basics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Definition of manual testing
&lt;/h2&gt;

&lt;p&gt;Manual testing is a software examination and utilization from the end-user perspective to assess its quality, detect existing defects, and uncover possible weaknesses. In contrast to automated testing that utilizes a software program to conduct tests, manual testing reckons upon human's actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manual testing process
&lt;/h2&gt;

&lt;p&gt;As a rule, to provide professional and comprehensive testing, most manual testers organize their workflow in the following way:&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirement studying
&lt;/h3&gt;

&lt;p&gt;Manual testers must get acquainted with the requirements to ensure a successful QA process. Thus, they can understand the software's objective, operation principles, main functions, and possible vulnerabilities. Testers can make up excellent test cases and identify more defects using this information. However, project specifications and user stories are not always available. In this case, manual testers should be more inventive and check other information resources to realize how an application should work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drawing up of test cases
&lt;/h3&gt;

&lt;p&gt;As soon as manual testers have gotten acquainted with project requirements, they start to draw up test cases using various test design techniques. Test cases are used as instructions for manual testers, as they contain the consecutive steps for a particular function or scenario testing. They should be rather detailed. Therefore, other testers will also be able to carry out your tests, not asking clarification questions.&lt;br&gt;
Some manual testers still use an Excel document to file their test cases. However, various case management tools are available; they can significantly simplify test case creation, storage, and management.&lt;/p&gt;

&lt;p&gt;Useful articles:&lt;br&gt;
&lt;a href="https://www.deviqa.com/blog/10-steps-you-should-take-in-any-test-case-scenario/"&gt;How to write test cases&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.deviqa.com/blog/manual-test-cases-writing-hacks/"&gt;Manual Test Cases Writing Hacks&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test conduction and bug reporting
&lt;/h3&gt;

&lt;p&gt;After all test cases have been made up, and the test environment has been prepared, manual testers go ahead with test conduction. If manual testers detect bugs during testing, they must log bug reports using a bug tracking system. The bug reports must also be detailed and contain reproduction steps, an expected result, an actual result, and relevant attachments (screenshots, screen recording, etc.). Therefore, a developer can get bug essence right and quickly reproduce it.&lt;/p&gt;

&lt;p&gt;Related Article:&lt;br&gt;
&lt;a href="https://www.deviqa.com/blog/how-to-write-an-effective-software-defect-report/"&gt;How to write an effective software defect report&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Analysis of testing results
&lt;/h3&gt;

&lt;p&gt;As a rule, after testing completion, manual testers undertake an analysis to receive useful metrics that can help make the right consequences and plan future activities. It can take just a few clicks if you use one of the various test case management systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Manual Testing
&lt;/h2&gt;

&lt;p&gt;In our manual testing guide, we cannot leave out the manual testing types. Frankly speaking, there are countless manual testing types, but we will consider the most widely used.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exploratory Testing
&lt;/h3&gt;

&lt;p&gt;Generally, manual testers turn to exploratory testing when they want to understand the basic idea of the software or get acquainted with its new features. It has no guidelines, and testers explore systems following their own initiative and curiosity. Exploratory testing is carried out whenever a tester thinks it is required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usability Testing
&lt;/h3&gt;

&lt;p&gt;There is no chance to effectively carry out usability testing without engaging people because the user-friendliness of software is evaluated on the ground of users behavior and emotions. During usability testing, manual testers make sure that an application is simple, convenient, and intuitive to avoid end-users confusion and frustration.&lt;/p&gt;

&lt;p&gt;Related article: &lt;a href="https://www.deviqa.com/blog/what-you-should-know-about-usability-testing/"&gt;What You Should Know About Usability Testing&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GUI testing
&lt;/h3&gt;

&lt;p&gt;In the process of GUI testing manual testers check fonts, color palette, windows, buttons, and all other GUI elements and characteristics to guarantee that there are no errors or confusions and provide the best user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Localization
&lt;/h3&gt;

&lt;p&gt;Manual testers perform localization testing to ensure that an application meets various language and cultural requirements. Localization testing is particularly important if an application is targeted at a global user community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compatibility testing
&lt;/h3&gt;

&lt;p&gt;Compatibility testing is conducted to ensure that an application works properly with other software, different hardware, network, etc. Compatibility testing is rather time-intensive. For this reason, most QA teams tend to automate this process. Still, if there is a need to carry it out manually, it is advised to define the top-priority browsers and platforms and concentrate on them.&lt;/p&gt;

&lt;p&gt;Read more: &lt;a href="https://www.deviqa.com/blog/what-is-compatibility-testing/"&gt;What is compatibility testing&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Smoke Testing
&lt;/h3&gt;

&lt;p&gt;Smoke testing verifies only the key functionality of the application to define whether it corresponds to its primary objective and does not contain critical bugs. Smoke testing is a kind of preliminary checking that is carried out before more critical, in-depth testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Regression Testing
&lt;/h3&gt;

&lt;p&gt;Regression testing is executed before every release to check whether updates have not affected existing functionalities. Regression testing of large, sophisticated applications can be extremely time-consuming. For this reason, if there are opportunities, many companies try to automate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Manual Testing Techniques
&lt;/h2&gt;

&lt;p&gt;Three manual testing techniques are differentiated. So, let's consider each of them one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Black box testing
&lt;/h3&gt;

&lt;p&gt;Black box testing is conducted in a way that resembles end-users interaction with a system. It doesn't require knowledge of the internal structure and coding skills. Conducting black-box testing, QA engineers interact with UI, test functionality, and verify whether outputs coincide with expected results.&lt;/p&gt;

&lt;h3&gt;
  
  
  White box testing
&lt;/h3&gt;

&lt;p&gt;White box testing technique is usually utilized by developers to review code and dataflows and detect possible hidden bugs. This technique requires good coding skills.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grey Box testing
&lt;/h3&gt;

&lt;p&gt;This manual testing technique is a balanced combination of either black box testing or white box testing. Grey box testing covers all aspects and deals with everything but in a more superficial manner.&lt;/p&gt;

&lt;p&gt;Related article: &lt;a href="https://www.deviqa.com/blog/difference-between-white-box-black-box-and-grey-box-testing/"&gt;Difference between white box, black box and grey box testing&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Myths of Manual Testing
&lt;/h2&gt;

&lt;p&gt;A manual tester profession appeared quite a long time ago, and a considerable number of myths have grown around it. Right now, we will debunk the most common myths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual testing is easy
&lt;/h3&gt;

&lt;p&gt;It is probably the most widely spread myth. According to mainstream thinking, everybody can do testing. Let me disagree. Manual testing is a sort of art. A special mindset and skills are required to conduct testing as it is not just a random clicking, as some people may think. A manual tester must be extremely detail-oriented, obsessed with product quality, think extraordinary, know different software development aspects, and many others. Not everyone can be a professional manual tester.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual testing is out-of-date
&lt;/h3&gt;

&lt;p&gt;This misbelief is becoming very popular these days. Some people think that manual testing has become out-of-date, and automated testing will completely replace it very soon. We must reassure you that manual testing is the base of the QA process. Automated testing would never displace it. Manual testing helps make a stable product, and only after that, automated testing gets into a game. Automated testing is impossible without previous manual testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manque programmers choose the testing profession
&lt;/h3&gt;

&lt;p&gt;It's worth saying that not every programmer can become a good tester while many manual testers successfully master programming to understand all aspects of software operation and move to a new level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testers get down to work only on the post-development stage
&lt;/h3&gt;

&lt;p&gt;There is an opinion that manual testers idle most of the time and get to work in the end. It is a blunder. If some companies indeed use this approach, the project has severe problems. The involvement of a QA team at a final stage is a big risk for product quality and schedule. Testers must get to work as early as possible to have enough time to study documentation, analyze risks, draw up and conduct test cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importance of Manual Testing
&lt;/h2&gt;

&lt;p&gt;As was mentioned earlier, some people have doubts about the importance of manual testing. Nevertheless, any professional QA engineer can easily refute this statement. There are many reasons why manual testing is indispensable, so let's consider some of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Certain tests must be conducted only manually
&lt;/h3&gt;

&lt;p&gt;User experience plays an important role in quality assurance. In some situations, just a human can properly conduct certain tasks and provide an appropriate assessment. For instance, it is impossible to imagine the conduction of usability testing or localization testing without human involvement. Compatibility and interactions with mobile devices can't be checked with automated testing as well. Application performance during wi-fi turning off and turning on, simultaneous running with other apps, incoming calls or messages, etc. can be checked only by a human too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated testing only supports human testers
&lt;/h3&gt;

&lt;p&gt;Automated testing cannot substitute manual testing but can be and even must be effectively used in combination with it. While automated tests save time with repetitive tasks, manual testing efforts can concentrate on more creative work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Most bugs are hidden in unexpected places
&lt;/h3&gt;

&lt;p&gt;Even keeping up with the previously prepared test cases, manual testers can still uncover bugs in places they have not expected to find. That is very important. Testers detect many bugs while they are checking something else. In its turn, automated testing can't spot defects that it hasn't been programmed to search.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automation is not budget-friendly for small-scale projects
&lt;/h3&gt;

&lt;p&gt;Automation requires not only considerable initial investments but also high maintenance expenses. For large scale projects, automation can be indeed beneficial in a long-term perspective. However, for small projects, automation is still a waste of either time or money.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automation often falls behind sprints
&lt;/h3&gt;

&lt;p&gt;Due to continuous script updating, it is difficult for automated testing to keep up with sprints. Only perfectly managed automation can manage to do this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual testers assess product from the end-users perspective
&lt;/h3&gt;

&lt;p&gt;Manual testers usually act as end-users, so they not only ensure correct work of application and help define new ways of product improvement with their pieces of advice and suggestions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repetition and variability are of great importance
&lt;/h3&gt;

&lt;p&gt;Repetition and variability are two characteristics of effective testing. Automated testing is appropriate for the repetitive testing process, but it's not enough. Manual testing, in its turn, can provide needed variability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Top Manual Testing Tools List
&lt;/h2&gt;

&lt;p&gt;Manual testers have at their disposal various useful tools that considerably simplify the testing process. Here you can find the most widely used.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Case Management Tools (TestRail, Zephyr, Practitest, TestLink)
&lt;/h3&gt;

&lt;p&gt;These tools are handy and used by manual testers to easily create, manage, update, and store test cases.&lt;/p&gt;

&lt;p&gt;Related article: &lt;a href="https://www.deviqa.com/blog/best-test-management-tools/"&gt;Best Test Management Tools&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bug Tracking Tools (Jira, Trello, Bugzilla, Mantis)
&lt;/h3&gt;

&lt;p&gt;Bug tracking solutions are indispensable helpers of manual testers. With their help, QA engineers create, modify, store and manage bug reports as well as get valuable statistics.&lt;/p&gt;

&lt;p&gt;Related Article: &lt;a href="https://www.deviqa.com/blog/best-bug-tracking-software/"&gt;Best Bug Tracking Tools&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross Browser Testing Tools (BrowserStack, Sauce Labs, Browser Shots)
&lt;/h3&gt;

&lt;p&gt;These tools help manual testers quickly verify whether the UI elements are rendered correctly across multiple browsers and how the code responds in each browser.&lt;/p&gt;

&lt;p&gt;Related Article: &lt;a href="https://www.deviqa.com/blog/best-cross-browser-testing-tools-in-2019-review/"&gt;Best Cross Browser Testing Tools&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screen Capture Tools (CloudApp, Loom, Skitch)
&lt;/h3&gt;

&lt;p&gt;Manual testers often have to attach images and videos to bug reports to describe an issue more precisely. These tools help to create needed images and screen recordings quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Manual testing involves much effort and can also take much time. Nevertheless, it is essential to ensure a high level of software quality. Automated testing provides fantastic opportunities, but despite its advantages, automated scripts can test just what they have been written to test, while manual testing is more adaptable and creative. A human tester can always find things that an automated test cannot. To gain the best results and guarantee the top-notch quality, QA teams must use a combination of either manual or automated testing, as they are two sides of the same coin.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>qualityassurance</category>
      <category>manualtesting</category>
    </item>
    <item>
      <title>A Guide to automated testing for microservices</title>
      <dc:creator>DeviQA</dc:creator>
      <pubDate>Wed, 22 Apr 2020 08:47:01 +0000</pubDate>
      <link>https://dev.to/deviqa-solutions/a-guide-to-automated-testing-for-microservices-1pfo</link>
      <guid>https://dev.to/deviqa-solutions/a-guide-to-automated-testing-for-microservices-1pfo</guid>
      <description>&lt;p&gt;Today a lot of applications use microservice architecture, but what should we know and how we should test this type of software? In this article, we will consider basic theoretical concepts about CDC testing and testing tools that will be helpful.&lt;/p&gt;

&lt;p&gt;Microservices architecture - is a collection of small services and each service responsible for certain functionality and can be written by using different programming languages, approaches, and solutions. One of the main goals of microservices-based application it's define strong contracts between the various microservices.&lt;/p&gt;

&lt;p&gt;Consumer-driven contract testing (CDC) - is a technique that allows us to test each application in isolation. After executing consumer tests we get generated pact files that will be used for getting verification results during executing provider tests. As a result, we will have artifacts that will be placed in Pact-broker.&lt;/p&gt;

&lt;p&gt;Let’s familiarize ourselves with the main concepts from the official sources.&lt;br&gt;
&lt;a href="https://docs.pact.io/"&gt;Pact&lt;/a&gt; - is a code-first consumer-driven contract testing tool, and is generally used by developers and testers who code. In general, a contract is between a consumer (for example, a client that wants to receive some data) and a provider (for example, an API on a server that provides the data the client needs).&lt;br&gt;
&lt;a href="https://github.com/pact-foundation/pact_broker"&gt;Pact Broker&lt;/a&gt; - is an application for sharing for consumer driven contracts and verification results. It is optimized for use with "pacts" (contracts created by the Pact framework), but can be used for any type of contract that can be serialized to JSON. The Pact Broker is an open source tool that requires you to deploy, administer and host it yourself but also they provide plug-and-play option at &lt;a href="https://pactflow.io/"&gt;pactflow.io&lt;/a&gt;. &lt;br&gt;
&lt;a href="https://mochajs.org/"&gt;Mocha&lt;/a&gt; - is a feature-rich JavaScript test framework running on &lt;a href="https://nodejs.org/"&gt;Node.js&lt;/a&gt; and in the browser, making asynchronous testing simple and fun. Mocha allows you to use any assertion library.&lt;br&gt;
&lt;a href="https://www.chaijs.com/"&gt;Chai&lt;/a&gt; - is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.&lt;br&gt;
&lt;a href="https://github.com/axios/axios"&gt;Axios&lt;/a&gt; - promise based HTTP client for the browser and node.js.&lt;/p&gt;
&lt;h2&gt;
  
  
  Simple example of CDC testing.
&lt;/h2&gt;

&lt;p&gt;Here is a code snippet from package.json where you can see all packages that will be used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@pact-foundation/pact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^9.9.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^0.19.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;chai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^3.5.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mocha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^5.1.1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1. Consumer tests.
&lt;/h3&gt;

&lt;p&gt;There are two different specs that will be describing TODO API - “&lt;a href="https://jsonplaceholder.typicode.com/"&gt;JSONPlaceholder&lt;/a&gt;” and USER API - “&lt;a href="https://reqres.in/"&gt;REQ | RES&lt;/a&gt;” . The first example you can see below. Second spec the same except the request and response objects.&lt;/p&gt;

&lt;p&gt;todoClient.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getUserById&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nx"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`/users/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
   &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;todo.spec.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The Todo API&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mockServerURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:1234&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="c1"&gt;// Create the Pact object to represent your provider&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Pact&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
   &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;logs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mockserver-integration.log&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
   &lt;span class="na"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pacts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
   &lt;span class="na"&gt;consumer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Consumer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Todo Provider&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;logLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;pactfileWriteMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;merge&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;

 &lt;span class="c1"&gt;// this is the response you expect from your Provider&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;EXPECTED_BODY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;delectus aut autem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;

 &lt;span class="c1"&gt;// Start the mock server&lt;/span&gt;
 &lt;span class="nx"&gt;before&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

 &lt;span class="c1"&gt;// Write Pact when all tests done&lt;/span&gt;
 &lt;span class="nx"&gt;after&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;finalize&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

 &lt;span class="c1"&gt;// verify with Pact, and reset expectations&lt;/span&gt;
 &lt;span class="nx"&gt;afterEach&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

 &lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Get todo by id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;before&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;interaction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Get todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;uponReceiving&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A request for one todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;withRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/todos/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="na"&gt;willRespondWith&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json; charset=utf-8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="p"&gt;},&lt;/span&gt;
         &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;EXPECTED_BODY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
     &lt;span class="p"&gt;};&lt;/span&gt;
     &lt;span class="c1"&gt;// add interactions to the Mock Server&lt;/span&gt;
     &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addInteraction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interaction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET /todos/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getTodoById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mockServerURL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;EXPECTED_BODY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
 &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After running tests we will receive the following pact files:&lt;br&gt;
consumer-user_provider.json&lt;br&gt;
consumer-todo_provider.json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;consumer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Consumer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt;
 &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;provider&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Todo Provider&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt;
 &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;interactions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
   &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A request for one todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;providerState&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Get todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;request&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;method&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/todos/1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headers&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Accept&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="p"&gt;},&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;response&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headers&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json; charset=utf-8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;userId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;delectus aut autem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;completed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="p"&gt;],&lt;/span&gt;
 &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;metadata&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pactSpecification&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;version&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2. Publishing pact files. In this example we will use &lt;a href="https://pactflow.io/"&gt;pactflow.io&lt;/a&gt; (Developer FREE plan).
&lt;/h3&gt;

&lt;p&gt;publish.pacts.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gitHash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child_process&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;execSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;git rev-parse --short HEAD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;pactFilesOrDirs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./pacts/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
   &lt;span class="na"&gt;pactBroker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://yourCompanyName.pact.dius.com.au&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;pactBrokerToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;yourPactBrokerToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;prod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
   &lt;span class="na"&gt;consumerVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;gitHash&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;pact&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;publishPacts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pact contract publishing complete!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pact contract publishing failed: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For getting pactBrokerToken you need to proceed to /settings/api-tokens and copy Read/write token (CI)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0CfzDPdU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mggbcc54rupa1cuhpg0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0CfzDPdU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mggbcc54rupa1cuhpg0x.png" alt="proceed to /settings/api-tokens and copy Read/write token (CI)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running this script we will receive the following results:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZVXT1F15--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lyzu5lkt3cnhzdunbqaj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZVXT1F15--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lyzu5lkt3cnhzdunbqaj.png" alt="the following results"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Al7-GnQc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kf9670q2nm2chjs5hvp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Al7-GnQc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kf9670q2nm2chjs5hvp3.png" alt="the following results"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3. Pacts Verification
&lt;/h3&gt;


&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;logLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;INFO&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;providerVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;pactBrokerUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://yourCompanyName.pact.dius.com.au&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;pactBrokerToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;yourPactBrokerToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;publishVerificationResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pacts Verification&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Validates the expectations of Todo provider&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Verifier&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
           &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="na"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Todo Provider&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="na"&gt;providerBaseUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://jsonplaceholder.typicode.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;verifyProvider&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Validates the expectations of User provider &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Verifier&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
           &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="na"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User Provider&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="na"&gt;providerBaseUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://reqres.in/api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;verifyProvider&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After running tests we will receive the following results:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j3K7ZQ7g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2osk0oonkdddocerklek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j3K7ZQ7g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2osk0oonkdddocerklek.png" alt="the following results"&gt;&lt;/a&gt;&lt;br&gt;
VIEW PACT:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z0KLtoqb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l6jdueqfsdnptejnxvrv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z0KLtoqb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l6jdueqfsdnptejnxvrv.png" alt="VIEW PACT"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OPhfvTTb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wcottyf6ymutf2rkyn1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OPhfvTTb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wcottyf6ymutf2rkyn1f.png" alt="VIEW PACT"&gt;&lt;/a&gt;&lt;br&gt;
Let’s change the title in the expected result &lt;strong&gt;from step 1&lt;/strong&gt; for simulating an error.&lt;/p&gt;

&lt;p&gt;Previous object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;EXPECTED_BODY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;delectus aut autem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;New object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;EXPECTED_BODY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Our new title that will trigger the error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Result after running tests:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SMIDII0o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4i86mnoz7efown60jvgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SMIDII0o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4i86mnoz7efown60jvgg.png" alt="Result after running tests"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Console output:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ocf1Q9w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/874q3drfw20lonmac79k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ocf1Q9w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/874q3drfw20lonmac79k.png" alt="Console output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions.
&lt;/h2&gt;

&lt;p&gt;Testing microservices it's a very difficult process that requires a good knowledge of different testing tools for achieving needed goals. In this article, we considered basic concepts and simple example of writing CDC tests using Pact. You can deeply familiarize yourself with this powerful testing tool on the official site and use all provided features for testing your microservices.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>microservices</category>
      <category>automation</category>
      <category>guide</category>
    </item>
  </channel>
</rss>
