![How to Do Cross Browser Testing in Cypress](https://allma.si/blog/wp-content/uploads/2021/12/cross-browser-testing-in-cypress.png)
How to Do Cross Browser Testing in Cypress
To do cross-browser testing in Cypress, we can pass in the required browser to a describe
or an it
block using the browser flag in the following way:
// Passing for describe:
describe('Features on Firefox', { browser: 'firefox' }, () => {
it(...);
it(...);
});
// Passing for it:
it('Should work perfectly in Chrome', { browser: 'chrome' }, () => {
...
});
We can also exclude certain browsers by negating it with an exclamation mark, for example, to exclude Chrome, we can say:
it('Should skip Chrome', { browser: '!chrome' }, () => {
...
});
The browser
flag can accept the same arguments as Cypress.isBrowser
can take on.
Want to learn Cypress from end to end? Check out my Cypress course on Educative where I cover everything:
![Learn Cypress with Educative](https://allma.si/blog/wp-content/uploads/2021/09/learn-cypress-with-educative.png)
![How to Do Cross Browser Testing in Cypress](https://allma.si/blog/wp-content/uploads/2021/12/cross-browser-testing-in-cypress.png)
Resources:
![Mentoring](/assets/img/mentoring.png)
Rocket Launch Your Career
Speed up your learning progress with our mentorship program. Join as a mentee to unlock the full potential of Webtips and get a personalized learning experience by experts to master the following frontend technologies: