<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gustavo Miguens on Medium]]></title>
        <description><![CDATA[Stories by Gustavo Miguens on Medium]]></description>
        <link>https://medium.com/@gustavo.miguens?source=rss-20d8b11656f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GV18HlazwymYB9en.jpg</url>
            <title>Stories by Gustavo Miguens on Medium</title>
            <link>https://medium.com/@gustavo.miguens?source=rss-20d8b11656f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:31:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gustavo.miguens/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Responsive Testing & Cypress]]></title>
            <link>https://medium.com/flux-it-thoughts/responsive-testing-cypress-72d2be68690b?source=rss-20d8b11656f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/72d2be68690b</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Gustavo Miguens]]></dc:creator>
            <pubDate>Fri, 20 Nov 2020 16:32:08 GMT</pubDate>
            <atom:updated>2020-12-17T14:13:50.242Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJtYwo_1x4LUEp7LjZLSXw.jpeg" /></figure><blockquote><strong>A scalable, dynamic, and powerful solution for responsive testing with Cypress.</strong></blockquote><p><a href="https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell">Cypress</a> is an <em>open-source </em>test automation tool for web applications. Although it’s most often compared to <em>Selenium, </em>it’s completely different regarding its foundations and architecture. With its extensive and detailed documentation, plus its simple initial configuration, it makes us forget old headaches when it comes to automating tests. The one thing that sets Cypress apart from other testing tools is that it seems to have everything solved.</p><p><strong>The issue of responsive testing is that it is introduced as an unexplored and unexploited area:</strong> the documentation examples are more like a demo than a real project.</p><p>Something else that caught my attention is that while surfing the web, I only found an <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">article</a> by <a href="https://medium.com/@sumn2u">Suman Kunwar</a> (which I’ll come back to throughout this text) that is much more similar to what I had in mind.</p><p>Within this context, I make my contribution: a deeper view focused on applying responsive testing to larger projects.</p><h3>A few aspects I took into account to analyze the issue</h3><p>We cannot use the Cypress <a href="https://docs.cypress.io/api/commands/viewport.html#Width-Height">documentation</a> approach because it suggests that we set the resolution we’ll use in each test (there can be N resolutions within a <em>forEach </em>per test)<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYFNylJn0mcEzzFfWkinyg.png" /></figure><p>I had envisioned several test suites, so it became clear that this approach wasn’t feasible.</p><p>If we don’t want to use the <em>if </em>that appears in the previous example, we must always use resolutions with <em>value pairs,</em> or the Cypress presets (which reduce our options).</p><p>Would it be practical to have each test executed in all the resolutions every time we run the suite(s)? What if we need to run a regression test in just one resolution? In this respect, I also decided that it would be best to have a default resolution to test with all the time, and then use a set of N resolutions to perform integration tests.</p><p>Moreover, <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent">userAgents</a>, which are mentioned in the above-cited <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">article</a> but not in the documentation, come into play. As you can see in the article, there are two key aspects:</p><ol><li><strong>The available options are ‘mobile’, ‘tablet’, and ‘desktop’.</strong> A resolution (iPhone5) is linked to a single userAgent. The questions are clear: Will we always want to test iPhone5 with that userAgent? Will we always use the resolution of a single device to run mobile tests? Will we have to edit those values every time we need to use another device? <strong>The issue lies in the fact that it is not scalable.</strong></li><li><strong>The solution seems rather static: we define the type of device and have only one option. </strong>Picturing the natural development of projects, in which definitions often change, <strong>it would be difficult to make the solution fit into those changes.</strong></li></ol><h3>So, how do we manage to have a scalable responsive solution?</h3><p>For that purpose, we’ll use the <a href="https://docs.cypress.io/guides/guides/module-api.html">Cypress API</a> through a script.</p><p>As in everything, this is no more than an alternative. It is not intended to be the ultimate solution, but, after having tried it, I believe it turned into a <strong>strong starting point.</strong></p><p>The aforementioned <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">article</a> understood that the right path is to have a default configuration in the <em>cypress.json </em>file that modifies some of its <em>settings</em> according to the parameters we establish. This is where we set ourselves apart and expand the solution. We want to have N resolutions (meaning N available devices to emulate) and N userAgents (in other words, N emulated operating systems). Moreover, we want to be able to set iOS apart from Android. We want to be able to provide test runs and regression tests even more specific: <em>iPhone-X, iOS 13.3.1.</em></p><p><strong><em>Commands</em></strong></p><p>The script will allow us to set <em>&lt;device&gt;</em> and <em>&lt;osVersion&gt; </em>as parameters; and, if necessary, (for example, if we run the script on <a href="https://docs.cypress.io/guides/guides/continuous-integration.html#Setting-up-CI">continuous integration</a>), we can define the &lt;record&gt; parameter, which will, in turn, set the <em>record key</em> stored as an environment variable. It will also allow us to establish the &lt;open&gt; parameter so we can use the Cypress <a href="https://docs.cypress.io/guides/core-concepts/test-runner.html#Overview">runner</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2421314197f001f11302a54a521653f1/href">https://medium.com/media/2421314197f001f11302a54a521653f1/href</a></iframe><p><strong><em>Hands on!</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b48b3fc0607cac9709d5b9f825ea6bbf/href">https://medium.com/media/b48b3fc0607cac9709d5b9f825ea6bbf/href</a></iframe><p>The script logic allows us to always get to execute the suites. As long as the <em>&lt;device&gt;</em> parameter exists in the devices.js file, the script will wait for us to set the <em>&lt;osVersion&gt;</em> corresponding to that kind of device (iOS &amp; Android). For example, we can set <strong>“iPhoneX”</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ce9190428ff2f2b8bf9a352685fecbe/href">https://medium.com/media/9ce9190428ff2f2b8bf9a352685fecbe/href</a></iframe><p>Once the device has been defined, the script will search within the osVersions defined in the os.js file corresponding to the iOS devices. For example, we can set <strong>“13.3.1”</strong>.</p><p><em>If the version we entered doesn’t exist in the list, the script will search for the default version of that OS.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11549dc494314353e7c2633f76473599/href">https://medium.com/media/11549dc494314353e7c2633f76473599/href</a></iframe><blockquote>node cy-start.js — -d iphoneX -osV 13.3.1 -o</blockquote><p>From the Cypress runner, we can see the following environment variables are available: <strong><em>device, osVersion, osType.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*aXV8bhhoYaTKpyrs7FHW_w.png" /></figure><p>We can take advantage of those variables in order to use them for the suite names.</p><p>When running the example script, we’ll see that the tests were executed at the specified version and resolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbTjfWrYYTishDuewvDvng.png" /></figure><p>Finally, in order to help users, we make the ways in which the script can be executed available, as well as the devices and versions.</p><p><a href="https://gist.github.com/gusmiguens/01eb143a55ea1a41c607a432bcb6b317">Here</a>’s the complete script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbYLt-e0NPdbb55ZxfQcZQ.png" /></figure><h3>Conclusion</h3><p>Thanks to this approach, <strong>we are now capable of testing functionalities or run regression tests on specific devices and versions, being able to adapt to any necessary combination. </strong>It also allows us to <strong>reduce daily testing times</strong> using versions set by default. Moreover, the script logic allows us to add as many configurations and variations as necessary to improve our tests and adapt them to our testing needs.</p><p><em>Know more about Flux IT: </em><a href="https://www.fluxitsoft.com/en/home/"><em>Website </em></a><em>· </em><a href="https://www.instagram.com/fluxitsoft/?source=post_page---------------------------"><em>Instagram</em></a><em> · </em><a href="https://www.linkedin.com/company/fluxit/?source=post_page---------------------------"><em>LinkedIn</em></a><em> · </em><a href="https://twitter.com/FluxITSoft?source=post_page---------------------------"><em>Twitter</em></a><em> · </em><a href="https://dribbble.com/fluxit?source=post_page---------------------------"><em>Dribbble</em></a><em> · </em><a href="https://fluxit.breezy.hr/"><em>Breezy</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72d2be68690b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flux-it-thoughts/responsive-testing-cypress-72d2be68690b">Responsive Testing &amp; Cypress</a> was originally published in <a href="https://medium.com/flux-it-thoughts">Flux IT Thoughts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Responsive testing & Cypress]]></title>
            <link>https://medium.com/flux-it-thoughts/responsive-testing-cypress-6e7ede888ba8?source=rss-20d8b11656f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e7ede888ba8</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[español]]></category>
            <dc:creator><![CDATA[Gustavo Miguens]]></dc:creator>
            <pubDate>Fri, 20 Nov 2020 15:47:48 GMT</pubDate>
            <atom:updated>2020-12-17T14:12:01.974Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJtYwo_1x4LUEp7LjZLSXw.jpeg" /></figure><blockquote><strong>Una solución escalable, dinámica y potente para el responsive testing con Cypress.</strong></blockquote><p><a href="https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell">Cypress</a> es una herramienta <em>open source</em> de automatización de tests para aplicaciones web. Comúnmente asociada a <em>Selenium</em> es, en cuanto a sus fundamentos y arquitectura, completamente distinta. Con una extensa y detallada documentación, sumado a lo simple de su configuración inicial, hace olvidar antiguos dolores de cabeza a la hora de automatizar tests. Si algo separa a Cypress de otras herramientas de testing es que parece tener todo resuelto.</p><p><strong>El problema del responsive testing es que se presenta como una zona poco explorada y explotada:</strong> los ejemplos de la documentación se acercan más a una demo que a un proyecto real.</p><p>Otra cosa que me llamó la atención es que, buscando en la web, no encontré más que un <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">artículo</a> de <a href="https://medium.com/@sumn2u?source=post_page-----99a1c1294057--------------------------------">Suman Kunwar</a> (sobre el cual volveré a lo largo de este texto) que se acercó mucho a lo que yo tenía en mente.</p><p>Con este contexto acerco mi contribución, una mirada un poco más profundo y enfocada en aplicar el responsive testing en proyectos de mayor escala.</p><h3><strong>Algunas cuestiones que tuve en cuenta para pensar el problema</strong></h3><p>No puedo usar el enfoque de la <a href="https://docs.cypress.io/api/commands/viewport.html#Width-Height">documentación</a> de Cypress porque sugieren que en cada test se indique la resolución a usar (pueden ser N resoluciones en un <em>forEach</em> por test).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9v4a640IoVIKYxew" /></figure><p>Me imaginé varias suites de tests y la inviabilidad de este enfoque era evidente.</p><p>Si no quiero usar el <em>if</em> que figura en el ejemplo anterior tengo que usar: o siempre resoluciones con <em>value pairs</em> o los presets de Cypress (lo cual acota mucho las posibilidades).</p><p>¿Es viable que en cada corrida de la/s suite/s, cada test se ejecute en todas las resoluciones? ¿Qué pasa si necesito hacer una regresión de un bug sólo en una resolución? En esta cuestión, además, decidí que lo mejor sería tener una resolución default con la que testee todo el tiempo, y usar luego un set de N resoluciones para hacer pruebas integrales.</p><p>En escena también aparecen los <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent">userAgents</a>, de los cuáles nunca se habla en la documentación pero sí se mencionan en el <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">artículo</a> arriba citado. Como podrán observar en el artículo hay dos cosas importantes:</p><ol><li><strong>Las opciones que propone son <em>‘mobile’</em>,<em> ‘tablet’</em>, <em>‘desktop’</em>. </strong>Asocia una resolución (iPhone5) con un único userAgent. La pregunta es obvia: ¿siempre voy a querer testear iPhone5 con ese userAgent? ¿siempre voy a usar la resolución de un sólo dispositivo para testear mobile? ¿cada vez que necesite usar otro dispositivo voy a tener que editar esos valores? <strong>La cuestión siempre recae en que no es escalable</strong>.</li><li><strong>La solución parece algo estática; determino el tipo de dispositivo y sólo tengo una opción</strong>. Me imagino el movimiento normal de los proyectos, en los que las definiciones cambian con frecuencia, y veo que <strong>sería difícil que la solución se acople fácilmente a esos cambios</strong>.</li></ol><h3><strong>Entonces,</strong> ¿<strong>cómo logramos tener una solución <em>responsive</em> escalable?</strong></h3><p>Para eso vamos a utilizar la <a href="https://docs.cypress.io/guides/guides/module-api.html">API de Cypress</a> a través de un script.</p><p>Como en todas las cosas, esta propuesta no es más que eso: una propuesta. No pretende ser la solución última. Pero, luego de haberla puesto a prueba, creo se convirtió en <strong>un sólido punto de partida.</strong></p><p>Lo que hizo muy bien el <a href="https://medium.com/@sumn2u/testing-mobile-devices-using-cypress-99a1c1294057">artículo</a> citado previamente fue entender que el camino es tener una configuración default del <em>cypress.json,</em> y que ésta modifique algunos de sus <em>settings</em> según los parámetros que le indiquemos. <strong>Acá es donde nos diferenciamos y expandimos la solución</strong>. Quiero tener N resoluciones (es decir, <em>N</em> dispositivos disponibles para simular) y N <em>userAgents</em> (en otras palabras, <em>N</em> sistemas operativos simulados). Es más: quiero poder diferenciar iOS de Android. Quiero poder ofrecer corridas y regresiones cada vez más específicas: <em>iphone-X, iOS 13.3.1.</em></p><p><strong><em>Commands</em></strong></p><p>Lo que nos va a permitir el script será pasarle como parámetro <em>&lt;device&gt;</em> y <em>&lt;osVersion&gt; </em>y en el caso de ser necesario (por ejemplo, si corremos el script en <a href="https://docs.cypress.io/guides/guides/continuous-integration.html#Setting-up-CI">integración continua</a>) podemos pasar el parámetro <em>&lt;record&gt;</em> el cuál seteará la <em>record key</em> almacenada como variable de ambiente. También permite pasar el parámetro &lt;open&gt; para poder utilizar el <a href="https://docs.cypress.io/guides/core-concepts/test-runner.html">runner</a> de Cypress.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2421314197f001f11302a54a521653f1/href">https://medium.com/media/2421314197f001f11302a54a521653f1/href</a></iframe><p><strong><em>Hands on!</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b48b3fc0607cac9709d5b9f825ea6bbf/href">https://medium.com/media/b48b3fc0607cac9709d5b9f825ea6bbf/href</a></iframe><p>La lógica del script permite llegar siempre a la ejecución de las suites. Siempre que el parámetro <em>&lt;device&gt;</em> exista en el archivo devices.js, el script va a esperar que le pasemos el <em>&lt;osVersion&gt;</em> correspondiente a ese tipo de device (iOS &amp; Android). Por ejemplo, ingresamos: <strong><em>iphoneX</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ce9190428ff2f2b8bf9a352685fecbe/href">https://medium.com/media/9ce9190428ff2f2b8bf9a352685fecbe/href</a></iframe><p>Una vez que el device está definido, el script buscará dentro de los <em>osVersions</em> definidos en el archivo os.js que correspondan a los dispositivos iOS. Por ejemplo, ingresamos: “<strong><em>13.3.1”</em></strong></p><p><em>Si la versión ingresada no existiera en la lista, el script irá a buscar la versión default de ese OS.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11549dc494314353e7c2633f76473599/href">https://medium.com/media/11549dc494314353e7c2633f76473599/href</a></iframe><blockquote>node cy-start.js — -d iphoneX -osV 13.3.1 -o</blockquote><p>Desde el runner de Cypress podemos ver que tenemos disponibilizadas como variables de ambiente: <strong><em>device, osVersion, osType.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*aXV8bhhoYaTKpyrs7FHW_w.png" /></figure><p>Podemos aprovechar esas variables para usarlas en los nombres de las suites.</p><p>Al correr el script del ejemplo vamos a ver que los tests corrieron en la resolución y versión que especificamos</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbTjfWrYYTishDuewvDvng.png" /></figure><p>Por último, como ayuda, le disponibilizamos al usuario no sólo de qué formas puede ejecutar el script, sino también cuáles son los dispositivos y versiones que tiene disponibles.</p><p>El script completo <a href="https://gist.github.com/gusmiguens/01eb143a55ea1a41c607a432bcb6b317">acá</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbYLt-e0NPdbb55ZxfQcZQ.png" /></figure><h4>Conclusión</h4><p>Gracias a este enfoque, <strong>ahora somos capaces de testear funcionalidades o regresionar bugs en dispositivos y versiones específicas, pudiendo adaptarnos a cualquier combinación necesaria</strong>. También nos permite <strong>acortar los tiempos del testing diario</strong> utilizando versiones seteadas por default. La lógica del script permite agregar cuantas configuraciones y variaciones necesitemos para mejorar nuestros tests y que se adapten a nuestras necesidades de testing.</p><p><em>Conocé más sobre Flux IT: </em><a href="http://www.fluxitsoft.com/"><em>Website </em></a><em>· </em><a href="https://www.instagram.com/fluxitsoft/?source=post_page---------------------------"><em>Instagram</em></a><em> · </em><a href="https://www.linkedin.com/company/fluxit/?source=post_page---------------------------"><em>LinkedIn</em></a><em> · </em><a href="https://twitter.com/FluxITSoft?source=post_page---------------------------"><em>Twitter</em></a><em> · </em><a href="https://dribbble.com/fluxit?source=post_page---------------------------"><em>Dribbble</em></a><em> · </em><a href="https://fluxit.breezy.hr/"><em>Breezy</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e7ede888ba8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flux-it-thoughts/responsive-testing-cypress-6e7ede888ba8">Responsive testing &amp; Cypress</a> was originally published in <a href="https://medium.com/flux-it-thoughts">Flux IT Thoughts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>