<?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: keycho47</title>
    <description>The latest articles on DEV Community by keycho47 (@keycho47).</description>
    <link>https://dev.to/keycho47</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%2Fuser%2Fprofile_image%2F345751%2F825ab6b7-1f6c-47b4-9a2b-a1ec1a5c2007.jpeg</url>
      <title>DEV Community: keycho47</title>
      <link>https://dev.to/keycho47</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/keycho47"/>
    <language>en</language>
    <item>
      <title>Cypress tips&amp;tricks: Find Dynamic Table Selectors</title>
      <dc:creator>keycho47</dc:creator>
      <pubDate>Tue, 20 Jul 2021 10:55:08 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/cypress-tips-tricks-find-dynamic-table-selectors-1g22</link>
      <guid>https://dev.to/bornfightcompany/cypress-tips-tricks-find-dynamic-table-selectors-1g22</guid>
      <description>&lt;p&gt;In my world, developers can't always make your selector unique or custom just for you to catch them in your cypress test like in Cypress &lt;a href="https://docs.cypress.io/guides/references/best-practices" rel="noopener noreferrer"&gt;best practice doc&lt;/a&gt;.&lt;br&gt;
But there is a trick I use in my tests when I need to catch dynamic table index or row index. This happens when my tests want to select some elements that are the same for all data in table like edit or delete button.&lt;br&gt;
Like in this case -&amp;gt; &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fb3ilwl33l881irvqfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fb3ilwl33l881irvqfs.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
Edit icon has a dynamic selector so I need to get rowKey to click on a specific row.&lt;/p&gt;

&lt;p&gt;My solution: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First make sure you can use &lt;strong&gt;cy.contains()&lt;/strong&gt; method on some unique element. You can do this on creating this data element in your test or make deal with developers to create test data or fixtures with unique ID or some other property.&lt;/li&gt;
&lt;li&gt;After catching this element we can use &lt;strong&gt;.then()&lt;/strong&gt; function where magic is happening.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a snippet from my code for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unique Data&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="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;be.visible&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="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;$el&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;elRowKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;parentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rowKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-row-key="&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="nx"&gt;elRowKey&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;"] &amp;gt; :nth-child(4) &amp;gt; [data-test=edit-email-template] &amp;gt; .anticon &amp;gt; svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;force&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;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-test=disable-delete-tooltip]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-test=confirm-delete-button]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;force&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="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;strong&gt;then()&lt;/strong&gt; function we pass &lt;strong&gt;$el&lt;/strong&gt; which contains all kinds of data so I use &lt;strong&gt;console.log()&lt;/strong&gt; to see and search &lt;br&gt;
a specific data I can use to help myself.&lt;br&gt;
After finding elRowKey in &lt;strong&gt;$el&lt;/strong&gt; properties I simply use &lt;strong&gt;cy.get()&lt;/strong&gt; function to get a specific icon on that row using string concatenation with variable in which I put my rowKey.&lt;/p&gt;

&lt;p&gt;This way I always get my rowKey on element I want to delete or edit, I hope I helped with this trick and make sure you comment on the post if you find better solution.&lt;/p&gt;

&lt;p&gt;Tnx &amp;lt;3 &lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>testing</category>
      <category>cypress</category>
      <category>automatization</category>
    </item>
    <item>
      <title>How I help myself in Agile UI changes with Cypress and Percy</title>
      <dc:creator>keycho47</dc:creator>
      <pubDate>Mon, 01 Mar 2021 21:59:34 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/how-i-help-my-self-in-agile-ui-changes-with-cypress-and-percy-44gp</link>
      <guid>https://dev.to/bornfightcompany/how-i-help-my-self-in-agile-ui-changes-with-cypress-and-percy-44gp</guid>
      <description>&lt;p&gt;Everything started with me, a QA member, being assigned to a project with a full agile workflow with continuous and dynamic changes every day. So I end up testing daily UI changes from creating and refactoring full pages, to small padding or text font changes. As an automation tester, I use Cypress for my function automation, so I start researching Cypress plugins and extensions for UI particularly to make my life easier... and Percy works perfectly for this.&lt;/p&gt;

&lt;p&gt;Percy takes snapshots of all the content on a page routed true Cypress test and stores it on the web, so I don’t need to care about the place and storage for my snapshots. Percy saves all snapshots when run tests for the first time, and every subsequent time it will compare the currently taken snapshot with the last one and point to changes, so I could easily see small details.&lt;/p&gt;

&lt;p&gt;I found that this solution works well for me, so I’ll will provide you with the steps, so you can easily start testing UI with readable changelogs and visual changes - without missing the small details.&lt;/p&gt;

&lt;p&gt;First, you need to create a free account on &lt;a href="https://percy.io/"&gt;Percy&lt;/a&gt;&lt;br&gt;
After you finish, Percy will provide you with PERCY_TOKEN which is used later in configuration before running the tests.&lt;/p&gt;

&lt;p&gt;In the opened project in your favorite code editor with installed Cypress, you need to install &lt;a href="https://github.com/percy/percy-cypress"&gt;percy-cypress&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev @percy/cypress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Import package in commands to have access to snapshot command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// At the top of cypress/support/commands.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@percy/cypress&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;p&gt;Require percyHealthCheck in plugins which is necessary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// In cypress/plugins/index.js&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;percyHealthCheck&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;@percy/cypress/task&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&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;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;task&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;percyHealthCheck&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;Now you can use Percy command in your test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Take a snapshot for visual diffing&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;percySnapshot&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I use one percySnapshot per "it" section in my tests separating them by pages like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;Loads the AboutUs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Visit specific page&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://website.com/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Take a snapshot for visual diffing&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;percySnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AboutUs&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;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;Loads the HomePage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Visit specific page&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://website.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Take a snapshot for visual diffing&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;percySnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;HomePage&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;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;Loads the ContactUs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Visit specific page&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://website.com/contact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Take a snapshot for visual diffing&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;percySnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ContactUs&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now its time to set mentioned PERCY_TOKEN environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Windows
$ set PERCY_TOKEN=&amp;lt;your token here&amp;gt;

# Unix 
$ export PERCY_TOKEN=&amp;lt;your token here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running your test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;percy exec -- cypress run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time you run tests, snapshots will be initialized and you can see them on the web app.&lt;br&gt;
After running the tests one more time, there will be a list of all test runs on the Percy web app, and it’ll look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8WVXCLTL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92kodhy16t1bbdwt5lw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8WVXCLTL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92kodhy16t1bbdwt5lw9.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When some changes are detected after snapshots are compared, you can see those changes visually and decide if they are expected or mistakes - so you can report them as bugs.&lt;/p&gt;

&lt;p&gt;Visual UI comparing looks like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AZ-9QE5T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzm5vot6c7hzadhzwdz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AZ-9QE5T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzm5vot6c7hzadhzwdz1.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Having snapshots of the previous state and comparing it with the real state of the web page really helps me to not miss all the small details and bugs that can occur when it comes to rendering UI elements - especially the visual part of Percy where I can clearly see changes bolded in red. Now I run tests daily for all my pages on the web after developers push all changes on a testing environment.&lt;/p&gt;

&lt;p&gt;There are other free open-source solutions, but I found most of them quite buggy. For now, the free version of Percy with 5000 screenshots/month works fine for me. &lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>cypress</category>
      <category>testing</category>
    </item>
    <item>
      <title>Newman integration in the QA process</title>
      <dc:creator>keycho47</dc:creator>
      <pubDate>Mon, 02 Nov 2020 17:21:58 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/newman-integration-in-the-qa-process-3kpi</link>
      <guid>https://dev.to/bornfightcompany/newman-integration-in-the-qa-process-3kpi</guid>
      <description>&lt;p&gt;&lt;strong&gt;Newman&lt;/strong&gt; is a command line Collection Runner for the Postman and we use it in order to continually test API calls on the backend which are in complex forms involving various filters and tags which are sent in URL parameters.&lt;/p&gt;

&lt;p&gt;While using Postman Interceptor in browser, all the requests that are called on as a result of using and clicking on the app itself, and which are turned into collections, are sent on the Postman app.&lt;/p&gt;

&lt;p&gt;Collections, with the usage of Newman through command line, can run as a simulation of calling up all the requests from a given collection.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Setup&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Postman Interceptor&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the Chrome Web Store and download the interceptor as an extension&lt;/li&gt;
&lt;li&gt;Click on the satellite icon which showed up in browser. Afterwards, click on the Install Interceptor Bridge
on an opened popup window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Collection preparation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Postman app or download it from the web (for an app to work with the interceptor, Postman must be in a desktop version)&lt;/li&gt;
&lt;li&gt;Open the app you wish to test in the browser in an additional tab.&lt;/li&gt;
&lt;li&gt;Open the Postman Interceptor on that exact tab and turn the Capture requests option on.&lt;/li&gt;
&lt;li&gt;All the requests, which are sent from the web app in history tab, will be received on a desktop version of
the Postman app.&lt;/li&gt;
&lt;li&gt;Mark all the requests which are relevant for automatic continuous testing then save them in a
collection.&lt;/li&gt;
&lt;li&gt;Go to Collections tab and click 'edit' above the created collection

&lt;ul&gt;
&lt;li&gt;Open the tab Tests on an open popup window and write the following:
&lt;/li&gt;
&lt;/ul&gt;


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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Status code is 200"&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="n"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eql&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="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Go to Collections tab and click 'export collections' to export the created collections.
Collections are exported in Collection v2.1 (recommended form) and locally saved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Project Preparation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the project in a code editor&lt;/li&gt;
&lt;li&gt;Installation:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="n"&gt;newman&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a folder 'newman'&lt;/li&gt;
&lt;li&gt;Move the collection for that project from the local machine to a newman directory.&lt;/li&gt;
&lt;li&gt;Run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;newman&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;newman&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mycollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a script in package.json:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&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;newman:run&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;newman run newman/mycollection.json&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;p&gt;&lt;strong&gt;CI/CD&lt;/strong&gt;&lt;br&gt;
For this part, u need to choose your preferred tool for CI/CD and create necessary files in the project example JenkinsFile for Jenkins where it's described where and when will your script run.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>tips</category>
      <category>api</category>
      <category>engineeringmonday</category>
    </item>
    <item>
      <title>How QA ensures your
contact form won’t
disconnect you from clients</title>
      <dc:creator>keycho47</dc:creator>
      <pubDate>Fri, 19 Jun 2020 11:26:32 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/how-qa-ensures-your-contact-form-won-t-disconnect-you-from-clients-30lm</link>
      <guid>https://dev.to/bornfightcompany/how-qa-ensures-your-contact-form-won-t-disconnect-you-from-clients-30lm</guid>
      <description>&lt;h2&gt;
  
  
  When we start conducting Quality Assurance activities in Bornfight, we always start by separating features and giving them a priority. One of the features that’s constantly on the top of the priority list and that the clients care about is the contact form.
&lt;/h2&gt;

&lt;p&gt;As contact forms are your direct link to potential customers and clients, they need to be useful and intuitive. You don’t want to have a contact form that confuses your users or completely prevents them from contacting you. Situations like these can lead to your business losing users or potential clients, and ultimately result in decreased revenue.&lt;/p&gt;

&lt;p&gt;To prevent that from happening and to ensure that every contact form we work on is fully operational, our Quality Assurance team performs a set of different activities as a way of properly testing every aspect of a contact form.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #01: Form Layout
&lt;/h3&gt;

&lt;p&gt;When we start working on a contact form, we check if the layout of the form is visually complicated or simple and understandable for users, because users don’t tolerate complexity when it comes to forms and will easily give up if the form it is not intuitive.&lt;/p&gt;

&lt;p&gt;So what is a simple and intuitive form? It’s a form with fewer fields that are well laid out and that look easy to complete. Here’s a good example of a form that is visually clear, well laid out and understandable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XtsChdnG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jrr36jql4jz9gvucsbfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XtsChdnG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jrr36jql4jz9gvucsbfl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Having a form like that can ultimately result in a much higher submission rate, than a one with a much higher number of fields or a more complex layout.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #02: Form Fields
&lt;/h3&gt;

&lt;p&gt;All forms come with different types of fields, depending on the information that needs to be filled. These 4 are some of the most used ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checkboxes&lt;/li&gt;
&lt;li&gt;Input text fields&lt;/li&gt;
&lt;li&gt;Radio buttons&lt;/li&gt;
&lt;li&gt;Dropdown select&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With form fields, our goal is to make sure that all fields are clickable and the user can enter the needed information into them — whether it’s text, numbers of anything else that is needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Since a lot of forms have custom elements within them, we test them across a variety of platforms in order to make sure that all of them work properly in all browsers and devices.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #03: Required Fields
&lt;/h3&gt;

&lt;p&gt;When testing required fields, we first click on the &lt;strong&gt;SUBMIT&lt;/strong&gt; button to see if the form validation highlights the required fields correctly and that error messages are properly displayed for each of the required fields.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zD-FIJ2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/090jpa3ovyh3hfwd7ube.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zD-FIJ2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/090jpa3ovyh3hfwd7ube.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PRO TIP: A good practice is to always mark required or mandatory fields with an asterisk — users are used to seeing them and it’s a simple way of clearly showing if users need to fill a specific field or not. Another element that is good to implement is a short statement that says that fields marked with an asterisk are mandatory — this makes it much easier for users to understand which fields they have to fill in and which ones are optional.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #04: Validation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;There are 2 types of validation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inline validation&lt;/li&gt;
&lt;li&gt;Submit validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inline validation is performed automatically as users enter information into the form. It happens on every interaction and it displays a message immediately after the user types in data.&lt;/p&gt;

&lt;p&gt;Once the form is submitted, that is when submit validation takes place. As opposed to inline validation that gives immediate feedback to the user, if a form has submit validation and there are any problems with any of the fields, feedback will not be given to the user until they click on the &lt;strong&gt;SUBMIT&lt;/strong&gt; button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #05: Validate Input
&lt;/h3&gt;

&lt;p&gt;Another aspect that we test is the input validity and the specifics of validation messages. In order for a form to be fully operational, it needs to be able to prove the validity of the information written into a specific field (like an email address or a telephone number). As information entered into a specific field needs to be written in a specific format (for example, a phone number field can’t accept letters, just numbers), we conduct testing to ensure that the fields work only when the correct format is entered and that the users know what that format is.&lt;/p&gt;

&lt;p&gt;Forms that have this properly implemented will display a clear validation message and notify users that their email address (or a phone number or any other information) has been entered incorrectly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j7TgTsDa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z1683ewd9eyhwxssk3gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j7TgTsDa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z1683ewd9eyhwxssk3gn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;However, some forms can go over the top by preventing users from submitting a form because of a specific requirement on a field that, and combining that with an unhelpful validation message — performing QA testing is one of the ways to prevent that your form doesn’t end up in this category.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During our testing, we cover all of the specific use cases and explore what happens if we input text into fields that may expect a number or if we enter an incorrect email address into an email address field. In addition to that, we test a variety of punctuation marks to see how the form responds, as some forms may actually prevent certain characters from being entered due to potential security risks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #06: Validation Messages
&lt;/h3&gt;

&lt;p&gt;Any validation message displayed next to a field serves to help the user and inform them about the problem. That is why we check if implemented validation messages correctly describe the problem, such as whether a specific field is required or whether the input is incorrect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To conduct this type of testing, we follow this mindset: “as a user, would I understand this validation message that is displayed?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Step #07: Other Validation Elements&lt;br&gt;
Some forms will explicitly mark when a field has been completed successfully, and display a small cross if the completion is unsuccessful.&lt;/p&gt;

&lt;p&gt;When testing, we always make sure that the correct checkmarks or crosses are displayed based on what has been entered into a specific field (if anything is entered at all). For example, when a user enters correct information into a field, it makes perfect sense to display a green checkmark next to the field, but that would be absolutely pointless if a user hasn’t entered anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #08: Form Tab Order
&lt;/h3&gt;

&lt;p&gt;When it comes to entering information into a form, it should be possible to fill in a form by using the &lt;strong&gt;TAB key&lt;/strong&gt; on a keyboard as a way of moving to the next field. This is important as it improves the accessibility of a specific form.&lt;/p&gt;

&lt;p&gt;This is a simple test where we check if the form even has the possibility of of tabbing through a form in a specific sequence and if the cursor is correctly placed into the next field every time we press the TAB key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An extension of this test would be to check for the possibility of completing and submitting the whole form just by using your keyboard.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #09: Tooltips
&lt;/h3&gt;

&lt;p&gt;Certain forms have tooltips or help information that appears by either floating over each field or over an icon next to the field. During our testing, we make sure that each tooltip appears correctly and that the displayed messages (if the form even has them) are understandable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #10: Prefilled Fields
&lt;/h3&gt;

&lt;p&gt;Certain forms will automatically prefill some fields. For instance, if you click on a link to enquire about a product or a service, the resulting form may already have that product or service preselected in the relevant field. This is a great way of simplifying the process of filling out a form, and it provides users with a much more streamlined experience, so if a certain form has the potential to implement such a feature or already has it implemented, QA will ensure that every combination is properly connected and that the right fields are filled with the right information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anything that cuts down on the user having to complete a field is of great importance as it will help to increase the conversion rate for that form.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #11: Thank You Page
&lt;/h3&gt;

&lt;p&gt;After a form has been submitted, a user needs to get a confirmation that everything was successful. That is why we make sure that a thank you page with a relevant appreciation message is displayed to the user after a form has been successfully submitted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #12: Email Confirmation
&lt;/h3&gt;

&lt;p&gt;Certain forms will email a confirmation to the user saying they have completed the form and showing appreciation for their submission. In case that a form requires a follow-up action (that is usually the case with registration forms) then a user should receive an an email confirmation message that contains all of the details explaining what that follow-up action is (such as clicking on a validation link to confirm the registration).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If the confirmation email is an HTML email, then it is a good idea to complete this test a number of times across different email clients — we do it to ensure that the confirmation email displays correctly and that any and all links within the email work correctly across Gmail, Yahoo Mail, etc.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #13: Form Actions
&lt;/h3&gt;

&lt;p&gt;When a user completes a form, another thing that should also happen is that a form submission email should be sent to you (or the operator of the website). This email should provide all the details about the submitted form, together with the information entered into specific fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;During the testing phase, we ensure that this email is delivered in a layout that is easily readable, as it will enable everyone who needs to work on form submissions to have a clear overview of the entire situation and a more streamlined workflow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another element we test during this phase are additional actions. For instance, saving the form into a database or possibly an integration with an email marketing or a CRM system. These aspects ought to be thoroughly tested to confirm that the data from the form is accurately saved or that it finds its way across to software it is integrated with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #14: Browser Testing
&lt;/h3&gt;

&lt;p&gt;As users access forms through a variety of different browsers, it is very important to test them across a majority of the most used ones. We do this to ensure that the layout of the form, any inline validation messages or core functionalities (like a submit button) don’t get broken on certain browsers (or their versions) which would prevent users from completing them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #15: Mobile Testing
&lt;/h3&gt;

&lt;p&gt;To ensure that forms work on all platforms, we round up the test by making sure they perform as planned on mobile devices, such as iPhones, iPads and a variety of Android devices.&lt;/p&gt;

&lt;p&gt;As you might have noticed, it can be very difficult to complete some types of forms on a mobile device, especially if there are a lot of fields. That is why our testing focuses on ensuring maximum functionality, like detecting if all elements (such as radio buttons or checkboxes) and that users can navigate through the form without any issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A good mindset to have is: “if you get fed up when testing the form, then users will feel the same way filling it in”.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step #16: More Forms Testing
&lt;/h3&gt;

&lt;p&gt;In addition to all of the testing activities we mentioned above, depending on the specific type of a form and the needs of the client, we also conduct additional types of testing accessibility, security and usability. They consist of specific activities, and you can learn more about them on our page about Quality Assurance.&lt;/p&gt;

&lt;p&gt;Contact form is one of the most important elements on the website&lt;br&gt;
Contact form represents one of your first touchpoints with a potential customer — and it’s all about maximizing user experience. The less effort they have to take to go through the process of filling the form, the happier they will be and higher will be the rate of completion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you have a frustrated potential customer who is struggling with completing the form, you will end up with no customer at all. That is the main reason why we always take more time to ease on the process, making sure every part (visually and functionally) is at its best.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Within the Quality Assurance team, we always like to say that the point when users make a really strong opinion of you is when they try to reach you — that is the point when you are most relevant to them. And that is why we place such a strong emphasis on making sure that every aspect of a contact form performs flawlessly&lt;/p&gt;

</description>
      <category>qa</category>
      <category>testing</category>
      <category>engineeringmonday</category>
      <category>tips</category>
    </item>
  </channel>
</rss>
