Run a Cypress test in all browsers besides Chrome?

nick asked this question 10 months ago
nick on Mar 15, 2022

I need to run a specific Cypress test in each browser besides Google Chrome.

So, when Cypress is using Chrome as the browser it runs tests in, this specific test would not be ran.

In my Cypress code, I could then do something like this:

if (!chrome) {
  // run the test

How can I do this in Cypress?

3 suggested answers
looper003 on May 7, 2022

You can use the value. It will return the name of the browser Cypress is currently using.

const isChrome = === "chrome"
0 replies
coderguy on May 7, 2022
if ( !== "chrome") {
  // run the test

The test inside the if statement will not run if Cypress is using the Chrome browser.

0 replies
yaboy01 on May 7, 2022

Cypress has @cypress/skip-test NPM package you can use for this.

It provides a skipOn() method you could use to skip a test when running in the Chrome browser:

it('skips on Chrome', () => {
0 replies