Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add methods for determining current browser #2023

Closed
chrisbreiding opened this issue Jun 25, 2018 · 1 comment
Closed

Proposal: Add methods for determining current browser #2023

chrisbreiding opened this issue Jun 25, 2018 · 1 comment
Assignees

Comments

@chrisbreiding
Copy link
Contributor

With Firefox support around the corner, the following methods will be useful to conditionally test things based on browser:

  • Cypress.isBrowser(_browserName_):
    • Returns true if the exact browser is being run
    • browserName is case-insensitive
  • Cypress.isBrowserType(_browserType_): Returns true if the browser is in the family of browserType:
    • Cypress.isBrowserType('chrome') will return true for Chrome, Canary, Chromium, and Electron
    • Cypress.isBrowserType('firefox') will return true for Firefox, Firefox Developer Edition, and Firefox Nightly
    • browserType is case-insensitive
@chrisbreiding chrisbreiding added the type: feature New feature that does not currently exist label Jun 25, 2018
@chrisbreiding chrisbreiding self-assigned this Jun 25, 2018
@jennifer-shehane
Copy link
Member

We now have Cypress.browser which can be used to achieve the same thing. Closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants