📣 Join us April 15th @ 2PM EDT/11 AM PDT to learn how Lightstep quadrupled deployment velocity with Cypress



Improve this doc

Cypress.isBrowser checks if the current browser matches the given name or filter.




name (String)

The name of the browser (case-insensitive).

filter (Object)

Filter by the browser properties. You can inspect the current browser’s properties by using the Cypress.browser. Supported properties are:

Property Type Description
name string Machine-friendly name, like chrome, electron, or firefox.
family string Rendering engine being used. chromium or firefox.
channel string Release channel of the browser, such as stable, dev, or canary.
displayName string Human-readable display name for the browser.
version string Full version.
path string Path to the browser on disk. Blank for Electron.
majorVersion number The major version number of the browser.
isHeadless boolean Whether the browser is running headlessly.
isHeaded boolean Whether the browser displays headed.



Only run tests in Chrome

// true when running in Chrome
if (Cypress.isBrowser('chrome')) {
  it('only runs in chrome', function () {
    // test some (hypothetical) issue with chrome

Skip a test in Firefox

it('a test', function() {
  // true when running in Firefox
  if (Cypress.isBrowser('firefox')) {


Only run commands in Chromium-based browser

it('has correct Chromium-based specific css property', function () {
  // if in Chromium-based browser (Chrome, Electron, etc...)
  // check css property was properly applied
  if (Cypress.isBrowser({ family: 'chromium' })) {
    .should('have.css', 'margin-right')
    .and('eq', '0')

Only run on stable release in Chromium-based browser

// true when running in any stable release of a Chromium-based browser
if (Cypress.isBrowser({ family: 'chromium', channel: 'stable' })) {
  it('will not run in Canary or Dev browsers', function () {
    // test some (hypothetical) issue with chrome


Version Changes
4.0.0 Added isBrowser command.

See also