Cypress supports Chrome, Firefox, Microsoft Edge and Electron browsers for running the test cases. Cypress automatically bundles the Electron browser once we download it in our machines.
The browsers get updated with newer versions regularly. To match with this, Cypress also fixes issues in the latest versions of the released browsers. However with each Electron browser version, Cypress is thoroughly tested and all test cases are expected to pass.
While running the test case from the test runner, we have to choose the browser in which we want to run from the dropdown appearing from the upper right corner of the Test Runner window. After we select an option from the dropdown, we need to click our test case for execution.
If we don’t find a browser in the dropdown of the test runner window, it signifies we don’t have the latest version of that browser currently in our machine.
We can run a test case from different browsers from the command line. The command to be used for running test cases in chrome browser is ./node_modules/.bin/cypress run -- browser chrome.
We can also run a test case from other browsers from the command line. The command to be used for running test cases in firefox browser is ./node_modules/.bin/cypress run -- browser firefox.
Finally, to run the test case from the command line in the edge browser, the command to be used is ./node_modules/.bin/cypress run -- browser edge.