Skip to content

Add Cypress utility methods for OS / Platform / Arch / Browser / Browser Version #824

@brian-mann

Description

@brian-mann

Something like this...

// utility functions
Cypress.isPlatform()
Cypress.isBrowser()
Cypress.isArch()
Cypress.isBrowserVersion()

// constants
Cypress.arch
Cypress.platform
Cypress.browser
Cypress.browserVersion

Cypress.isWindows()
Cypress.isLinux()
Cypress.isMac()

if (Cypress.browser === "chrome") {

}

if (Cypress.isPlatform(["win32", "darwin"]) {

})

if (!Cypress.isBrowser("firefox") {

}

What about normalizing things like chrome, chromium, canary ?

Metadata

Metadata

Assignees

Labels

pkg/driverThis is due to an issue in the packages/driver directorytype: featureNew feature that does not currently exist

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions