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

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

Closed
brian-mann opened this issue Oct 26, 2017 · 3 comments
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory type: feature New feature that does not currently exist
Milestone

Comments

@brian-mann
Copy link
Member

brian-mann commented Oct 26, 2017

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 ?

@bahmutov
Copy link
Contributor

I really think we should split this into platform + arch vs browser and for now just do the first part - this is needed to correctly test cy.exec for example.

When adding any functions must update cypress/cli/index.d.ts too

@jennifer-shehane jennifer-shehane added pkg/driver This is due to an issue in the packages/driver directory stage: proposal 💡 No work has been done of this issue labels Nov 30, 2017
brian-mann pushed a commit that referenced this issue Nov 30, 2017
* add platform and arch to configuration object for #824

* pass platform and arch from config

* test Cypress.platform and Cypress.arch

* add TypeScript definitions for platform and arch
@brian-mann brian-mann added this to the 1.1.3 milestone Nov 30, 2017
@brian-mann
Copy link
Member Author

Fixed by #986

@brian-mann
Copy link
Member Author

Released in 1.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

3 participants