{"id":20096,"date":"2020-07-16T22:35:04","date_gmt":"2020-07-16T22:35:04","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/?p=20096"},"modified":"2023-12-01T10:22:31","modified_gmt":"2023-12-01T18:22:31","slug":"modern-cross-browser-testing-cypress","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/","title":{"rendered":"Modern Cross Browser Testing with Cypress and Applitools"},"content":{"rendered":"\n<p>Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the look and styling of our app? How can we test that our application looks good visually? We can use Cypress to verify that it has the correct CSS properties but then our code would look very long and complex. It will be a guarantee that engineers will avoid maintaining this test ?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-visual-testing\"><strong>Visual Testing<\/strong><\/h3>\n\n\n\n<p>This is why we need visual testing as part of our test strategy. With visual testing, we are validating what the user sees on different browsers\/viewports\/mobile devices. However, it&#8217;s very time consuming when you do it manually.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"553\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1-1024x553.jpg\" alt=\"\" class=\"wp-image-20109\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1-1024x553.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1-300x162.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1-768x415.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1-1536x830.jpg 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image2-1.jpg 1870w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Imagine if someone told you that you have to test the below image manually.<\/p>\n\n\n\n<p>There are 30 differences. You can probably find them after quite some time. But then this provides a really slow feedback loop. The obvious solution would be of course to automate this!<\/p>\n\n\n\n<p>Now, automated visual testing is not new. There are so many tools out there which can help you with visual testing. These tools use pixel-by-pixel comparison to compare the two images. The idea is you have a baseline image which is your source of truth. Every time there is a code change and our automated tests are run, a test image will be taken. The visual testing tool will then compare this test image with the baseline image and then check the differences. At the end, it will report to us whether our test passed or failed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-problem-with-pixel-by-pixel-visual-testing\"><strong>Problem with pixel-by-pixel visual testing<\/strong><\/h3>\n\n\n\n<p>The problem with <a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/visual-testing\/\">pixel-by-pixel visual testing<\/a> though is it&#8217;s very sensitive even with small changes. Even if you have a 1px difference, your test will fail even though on the human eye, the two images look exactly similar.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image10-1024x513.jpg\" alt=\"\" class=\"wp-image-20101\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image10-1024x513.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image10-300x150.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image10-768x385.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image10.jpg 1528w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>You also get the issue that if you try to run these tests on your build pipelines, you might see a lot of pixel differences especially if the base image is generated locally such as the image above. Looking at this test image, if you ignore the mismatch image in the middle and compare the two images on left and the right, some of the changes that were reported look ok.&nbsp; But because these images were taken on different machine setups , the tool has reported a lot of pixel differences. You can use Docker to solve this and generate the base image using the same configuration as the test image, but from personal experience, I still get flakiness with using pixel-by-pixel comparison tools.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"261\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2-1024x261.jpg\" alt=\"\" class=\"wp-image-20110\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2-1024x261.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2-300x76.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2-768x196.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2-1536x391.jpg 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image1-2.jpg 1956w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Also, what if you have <a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/why-screenshot-image-comparison-tools-fail\/\">dynamic data<\/a>? In the test image above, we have a change of data here but the overall layout is similar. You can probably set the mismatch threshold to be slightly higher so your tests will fail only if they reach the threshold that you defined. The problem with this though is that you might miss actual visual bugs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cross-browser-visual-validation\"><strong>Cross Browser Visual Validation<\/strong><\/h3>\n\n\n\n<p>Most of the existing open source tools for visual testing only runs on 1 or 2 browsers.&nbsp; For example, one of the tools that we were using before, called BackstopJS,&nbsp; which is a popular visual testing framework, only runs visual tests on Chrome headlessly.&nbsp; AyeSpy, which is a tool that was actually created by one of the teams here at News UK, is another visual testing tool, which hooks into your Selenium Grid to run your visual tests on different browsers. But still, it&#8217;s a bit limited. If you are using the Selenium Docker images, they only have images for Chrome and Firefox. What if you want to run your visual tests on Safari or Internet Explorer?&nbsp; You can definitely verify this yourself, but again as mentioned, it&#8217;s time consuming.<\/p>\n\n\n\n<p>How can we solve these different visual testing issues?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-applitools\"><strong>Applitools<\/strong><\/h3>\n\n\n\n<p>This is where Applitools comes in. Unlike existing visual tools, Applitools uses AI comparison algorithms so images are compared just like a human would. It was founded in 2013 and pretty much integrates with almost all testing frameworks out there. You name it &#8211; <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/selenium-javascript.html\">Selenium<\/a>, <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/cypress.html\">Cypress<\/a>, <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/appium-native-javascript.html\">Appium<\/a>, <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/webdriverio5.html\">WebdriverIO<\/a>, <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/espresso.html\">Espresso<\/a>, <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/xcui-swift.html\">XCUITest<\/a>, even <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/storybook-react.html\">Storybook<\/a>! With Applitools, you can validate visual differences on a wide range of browsers and viewports. By using different comparison algorithms (exact, strict, layout and content), you have different options to compare images and can cater different scenarios such as dynamic data or animations.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5-1024x583.jpg\" alt=\"\" class=\"wp-image-20106\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5-1024x583.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5-300x171.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5-768x437.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5-1536x875.jpg 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image5.jpg 1784w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Rather than taking a screenshot, Applitools will extract a snapshot of your DOM. This is one of the reasons why visual tests are fast to run in Applitools. Once the DOM snapshots have been uploaded to the Applitools Cloud, the <a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/next-generation-cross-browser-testing\/\">Applitools Ultrafast Grid<\/a>, which offers users a way to render screens in multiple browsers and viewports simultaneously to generate the screenshots and do the AI powered image comparison.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-getting-started\"><strong>Getting Started<\/strong><\/h3>\n\n\n\n<p>To get you started, you need to install the following package to your project. This is specific to Cypress so you would need to install the correct package depending on your test framework of choice.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm i --D @applitools\/eyes-cypress<\/pre>\n\n\n\n<p>Once this has been installed, you need to configure the plugin and the easiest way to do this is to run the following command on your terminal<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npx eyes-setup<\/pre>\n\n\n\n<p>This will automatically add the necessary imports needed to get Applitools working in your Cypress project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-writing-our-first-test-with-just-cypress\"><strong>Writing our first test with just Cypress<\/strong><\/h3>\n\n\n\n<p>Let&#8217;s start doing some coding and add some validations on a sample react image app that I created a while back. It is a simple image gallery which uses unsplash API for the backend. An example github repo which contains the different code examples can be found<a href=\"https:\/\/github.com\/mdcruz\/react-sample-apps\/tree\/master\/image-search\"> here<\/a><em>.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"916\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2023\/12\/modern_cross_browser_image_gallery.gif\" alt=\"\" class=\"wp-image-53301\" style=\"width:1021px;height:auto\"\/><\/figure>\n\n\n\n<p>Our Cypress test can look like the following code snippet. Keep in mind, this only asserts the application to some extent. I can add more code to verify that it has the correct CSS attributes but I don&#8217;t want to make the code too lengthy.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12-1024x487.png\" alt=\"\" class=\"wp-image-20099\" style=\"width:1203px;height:572px\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12-1024x487.png 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12-300x143.png 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12-768x365.png 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12-1536x731.png 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image12.png 1766w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-writing-our-first-test-with-cypress-and-applitools\"><strong>Writing our first test with Cypress and Applitools<\/strong><\/h3>\n\n\n\n<p>Now, let&#8217;s look at how we can write the test using Cypress and Applitools.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"697\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image6-1-1024x697.png\" alt=\"\" class=\"wp-image-20105\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image6-1-1024x697.png 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image6-1-300x204.png 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image6-1-768x522.png 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image6-1.png 1076w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Applitools provides the following commands to Cypress as a minimum setup. `<em>cy.eyesOpen<\/em>` initiates the Cypress eyes SDK and we pass some arguments such as our app name, batch name and the browser size (defaults to Chrome). The command `<em>cy.eyesCheckWindow<\/em>` will take a DOM snapshot so every call to this command means a DOM snapshot will be generated. You can call this every time you do an action such as visiting your page under test or clicking buttons, and dropdown menus. Finally, once you are finished, you just call `<em>cy.eyesClose<\/em>`. To know more about the Cypress eyes SDK, please visit their documentation<a href=\"https:\/\/github.com\/applitools\/eyes.sdk.javascript1\/tree\/master\/packages\/eyes-cypress\"> here<\/a> to find more information.<\/p>\n\n\n\n<p>In order to run this in Applitools, you need to export an API key which is detailed on this<a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/topics\/overview\/obtain-api-key.html\"> article<\/a>. Once you have the API key, on your terminal you need to run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export APPLITOOLS_API_KEY=&lt;your_key&gt;<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">npx cypress open<\/pre>\n\n\n\n<p>Once the test is finished, if you go to the Applitools dashboard, you should see your test being run. The first time you run it, there will be no baseline image then when you reran the test and everything looks good, you should see the following.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4-1024x505.png\" alt=\"\" class=\"wp-image-20107\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4-1024x505.png 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4-300x148.png 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4-768x379.png 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4-1536x758.png 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image4.png 1999w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-handling-dynamic-data\"><strong>Handling Dynamic Data<\/strong><\/h3>\n\n\n\n<p>Since we are using the unsplash API, we don&#8217;t have control as to what data gets returned. When we refresh the app, we might get different results. As an example, the request that I am making to unsplash will get the popular photos on a given day. If I reran my test again tomorrow, then the images will be different like the one shown below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13-1024x503.png\" alt=\"\" class=\"wp-image-20098\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13-1024x503.png 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13-300x147.png 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13-768x377.png 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13-1536x755.png 1536w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image13.png 1999w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>The good thing is we can apply a layout region so the actual data will be ignored or we can also set the match level as Layout in our test which we can preview on the dashboard. If the layout of our image gallery has changed, Applitools will report it as an issue.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"781\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2023\/12\/modern_cross_browser_dashboard.gif\" alt=\"\" class=\"wp-image-53303\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-making-code-changes-to-our-application\"><strong>Making code changes to our application<\/strong><\/h3>\n\n\n\n<p>Now, let&#8217;s create some changes in our application (code references found<a href=\"https:\/\/github.com\/mdcruz\/react-sample-apps\/tree\/feat\/new-app-changes\"> here<\/a>) and introduce the following:<\/p>\n\n\n\n<ul>\n<li>Update the background colour of the search bar (bug)<\/li>\n\n\n\n<li>Add a new footer component (new feature)<\/li>\n\n\n\n<li>Remove camera icon on the subtitle (bug)<\/li>\n<\/ul>\n\n\n\n<p>If we run the test where we only use Cypress, how many of these changes do you think your test will catch? Will it catch that there is a new footer component? How about updating the background colour of the search bar? How about the missing header icon? Probably not because we didn&#8217;t write any assertions for it. Now, let&#8217;s rerun the test written in Cypress and Applitools.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"777\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2023\/12\/modern_cross_browser_dashboard2.gif\" alt=\"\" class=\"wp-image-53304\"\/><\/figure>\n\n\n\n<p>Looking at the image above, it caught all the changes and we didn&#8217;t had to update our test since all the maintenance is done on the Applitools side. Any issues can be raised directly on the dashboard and you can also configure it to integrate to your JIRA projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cross-browser-visual-validation-0\"><strong>Cross Browser Visual Validation<\/strong><\/h3>\n\n\n\n<p>To run the same test on different browsers, you just need to specify the browser options on your Applitools configuration. I&#8217;ve refactored the code a bit and created a file called `<em>applitools.config.js`<\/em> and moved some of the setup we added initially in our `<em>cy.eyesOpen` <\/em>in this class.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"698\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image8-1-1024x698.png\" alt=\"\" class=\"wp-image-20103\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image8-1-1024x698.png 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image8-1-300x205.png 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image8-1-768x524.png 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image8-1.png 1126w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Just simply reran your test and check the results in the Applitools dashboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-final-thoughts\"><strong>Final Thoughts<\/strong><\/h3>\n\n\n\n<p>This is just an introductory post on how you can use Applitools so if you want to know more about its other features, check out the following resources:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=sbVOXvkqM90\">Applitools Master Class Webinar<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/common\/cmn-eyes-match-levels.html\">Applying Match Levels<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/topics\/test-manager\/viewers\/tm-viewer-step-editor.html#Add2\">Applying Match Regions<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/testautomationu.applitools.com\/\">Test Automation University &#8211; different courses on using Applitools with other frameworks<\/a><\/li>\n<\/ul>\n\n\n\n<p>While open source pixel by pixel comparison tools can help you get started with visual testing, using Applitools can modernize the way you do testing. As always, do a thorough analysis of a tool to see if it will meet your testing needs ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the look and&#8230;<\/p>\n","protected":false},"author":58,"featured_media":20104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10004],"tags":[10021,10050,10215,10357,15625,10139,10268,12688,12690,11051,10847],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Modern Cross Browser Testing with Cypress and Applitools - AI-Powered End-to-End Testing | Applitools<\/title>\n<meta name=\"description\" content=\"Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the look and...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modern Cross Browser Testing with Cypress and Applitools\" \/>\n<meta property=\"og:description\" content=\"Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-16T22:35:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T18:22:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1999\" \/>\n\t<meta property=\"og:image:height\" content=\"1334\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Marie Drake\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marie Drake\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\"},\"author\":{\"name\":\"Marie Drake\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/5a20d66cd26dd8249646d38e94caa8f7\"},\"headline\":\"Modern Cross Browser Testing with Cypress and Applitools\",\"datePublished\":\"2020-07-16T22:35:04+00:00\",\"dateModified\":\"2023-12-01T18:22:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\"},\"wordCount\":1656,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg\",\"keywords\":[\"Appium\",\"Cross-browser Testing\",\"Cross-device Testing\",\"Cypress\",\"Espresso\",\"Selenium\",\"StoryBook\",\"Technical Leaders\",\"Test Engineers\",\"Ultrafast Grid\",\"WebdriverIO\"],\"articleSection\":[\"Advanced Topics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\",\"name\":\"Modern Cross Browser Testing with Cypress and Applitools - AI-Powered End-to-End Testing | Applitools\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg\",\"datePublished\":\"2020-07-16T22:35:04+00:00\",\"dateModified\":\"2023-12-01T18:22:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg\",\"width\":1999,\"height\":1334},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Modern Cross Browser Testing with Cypress and Applitools\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"name\":\"Applitools Visual AI\",\"description\":\"Applitools delivers full end-to-end test automation with AI infused at every step.\",\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\",\"name\":\"Applitools\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"width\":156,\"height\":28,\"caption\":\"Applitools\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/5a20d66cd26dd8249646d38e94caa8f7\",\"name\":\"Marie Drake\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dbae10ab527d52f0f872aad10b9466a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dbae10ab527d52f0f872aad10b9466a0?s=96&d=mm&r=g\",\"caption\":\"Marie Drake\"},\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/mariedrake\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Modern Cross Browser Testing with Cypress and Applitools - AI-Powered End-to-End Testing | Applitools","description":"Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the look and...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/","og_locale":"en_US","og_type":"article","og_title":"Modern Cross Browser Testing with Cypress and Applitools","og_description":"Cypress, among other things, validates the structure of your DOM. It verifies that a button is visible or that it has the correct text. But what about the","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2020-07-16T22:35:04+00:00","article_modified_time":"2023-12-01T18:22:31+00:00","og_image":[{"width":1999,"height":1334,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg","type":"image\/jpeg"}],"author":"Marie Drake","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marie Drake","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/"},"author":{"name":"Marie Drake","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/5a20d66cd26dd8249646d38e94caa8f7"},"headline":"Modern Cross Browser Testing with Cypress and Applitools","datePublished":"2020-07-16T22:35:04+00:00","dateModified":"2023-12-01T18:22:31+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/"},"wordCount":1656,"commentCount":0,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg","keywords":["Appium","Cross-browser Testing","Cross-device Testing","Cypress","Espresso","Selenium","StoryBook","Technical Leaders","Test Engineers","Ultrafast Grid","WebdriverIO"],"articleSection":["Advanced Topics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/","name":"Modern Cross Browser Testing with Cypress and Applitools - AI-Powered End-to-End Testing | Applitools","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg","datePublished":"2020-07-16T22:35:04+00:00","dateModified":"2023-12-01T18:22:31+00:00","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/07\/image7.jpg","width":1999,"height":1334},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/modern-cross-browser-testing-cypress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Advanced Topics","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/"},{"@type":"ListItem","position":3,"name":"Modern Cross Browser Testing with Cypress and Applitools"}]},{"@type":"WebSite","@id":"https:\/\/app14743.cloudwayssites.com\/#website","url":"https:\/\/app14743.cloudwayssites.com\/","name":"Applitools Visual AI","description":"Applitools delivers full end-to-end test automation with AI infused at every step.","publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/app14743.cloudwayssites.com\/#organization","name":"Applitools","url":"https:\/\/app14743.cloudwayssites.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","width":156,"height":28,"caption":"Applitools"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/5a20d66cd26dd8249646d38e94caa8f7","name":"Marie Drake","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dbae10ab527d52f0f872aad10b9466a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dbae10ab527d52f0f872aad10b9466a0?s=96&d=mm&r=g","caption":"Marie Drake"},"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/mariedrake\/"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/20096"}],"collection":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=20096"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/20096\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/20104"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=20096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=20096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=20096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}