<?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: gcalvoCR</title>
    <description>The latest articles on DEV Community by gcalvoCR (@gcalvocr).</description>
    <link>https://dev.to/gcalvocr</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%2F314229%2F340b17c1-f6fc-41d5-891a-410c11e29c97.png</url>
      <title>DEV Community: gcalvoCR</title>
      <link>https://dev.to/gcalvocr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gcalvocr"/>
    <language>en</language>
    <item>
      <title>Allure and Jenkins</title>
      <dc:creator>gcalvoCR</dc:creator>
      <pubDate>Tue, 20 Oct 2020 22:57:50 +0000</pubDate>
      <link>https://dev.to/gcalvocr/allure-and-jenkins-44nl</link>
      <guid>https://dev.to/gcalvocr/allure-and-jenkins-44nl</guid>
      <description>&lt;p&gt;In order to use &lt;strong&gt;Allure&lt;/strong&gt; inside &lt;strong&gt;Jenkins&lt;/strong&gt; you basically need 3 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Under &lt;code&gt;Jenkins &amp;gt; Manage Jenkins &amp;gt; Manage Plugins&lt;/code&gt; install the Allure plugin.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Then, under &lt;code&gt;Jenkins &amp;gt; Manage Jenkins &amp;gt; Global Tool Configuration&lt;/code&gt; you also need to install the Allure Commandline. In order to do so, you can try to installing it automatically from the Maven Central Repo, as follows:&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;In each project, set the path to the allure-results directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it, we're ready to generate Allure reports.&lt;/p&gt;

&lt;p&gt;The first time you run your &lt;strong&gt;job&lt;/strong&gt;, Jenkins will try to download the installation zip file and install the Allure Commandline for you. &lt;/p&gt;

&lt;p&gt;If for some reason it gives you a problem similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;[Checks API] No suitable checks publisher found.
java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.zip
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3061)
    at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:628)
    at java.net.URLConnection.getContentLengthLong(URLConnection.java:500)
    at java.net.URLConnection.getContentLength(URLConnection.java:484)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:412)
&lt;/span&gt;&lt;span class="gp"&gt;    at org.jvnet.robust_http_client.RetryableHttpStream.&amp;lt;init&amp;gt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;RetryableHttpStream.java:90&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;Caused: java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.zip
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem is that you're trying to connect to  &lt;code&gt;https://repo.jenkins-ci.org&lt;/code&gt; and you probably don't have permission.&lt;/p&gt;

&lt;p&gt;What you could do is try install the &lt;strong&gt;Allure Commandline&lt;/strong&gt; &lt;code&gt;Jenkins &amp;gt; Manage Jenkins &amp;gt; Global Tool Configuration&lt;/code&gt; a different way. Rather than trying to get the zip installer from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;https://repo.jenkins-ci.org&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Try getting directly from &lt;code&gt;https://repo.maven.apache.org&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check &lt;code&gt;https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/&lt;/code&gt; to determin which version you need.&lt;/p&gt;

&lt;p&gt;Then, write the url of the zip version you want to install, for example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.5/allure-commandline-2.13.5.zip&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And you'll be fine. The installer should look similar to the following:&lt;/p&gt;

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

&lt;p&gt;Apply the changes, go back to the job and see the magic happening!&lt;/p&gt;

&lt;p&gt;I hope this helps anyone!&lt;/p&gt;

</description>
      <category>allure</category>
      <category>jenkins</category>
      <category>cicd</category>
      <category>automation</category>
    </item>
    <item>
      <title>Can we retry failed tests with testng? IRetryAnalyzer</title>
      <dc:creator>gcalvoCR</dc:creator>
      <pubDate>Fri, 17 Jul 2020 22:42:40 +0000</pubDate>
      <link>https://dev.to/gcalvocr/can-we-retry-failed-tests-with-testng-iretryanalyzer-pi7</link>
      <guid>https://dev.to/gcalvocr/can-we-retry-failed-tests-with-testng-iretryanalyzer-pi7</guid>
      <description>&lt;p&gt;Automation runs could fail for an endless number of reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flaky tests,&lt;/li&gt;
&lt;li&gt;Running environment not steady,&lt;/li&gt;
&lt;li&gt;Bugs,&lt;/li&gt;
&lt;li&gt;Changes in selectors,&lt;/li&gt;
&lt;li&gt;Framework problems,&lt;/li&gt;
&lt;li&gt;And so on and so forth...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the aspects we definitely need to take into count is to investigate the &lt;strong&gt;root causes&lt;/strong&gt; why the testcases fail, but in this post I want to bring up another topic.&lt;/p&gt;

&lt;p&gt;If the team wants to rerun the failing tests under certain conditions, the different frameworks and programming languages usually offer diverse mechanisms that could let us re-run testcases programmatically.&lt;/p&gt;

&lt;p&gt;Knowing that "Selenium-java" is still relevant and many people still use frameworks such as &lt;strong&gt;testng&lt;/strong&gt;, I want to bring up the specific feature that &lt;strong&gt;testng&lt;/strong&gt; offers, because it's a feature that's been available for quite a long time, and one I hadn't taken advantage of it, up to recently.&lt;/p&gt;

&lt;p&gt;It's pretty straight forward, all what we have to do is to add the &lt;strong&gt;retryAnalyzer&lt;/strong&gt; property to the test decorator and create the class that handles the logic for the retry.&lt;/p&gt;

&lt;p&gt;Let's look at the following chunck of code as an example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First we add the property.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Test&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;retryAnalyzer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DynamicRetryAnalyzer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;verifyWidgetOnPage&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;  &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;runTheTest&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then we create the class with the logic to retry your tests.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.testng.IRetryAnalyzer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.testng.ITestResult&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DynamicRetryAnalyzer&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;IRetryAnalyzer&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;maxRetryCount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;retry&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ITestResult&lt;/span&gt; &lt;span class="n"&gt;iTestResult&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;maxRetryCount&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
            &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In this specific example the framework will retry a fail test an extra time no matter what (just if it fails). The example is kind of simple, but, I think we get the picture. If we need any specific logic to evaluate wether we should rerun a test or not, we do it by changing the logic inside the &lt;strong&gt;public boolean retry(ITestResult iTestResult)&lt;/strong&gt; method. &lt;/p&gt;

&lt;p&gt;The only thing we need to make sure is to implement the &lt;strong&gt;IRetryAnalyzer&lt;/strong&gt; interface and override the &lt;strong&gt;retry(ITestResult iTestResult)&lt;/strong&gt; method with the logic that we need to evaluate if we should rerun the test or not.&lt;/p&gt;

&lt;p&gt;I hope this helps anyone!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"A test which fails is not always flaky!"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>testing</category>
      <category>java</category>
      <category>testng</category>
      <category>selenium</category>
    </item>
    <item>
      <title>Alien symbols in Jenkins!</title>
      <dc:creator>gcalvoCR</dc:creator>
      <pubDate>Tue, 26 May 2020 17:29:42 +0000</pubDate>
      <link>https://dev.to/gcalvocr/alien-symbols-in-jenkins-3hae</link>
      <guid>https://dev.to/gcalvocr/alien-symbols-in-jenkins-3hae</guid>
      <description>&lt;p&gt;If you ever come accross some these "alien symbols" in Jenkins, specially on Windows:&lt;/p&gt;

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

&lt;p&gt;And you want to make it up, the problem is the default encoding system and the solution is pretty &lt;em&gt;straight forward&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigate to the directory where jenkins is installed. Usually &lt;code&gt;C:\Program Files (x86)\Jenkins&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once in the folder, open the &lt;code&gt;jenkins.xml&lt;/code&gt; with Notepad, VSCode or any text editor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add --&amp;gt; &lt;code&gt;-Dfile.encoding=UTF8&lt;/code&gt; to the arguments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The arguments should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;arguments&amp;gt;&lt;/span&gt;-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dfile.encoding=UTF8 -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"&lt;span class="nt"&gt;&amp;lt;/arguments&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;restart you Jenkins service and voilá!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, if you run the job/pipeline, you should see the console output showing the logs properly!&lt;/p&gt;

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

&lt;p&gt;That's it, keep having fun with your CI/CD pipelines!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>utf8</category>
      <category>problems</category>
    </item>
    <item>
      <title>Callbacks in JavaScript. Let's break them down!</title>
      <dc:creator>gcalvoCR</dc:creator>
      <pubDate>Fri, 17 Jan 2020 15:54:25 +0000</pubDate>
      <link>https://dev.to/gcalvocr/callbacks-in-javascript-let-s-break-it-down-2bpk</link>
      <guid>https://dev.to/gcalvocr/callbacks-in-javascript-let-s-break-it-down-2bpk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Callbacks&lt;/strong&gt; are a simple concepts that many times confuse people when they are learning how to program.&lt;/p&gt;

&lt;p&gt;Leaving aside that depending on the programming language the implementation could vary and there are synchronous callbacks (immediate) and asynchronous callbacks (may happen at a later time). Let's just focus on JavaScript.&lt;/p&gt;

&lt;p&gt;Let's take the 3 following concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all, the formal &lt;strong&gt;definition of a callback&lt;/strong&gt; is &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;"is any executable code that is passed as an argument to other code that is expected to call back (execute) the argument at a given time"&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In &lt;strong&gt;JavaScript&lt;/strong&gt; you can assign &lt;strong&gt;functions to variables&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript methods (functions) are first class objects, you can pass them around like variables&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing that, let's dive into an example to make it crystal clear.&lt;/p&gt;

&lt;p&gt;Let's say that we define an &lt;code&gt;execute&lt;/code&gt; method that receives a variable and a (callback) function.&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;function&lt;/span&gt; &lt;span class="nx"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&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;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;px&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="nx"&gt;x&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;&lt;em&gt;I know, it's not necessary to instantiate the x&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this simple case, the callback function could be any function that has one parameter, so, let's define 2 more methods (functions) to test the &lt;code&gt;execute&lt;/code&gt; method.&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;function&lt;/span&gt; &lt;span class="nx"&gt;squaredNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;px&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;px&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;numberPlusHundred&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;px&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;px&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;100&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;So, if we run:&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;execute&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="nx"&gt;squaredNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;execute&lt;/span&gt; &lt;span class="nx"&gt;method&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;squaredNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="nx"&gt;would&lt;/span&gt; &lt;span class="nx"&gt;be&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But if we run:&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;execute&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="nx"&gt;numberPlusHundred&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;execute&lt;/span&gt; &lt;span class="nx"&gt;method&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt; &lt;span class="nx"&gt;numberPlusHundred&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="nx"&gt;would&lt;/span&gt; &lt;span class="nx"&gt;be&lt;/span&gt; &lt;span class="mi"&gt;102&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It is as simple as that, using callback functions enable us to call different functions as needed making the programming even more flexible. &lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The given example could be way too simple but trust me, callbacks are used everywhere! To mention a couple of examples, Jquery and Ajax have them implemented in many methods. So, you should master the concept and take advantage of their benefits (Abstraction, Maintainability, Readability), and so on.&lt;/p&gt;

&lt;p&gt;Any comments?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>callback</category>
      <category>frontend</category>
      <category>node</category>
    </item>
    <item>
      <title>The challenges of QA Automation Engineer. Some things I have noticed!</title>
      <dc:creator>gcalvoCR</dc:creator>
      <pubDate>Tue, 14 Jan 2020 20:09:49 +0000</pubDate>
      <link>https://dev.to/gcalvocr/the-challenges-of-qa-automation-engineer-some-things-i-have-noticed-3n1</link>
      <guid>https://dev.to/gcalvocr/the-challenges-of-qa-automation-engineer-some-things-i-have-noticed-3n1</guid>
      <description>&lt;p&gt;We as QA Automation Engineers have lots of responsibilities, tasks and things to learn in our daily basis. We love solving problems, learning new cool stuff to apply to our projects, reporting bugs and off course automating everything. The job as a QA Automation Engineer is usually exciting and in many cases challenging.&lt;/p&gt;

&lt;p&gt;Talking about challenges, there are some that I would like to point out.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Team communication and collaboration
&lt;/h1&gt;

&lt;p&gt;There is still a gap between developers and the QA teams which we need to close. Usually, developers don't program taking in count automation needs, and it could be different. We should start thinking about working closer together. We could  add more value to the projects by reporting issues earlier. Also, let developers know that, we could be that "safety net" for the programming processes, allowing them program with more confidence and less stress, just to  mention one point. &lt;/p&gt;

&lt;p&gt;I think there are many small "tweaks" that developers could add up to the various elements that help a lot the automating processes, such as, adding ids or unique names to the elements we need to automate. These minimum adjustments are nothing for developers and could have great impact on the automation. &lt;/p&gt;

&lt;h1&gt;
  
  
  2. Test case maintainability
&lt;/h1&gt;

&lt;p&gt;With the products always changing and adding new features, test cases change all the time. If the application has many features, it could be translated into thousands of test cases which are tough to maintain. Therefore, we need to automate taking that in count. That means, making frameworks as flexible as possible, following best practices, allowing parallel testing, having a automation strategy, and so on...&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Functional testing
&lt;/h1&gt;

&lt;p&gt;Functional testing is great and that's usually the approach we take to assure quality, but we need to understand that not everything could be automated and not everything is functional testing.&lt;/p&gt;

&lt;p&gt;On one side, we need to combine functional testing with sorts of testing. That's where other approaches such as visual testing could help us a lot, because it could make tests more reliable. &lt;/p&gt;

&lt;p&gt;On the other side. Automation is not a replacement of manual testers. Automation should be used to take the repeated work away from manual testers, so that, they could use their full focus and strength in finding new testing scenarios and bugs. &lt;/p&gt;

&lt;p&gt;Lastly, we should have an automation strategy...&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Testing data
&lt;/h1&gt;

&lt;p&gt;Automation usually needs data. In many cases, that means creating entire projects or modules devoted for that purpose. &lt;/p&gt;

&lt;p&gt;This projects have many advantages, for example, they could avoid using the UI to create data making many test cases less flaky, they shorten the test duration, and make the test cases go directly to their point. &lt;/p&gt;

&lt;p&gt;Therefore, anytime we need any specific information we should create it under the hood, but in doing so we need to pay attention to adapt the test cases to avoid creating unnecessary data, because we could be filling the databases of the testing environments with garbage which is usually annoying for everybody (especially developers) and it could cause some additional problems.&lt;/p&gt;

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

&lt;p&gt;Test automation is an interesting and rewarding career. It certainly has its challenges. I just mentioned four but there are many more. &lt;/p&gt;

&lt;p&gt;We should start communicating better, close gaps between colleagues, maintain test cases, have automation strategies, take advantage of different testing approaches and adapt our tests to our needs. In doing so, we will have many benefits, not only for us (QA teams), but for the organizations we work for as well.&lt;/p&gt;

&lt;p&gt;Let's keep learning, improving, testing and automation our projects!&lt;/p&gt;

</description>
      <category>automation</category>
      <category>qa</category>
    </item>
  </channel>
</rss>
