{"id":16794,"date":"2019-12-11T23:24:00","date_gmt":"2019-12-11T23:24:00","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/blog\/?p=6794"},"modified":"2020-08-26T18:31:35","modified_gmt":"2020-08-26T18:31:35","slug":"cypress-cross-browser-testing","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/","title":{"rendered":"Cross-browser Testing With Cypress.io"},"content":{"rendered":"<p><a href=\"https:\/\/www.cypress.io\/\">Cypress.io<\/a> lets you test user interface design directly in the browser. But, Cypress only runs with <a href=\"https:\/\/www.google.com\/chrome\/\">Chrome<\/a>. How do you do Cypress cross-browser testing?<\/p>\n<p>Visual testing and cross-browser testing go hand-in-hand. With this tag team, your power to create superior, consistent, and pleasing Graphical User Interfaces (GUI) for your applications across a wide array of devices, and browsers, will seem like child&#8217;s play!<\/p>\n<p>The huge wave of devices, operating systems, browsers, and screen resolutions flooding the market make Visual and cross-browser testing an essential constituent of any software development life-cycle. This ensures the stability of your UX designs across all of these devices.<!--more--><\/p>\n<p>Two leading tools in the field of software testing are Cypress.io and Applitools. Cypress.io is an open-source framework best known for its tools that help developers write integration and End-to-End (E2E) testing. Applitools, on the other hand, integrates with Cypress.io, giving testers, and developers, a chance to upgrade their test scripts into Visual ones.<\/p>\n<p>While Cypress.io lacks support for cross-browser testing, Applitools supports it via their <a href=\"https:\/\/app14743.cloudwayssites.com\/ultrafast-grid?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=&amp;utm_campaign=blog-evergreen-campaign&amp;utm_subgroup=\">Applitools Ultrafast Grid.<\/a><\/p>\n<p>You can combine the best of both worlds by using Cypress.io to write your integration and E2E tests and letting Applitools Ultrafast Grid handle cross-browser testing for you.<\/p>\n<p>My goal, in this article, is to take you through a step-by-step guide that will include:<\/p>\n<ol>\n<li>Writing a Cypress.io E2E test.<\/li>\n<li>Running the E2E test locally using Google Chrome.<\/li>\n<li>Converting the E2E test into a Visual test using <a href=\"https:\/\/github.com\/applitools\/eyes-cypress?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\" target=\"_blank\" rel=\"noopener noreferrer\">Applitools Eyes Cypress SDK<\/a>.<\/li>\n<li>Running the Visual test across multiple browsers via the&nbsp;Applitools Ultrafast Grid.<\/li>\n<\/ol>\n<p>Let\u2019s start!<\/p>\n<h2 id=\"h.atbxnhm303hm\">Welcome to Cypress.io<\/h2>\n<p>Cypress.io gives you a complete end-to-end testing experience by providing you with the right tools to set up your testing environment locally, write E2E tests, run the tests, and record them. It has been written from the ground-up without any dependency on other tools like Selenium.<\/p>\n<p>To learn and use Cypress.io, I suggest watching the course <a href=\"https:\/\/testautomationu.applitools.com\/cypress-tutorial\/?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">Introduction to Cypress<\/a>&nbsp;by Gil Tayar as he covers all the necessary information you need to get started using Cypress.io.<\/p>\n<h3 id=\"h.gu22jhuypf94\">Show me an E2E test<\/h3>\n<p>I won\u2019t keep you waiting any longer. Here\u2019s a sample E2E test I wrote in Cypress.io:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/aa0b9b21e04be5f96f65f49c79d34773.js?file=compare-spec.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/aa0b9b21e04be5f96f65f49c79d34773\">Gist<\/a>.<\/noscript><\/div>\n<p>The sample E2E test script above starts by:<\/p>\n<ol>\n<li>Navigating to the root page of the application.<\/li>\n<li>Selecting two product items displayed on the page.<\/li>\n<li>Verifying the two items selected are the ones displayed in the comparison section at the bottom of the page.<\/li>\n<\/ol>\n<p><img alt=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6786 aligncenter\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0.png\" alt=\"\" width=\"1030\" height=\"975\"><\/p>\n<p>In the demo section below, I will delve into more detail on installing Cypress.io, setting it up for your projects, writing E2E tests, and much more. Stay tuned!<\/p>\n<h2 id=\"h.tibyohachhkr\">Oh, Cypress.io only works with Google Chrome!?!<\/h2>\n<p>Writing automated E2E tests with Cypress.io is fun and easy. Cypress.io has been gaining momentum in the software testing field due to its solid architecture, well-designed API and rich documentation just to name a few.<\/p>\n<p>Cypress.io allows testers and developers to write E2E tests that run locally on the Google Chrome browser only. There has been debate, and requests from developers in&nbsp;general, to have this extend to other browsers as well. The Cypress.io team has listened, and are in the process of doing so.<\/p>\n<p>You can follow the discussion on this GitHub Issue, <a href=\"https:\/\/github.com\/cypress-io\/cypress\/issues\/310\" target=\"_blank\" rel=\"noopener noreferrer\">Proposal: Support for Cross Browser Testing<\/a>, for more information, and to stay up-to-date with the roadmap to support this. However, for now, you can only run your E2E tests locally with Google Chrome.<\/p>\n<p>Is there a solution? Yes!<\/p>\n<p>You can use Applitools\u2019s Ultrafast Grid system to run Cypress.io E2E tests against multiple browsers and guarantee a cross-browser testing result.<\/p>\n<p>Locally, you will be running your tests on Google Chrome while Applitools Ultrafast Grid will handle setting up the cross-browser environment to run your tests against multiple browsers.<\/p>\n<p>Let\u2019s see how it works!<\/p>\n<h2 id=\"h.jqr613ag2al6\">Applitools to complement Cypress.io<\/h2>\n<p>Applitools offers a test framework to automate Visual testing of your application. It focuses on the visual aspects of your app and plays a major role in exposing the visual differences between <a href=\"https:\/\/help.applitools.com\/hc\/en-us\/articles\/360007188691-What-is-a-baseline-and-how-is-a-baseline-created-?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=documentation-page&amp;utm_campaign=&amp;utm_subgroup=\">baseline snapshots<\/a>&nbsp;and both current and future snapshots.<\/p>\n<p>Applitools integrates with <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=tutorial&amp;utm_campaign=blog-react-cypress&amp;utm_subgroup=\">dozens of testing frameworks<\/a>, such as <a href=\"https:\/\/www.cypress.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">Cypress.io<\/a>, <a href=\"https:\/\/storybook.js.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Storybook<\/a>,&nbsp;and <a href=\"https:\/\/www.seleniumhq.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Selenium<\/a>. It provides SDKs for use in your projects to seamlessly communicate, and interact with Applitools.<\/p>\n<p>The Applitools Ultrafast Grid runs your Visual tests quickly and supports a variety of configuration settings, such as multiple browsers, viewports, and devices. The Applitools Ultrafast Grid is split into two components: server-side and client-side. Here\u2019s a diagram of how it works:<\/p>\n<p><img decoding=\"async\" class=\"wp-image-6793 aligncenter\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-7.png\" alt=\"pasted image 0 7\"><\/p>\n<h3>Applitools Ultrafast Grid &#8211; Setup Code<\/h3>\n<p>The Ultrafast Grid client is a Node.js library, used internally by both Applitools, Storybook and Cypress SDKs. Here\u2019s more on the <a href=\"https:\/\/github.com\/applitools\/visual-grid-client\" target=\"_blank\" rel=\"noopener noreferrer\">Applitools Ultrafast Grid client<\/a>.<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/753b282427ab1a894d2d9f99f29a7adc.js?file=visual-grid-client.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/753b282427ab1a894d2d9f99f29a7adc\">Gist<\/a>.<\/noscript><\/div>\n<p>That code snippet instantiates a new Grid client and returns an object. In this case, we are only interested in the openEyes() method returned.<\/p>\n<h3>Applitools Ultrafast Grid &#8211; Snapshot Capture<\/h3>\n<p>When called, the openEyes() method starts a new test run and sends the Grid backend server details about it. These details include the application name, batch or test name, the browsers used, and different variations of browser settings to be adapted while running the tests. This method returns a Promise to an object with the following functions: checkWindow() and close().<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/37e90b0c5e58acd709268128635d1167.js?file=open.eyes\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/37e90b0c5e58acd709268128635d1167\">Gist<\/a>.<\/noscript><\/div>\n<p>This method call instructs the Ultrafast Grid backend server to prepare a testing environment for a new test run that requires running the test over two different browsers. The first browser emulates an iPhone X, while the second specifies the desktop viewport to run the test.<\/p>\n<p>To start collecting snapshots, the test issues a call to checkWindow() function. The Ultrafast Grid client handles this call and collects all the needed resources to store the snapshot locally.<\/p>\n<p>At the end of the test, you issue a call to close() method to close and finish the test run.<\/p>\n<h3>Applitools Ultrafast Grid &#8211; Grid Tests<\/h3>\n<p>At this moment, all the DOM Snapshots collected locally during the test run are sent to the Ultrafast Grid backend server. Based on the test run requirements, sent previously with the openEyes() method, the Ultrafast Grid:<\/p>\n<ul>\n<li>Launches a number of browsers with different viewports and device emulators.<\/li>\n<li>Runs all of the DOM snapshots in parallel.<\/li>\n<li>Collects image screenshots.<\/li>\n<li>Sends all the screenshots to the Applitools AI server to do all the testing analysis and to return the results.<\/li>\n<\/ul>\n<p>We will focus on the power of the Applitools Ultrafast Grid, to set up a testing environment in the cloud that allows running Visual tests against multiple browsers and resolutions.<\/p>\n<p>Before I go further into writing and running Visual\/E2E tests with Applitools Ultrafast Grid, let\u2019s have a look at how Applitools integrates itself into Cypress.io.<\/p>\n<h3 id=\"h.8m5xr6yo3veg\">Applitools\/Cypress.io Integration<\/h3>\n<p>Applitools integrates with Cypress.io, and offers a general-purpose library that can be embedded within your project, whether it be the Angular, Vue, or React app.<\/p>\n<p>The <a href=\"https:\/\/github.com\/applitools\/eyes-cypress\" target=\"_blank\" rel=\"noopener noreferrer\">Applitools Eyes Cypress SDK<\/a>&nbsp;is a simple plugin to Cypress.io. Once installed, it adds a few commands to the main cy object. Specifically, it adds three main methods: cy.eyesOpen to start the test, cy.eyesCheckWindow to take screenshots (for each test step) and cy.eyesClose to close the test. Here\u2019s a diagram:<\/p>\n<p><img decoding=\"async\" class=\"wp-image-6789 aligncenter\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-3.png\" alt=\"pasted image 0 3\"><\/p>\n<p>Now that you understand how the Applitools\/Cypress.io integration works, let\u2019s switch gears and start coding an E2E test.<\/p>\n<h2 id=\"h.pzp7tfk4u5ub\">Cross-browser testing step by step guide<\/h2>\n<p>Let\u2019s get our hands dirty and build some E2E tests. In this section you will learn how to:<\/p>\n<ul>\n<li>Install Cypress.<\/li>\n<li>Write an E2E test.<\/li>\n<li>Run the test.<\/li>\n<li>Install Applitools Eyes Cypress SDK.<\/li>\n<li>Write a Visual test.<\/li>\n<li>Run that test.<\/li>\n<li>Finally, do an analysis on the test results.<\/li>\n<\/ul>\n<p>The E2E test I will be using for demonstration runs against one of the Applitools customers, <a href=\"https:\/\/www.salesforce.com\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.salesforce.com<\/a>. The test does the following:<\/p>\n<ul>\n<li>Navigates the browser to SalesForce contact form located at: <a href=\"https:\/\/www.salesforce.com\/uk\/form\/contact\/contactme\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.salesforce.com\/uk\/form\/contact\/contactme\/<\/a><\/li>\n<li>Fills the form fields with valid data.<\/li>\n<li>Locates the Submit button and clicks it.<\/li>\n<li>Finally, the test script verifies that the form has been successfully submitted by making sure the page displays a success message coming from the server.<\/li>\n<\/ul>\n<p>Let\u2019s start!<\/p>\n<h3 id=\"h.kotgbuk7lo5a\">Create a new project folder<\/h3>\n<p>Start by creating a new folder by running these commands:<\/p>\n<pre>```\n\nmkdir projects\n\ncd projects\n\nmkdir cross-browser-testing\n\ncd cross-browser-testing\n\n```<\/pre>\n<p>Now that you are inside the cross-browser-testing folder, run the following command to initialize NPM:<\/p>\n<pre>```\n\nnpm init -y\n\n```\n\nThe command initializes your project with a package.json file. Now you can start installing NPM packages to use inside your project.<\/pre>\n<h3 id=\"h.d414i5ndoh2k\">Install Cypress.io<\/h3>\n<p>Add Cypress package to the project by running this command:<\/p>\n<pre>```\n\nnpm install cypress --save-dev\n\n```<\/pre>\n<p>The Cypress npm package adds a set of test files to help you write your own automated tests.<\/p>\n<p>Open the Cypress Test Runner (Electron app) by issuing:<\/p>\n<pre>```\n\nnpx cypress open\n\n```<\/pre>\n<p>This command opens the Cypress Electron app and also creates a cypress.json file and a cypress folder in your app\u2019s root directory. The cypress folder is where we will be writing our tests.<\/p>\n<p><img alt=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6790 aligncenter\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-4.png\" alt=\"\" width=\"1600\" height=\"1161\"><\/p>\n<p>To simplify our E2E tests, open the cypress.json file located at the root of your project and paste the following content:<\/p>\n<pre>```\n\n{\n\n\"baseUrl\": \"https:\/\/www.salesforce.com\/uk\"\n\n}\n\n```<\/pre>\n<p>Now that&nbsp;Cypress.io is running properly, let\u2019s add our first E2E test.<\/p>\n<h3 id=\"h.jifnz5xhj1zy\">Write your first E2E test<\/h3>\n<p>Inside the cypress\\integration folder, create the salesforce-contactus.spec.js file, and paste the following:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/1b37440906a6a9e9a7b80e054e88be32.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/1b37440906a6a9e9a7b80e054e88be32\">Gist<\/a>.<\/noscript><\/div>\n<p>The single E2E test focuses on testing the contact us form by filling its fields on the SalesForce website.<\/p>\n<p>The spec file is self-explanatory. There\u2019s just one thing to note here in relation to the selectors used inside cy.get() methods. The best practice is to avoid using IDs and CSS classes to select elements from the DOM. They will make your tests brittle because they\u2019re subject to change. A better approach is to use data-* attributes, or actual component names.<\/p>\n<p>In a controlled environment, I would stick to using data attributes. For now, we will keep on using the ID and Class CSS selectors for querying for DOM elements.<\/p>\n<h3 id=\"h.9bkr5dz5f4pr\">Run the test<\/h3>\n<p>The E2E test is ready, so let\u2019s run it by issuing the following command:<\/p>\n<pre>```\n\nnpx cypress open\n\n```<\/pre>\n<p>Cypress.io opens an instance of the Google Chrome browser to run your tests. Now, to run the same test against other browsers, we have to convert this E2E test into a Visual test and run it with Applitools Ultrafast Grid.<\/p>\n<p>Let\u2019s see how it works.<\/p>\n<h3 id=\"h.9ggx4d12le4d\">Install Applitools Eyes Cypress SDK<\/h3>\n<p>Let\u2019s add the <a href=\"https:\/\/www.npmjs.com\/package\/@applitools\/eyes-cypress\" target=\"_blank\" rel=\"noopener noreferrer\">Applitools Cypress NPM<\/a>&nbsp;package to the project.<\/p>\n<p>Add the Applitools Eyes Cypress SDK package to the project by issuing the following command:<\/p>\n<pre>```\n\nnpm install @applitools\/eyes-cypress --save-dev\n\n```<\/pre>\n<p>Configure the Applitools Eyes Cypress SDK by issuing the command:<\/p>\n<pre>```\n\nnpx eyes-setup\n\n```\n\nNow that Applitools Eyes Cypress&nbsp;SDK is configured, we can start using it in our tests.<\/pre>\n<p>The Applitools Eyes Cypress&nbsp;SDK page has thorough documentation on how to use and customize the Applitools-Cypress integration, and how to configure the SDK to run tests against the Ultrafast Grid.<\/p>\n<p>For this article, we will focus on how we can instruct the Visual Grid to run our test against multiple browsers and resolutions.<\/p>\n<p>In general, there are three ways to specify test configuration:<\/p>\n<ol>\n<li>Arguments to cy.eyesOpen().<\/li>\n<li>Environment variables.<\/li>\n<li>The applitools.config.js file.<\/li>\n<\/ol>\n<p>You can read more about each method under the <a href=\"https:\/\/www.npmjs.com\/package\/@applitools\/eyes-cypress#advanced-configuration\" target=\"_blank\" rel=\"noopener noreferrer\">Advanced Configuration<\/a>&nbsp;section.<\/p>\n<p>I will make use of the first method, and supply a list of browsers and screen resolutions as arguments to the cy.eyesOpen() function.<\/p>\n<h3 id=\"h.ts4beq64e0z7\">Configure Applitools API Key<\/h3>\n<p>Before you can locally run Applitools Eyes Cypress SDK, make sure you get an <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials\/storybook-angular.html#how-it-works?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=tutorial&amp;utm_campaign=&amp;utm_subgroup=\">Applitools API Key<\/a>&nbsp;and store it on your machine as an environment variable.<\/p>\n<p>To set the APPLITOOLS_API_KEY environment variable, you can use the export command on Mac, or set command on Windows as follows:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/0b56806977ea420f54be071c8057bec3.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/0b56806977ea420f54be071c8057bec3\">Gist<\/a>.<\/noscript><\/div>\n<h3 id=\"h.g82jjns7akvl\">Write your first Visual test<\/h3>\n<p>Now that you have the E2E test running, let\u2019s convert this E2E test into a Visual test using Applitools Eyes Cypress SDK.<\/p>\n<p>Revisit the cypress\\integration\\salesforce-contactus.spec.js file, and replace its content with:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/2d0945e98f54d15d5ab547e0fd8e884a.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/2d0945e98f54d15d5ab547e0fd8e884a\">Gist<\/a>.<\/noscript><\/div>\n<p>The code is self-documented.<\/p>\n<p>Inside the beforeEach() test function, you start a new Visual test by calling the cy.eyesOpen({})&nbsp;function that accepts a configuration object as input. You can specify the app name, batch name, browsers you want the Ultrafast Grid&nbsp;to use in order to run your tests, and many other configuration options available to you, on <a href=\"https:\/\/www.npmjs.com\/package\/@applitools\/eyes-cypress\" target=\"_blank\" rel=\"noopener noreferrer\">Applitools Eyes Cypress SDK page<\/a>.<\/p>\n<p>Close the current Applitools test by calling the cy.eyesClose() function inside the afterEach() test function.<\/p>\n<p>Take a snapshot (You may repeat this step wherever you want to take a snapshot) by calling the cy.eyesCheckWindow() function. This function can take a snapshot name in case you want to distinguish snapshots from each other.<\/p>\n<p>The test takes three snapshots at three different stages:<\/p>\n<ul>\n<li>The blank SalesForce Contact Us page.<\/li>\n<li>Once the SalesForce Contact Us form filled.<\/li>\n<li>On the success confirmation page after submitting the Contact Us form.<\/li>\n<\/ul>\n<p>Let\u2019s run the test, and verify the results together.<\/p>\n<h3 id=\"h.qk44k28xoxf0\">Run the test<\/h3>\n<p>The Visual test is ready. Let\u2019s run it by issuing the command:<\/p>\n<p>&#8220;`<\/p>\n<p>npx cypress open<\/p>\n<p>&#8220;`<\/p>\n<p>The Eyes Cypress SDK are all logged.<\/p>\n<p>Let\u2019s review the test results on the Applitools Test Manager.<\/p>\n<h3 id=\"h.sfbt077m1lp7\">Verify Test Results<\/h3>\n<p>Let\u2019s visit the Applitools Test Manager, and verify the results.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-6792\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-6.png\" alt=\"pasted image 0 6\"><\/p>\n<p>On the left-side panel, there is a single test run named \u201cfill the contact us form\u201d. On the right-side panel, there are three test results- one for each \u201cbrowser\u201d. Remember, we\u2019ve configured the Eyes SDK to run this Visual test across three different browsers\/screen-resolutions:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/bhaidar\/abf465827c0bdc5bf5ac11409638f13e.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/bhaidar\/abf465827c0bdc5bf5ac11409638f13e\">Gist<\/a>.<\/noscript><\/div>\n<p>For each browser specified, the Grid spins a new instance of the browser and runs the test. This explains why we have three test results.<\/p>\n<p>Applitools Ultrafast Grid takes the burden off your shoulders and establishes a cross-browser testing infrastructure in the cloud.<\/p>\n<p>Each and every test result holds three snapshots. Let\u2019s explore the snapshots for a single browser test result:<\/p>\n<p>The first snapshot represents the form under test shown with empty fields.<\/p>\n<p><img alt=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6788\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-2.png\" alt=\"\" width=\"1600\" height=\"1110\"><\/p>\n<p>The second snapshot represents the form under test shown with all fields filled.<\/p>\n<p><img alt=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6787\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-1.png\" alt=\"\" width=\"1600\" height=\"1110\"><\/p>\n<p>The third snapshot represents the message shown to the user upon filling the \u201cContact us\u201d form.<\/p>\n<p><img alt=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6791\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/pasted-image-0-5.png\" alt=\"\" width=\"1600\" height=\"1110\"><\/p>\n<p>Using Applitools SDKs and Ultrafast Grid, we were able to run a single E2E test, written in Cypress.io, in a cross-browser\/device testing environment!<\/p>\n<h2 id=\"h.z98z79ts83ot\">Conclusion<\/h2>\n<p>Applitools, being a Visual Testing framework, fills the gap of E2E testing frameworks like Cypress.io by offering cross-browser testing. Its UltrafastGrid can set up a cross-browser testing environment in the cloud and can run your tests there.<\/p>\n<h2 id=\"h.axs3ft86gbwd\">Other Related Content<\/h2>\n<ul>\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/cross-browser-testing-cypress?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">How Cross-Browser Testing Is Evolving<\/a><\/li>\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/angular-cypress-visual-testing?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">Angular and Cypress UI Testing with Applitools<\/a><\/li>\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/test-vuejs-cypress-io-applitools?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">How to visually test VueJS apps using Cypress.io and Applitools [step-by-step tutorial]<\/a><\/li>\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/react-cypress-visual-testing?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">React, Cypress and Applitools for Functional and Visual Testing<\/a><\/li>\n<li><a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/learn-cypress-testing\">Learn Cypress Testing on Test Automation University<\/a><\/li>\n<li>More <a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/bilalhaidar?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=blog&amp;utm_campaign=&amp;utm_subgroup=\">blog posts by Bilal Haidar<\/a><\/li>\n<li>Request an <a href=\"https:\/\/app14743.cloudwayssites.com\/request-demo?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=request-a-demo&amp;utm_campaign=&amp;utm_subgroup=\">Applitools demo<\/a><\/li>\n<li>Sign up for a <a href=\"https:\/\/app14743.cloudwayssites.com\/free?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=free-account&amp;utm_campaign=&amp;utm_subgroup=\">free Applitools account<\/a><\/li>\n<li>Check out the <a href=\"https:\/\/app14743.cloudwayssites.com\/tutorials?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=tutorial&amp;utm_campaign=&amp;utm_subgroup=\">Applitools tutorials.<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While Cypress.io lacks support for cross-browser testing, Applitools supports it via their Applitools Ultrafast Grid. You can combine the best of both worlds by using Cypress.io to write your integration and E2E tests and letting Applitools Ultrafast Grid handle cross-browser testing for you.<\/p>\n","protected":false},"author":29,"featured_media":16801,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12271],"tags":[10357,12691,10061,10085,12688,12690,12686,10262],"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>Does Cypress Support Cross Browser Testing?<\/title>\n<meta name=\"description\" content=\"Cypress.io lets you test user interface design directly in the browser. But, Cypress only runs with Chrome. Learn how to do Cypress cross-browser testing step by step in this post.\" \/>\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\/cypress-cross-browser-testing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cross-browser Testing With Cypress.io\" \/>\n<meta property=\"og:description\" content=\"While Cypress.io lacks support for cross-browser testing, Applitools supports it via their Applitools Ultrafast Grid. You can combine the best of both worlds by using Cypress.io to write your integration and E2E tests and letting Applitools Ultrafast Grid handle cross-browser testing for you.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-11T23:24:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-26T18:31:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1626\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bilal Haidar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bilal Haidar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\"},\"author\":{\"name\":\"Bilal Haidar\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/4ce880ec19283dbe2aece99be6f20680\"},\"headline\":\"Cross-browser Testing With Cypress.io\",\"datePublished\":\"2019-12-11T23:24:00+00:00\",\"dateModified\":\"2020-08-26T18:31:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\"},\"wordCount\":2587,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg\",\"keywords\":[\"Cypress\",\"Developers\",\"Functional Testing\",\"Javascript\",\"Technical Leaders\",\"Test Engineers\",\"Visual Testing Strategies\",\"Visual Testing Tools\"],\"articleSection\":[\"Getting Started\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\",\"name\":\"Does Cypress Support Cross Browser Testing?\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg\",\"datePublished\":\"2019-12-11T23:24:00+00:00\",\"dateModified\":\"2020-08-26T18:31:35+00:00\",\"description\":\"Cypress.io lets you test user interface design directly in the browser. But, Cypress only runs with Chrome. Learn how to do Cypress cross-browser testing step by step in this post.\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg\",\"width\":2560,\"height\":1626},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Started\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/getting-started\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cross-browser Testing With Cypress.io\"}]},{\"@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\/4ce880ec19283dbe2aece99be6f20680\",\"name\":\"Bilal Haidar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/045bb3a1ee83617d590e48584226732e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/045bb3a1ee83617d590e48584226732e?s=96&d=mm&r=g\",\"caption\":\"Bilal Haidar\"},\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/bilalhaidar\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Does Cypress Support Cross Browser Testing?","description":"Cypress.io lets you test user interface design directly in the browser. But, Cypress only runs with Chrome. Learn how to do Cypress cross-browser testing step by step in this post.","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\/cypress-cross-browser-testing\/","og_locale":"en_US","og_type":"article","og_title":"Cross-browser Testing With Cypress.io","og_description":"While Cypress.io lacks support for cross-browser testing, Applitools supports it via their Applitools Ultrafast Grid. You can combine the best of both worlds by using Cypress.io to write your integration and E2E tests and letting Applitools Ultrafast Grid handle cross-browser testing for you.","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2019-12-11T23:24:00+00:00","article_modified_time":"2020-08-26T18:31:35+00:00","og_image":[{"width":2560,"height":1626,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg","type":"image\/jpeg"}],"author":"Bilal Haidar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bilal Haidar","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/"},"author":{"name":"Bilal Haidar","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/4ce880ec19283dbe2aece99be6f20680"},"headline":"Cross-browser Testing With Cypress.io","datePublished":"2019-12-11T23:24:00+00:00","dateModified":"2020-08-26T18:31:35+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/"},"wordCount":2587,"commentCount":0,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg","keywords":["Cypress","Developers","Functional Testing","Javascript","Technical Leaders","Test Engineers","Visual Testing Strategies","Visual Testing Tools"],"articleSection":["Getting Started"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/","name":"Does Cypress Support Cross Browser Testing?","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg","datePublished":"2019-12-11T23:24:00+00:00","dateModified":"2020-08-26T18:31:35+00:00","description":"Cypress.io lets you test user interface design directly in the browser. But, Cypress only runs with Chrome. Learn how to do Cypress cross-browser testing step by step in this post.","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2019\/12\/shutterstock_94556440-Shrink-scaled.jpg","width":2560,"height":1626},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/cypress-cross-browser-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Getting Started","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/getting-started\/"},{"@type":"ListItem","position":3,"name":"Cross-browser Testing With Cypress.io"}]},{"@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\/4ce880ec19283dbe2aece99be6f20680","name":"Bilal Haidar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/045bb3a1ee83617d590e48584226732e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/045bb3a1ee83617d590e48584226732e?s=96&d=mm&r=g","caption":"Bilal Haidar"},"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/bilalhaidar\/"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/16794"}],"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\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=16794"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/16794\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/16801"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=16794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=16794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=16794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}