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

Display accurate error message when browser is not supported #6979

Closed
mydiemho opened this issue Apr 9, 2020 · 5 comments · Fixed by #7375
Closed

Display accurate error message when browser is not supported #6979

mydiemho opened this issue Apr 9, 2020 · 5 comments · Fixed by #7375

Comments

@mydiemho
Copy link

mydiemho commented Apr 9, 2020

Current behavior:

Safari is currently not supported. However, the error message is misleading user to think that Safari is not installed vs it not being supported.

> npx cypress run --browser  "safari"

Can't run because you've entered an invalid browser name.

Browser: 'safari' was not found on your system.

Available browsers found are: chrome, firefox, electron

Desired behavior:

Accurate error message. For example:

> npx cypress run --browser  "safari"

Can't run because you've entered an invalid browser name.

Browser: 'safari' is not supported

Supported browsers are: chrome, firefox, electron, edge

Test code to reproduce

Run the following on a host with Safari installed.

 npx cypress run --browser  "safari"

Versions

  1. Cypress
➜ npx cypress -v
Cypress package version: 4.3.0
Cypress binary version: 4.3.0
  1. Operating System
    macOS 10.15.4

  2. Browser
    Safari

Related #6422

@jennifer-shehane
Copy link
Member

Yah, this may not be as straightforward because you can actually customize the available browsers. https://on.cypress.io/launching-browsers#Customize-available-browsers

But yes, I agree this could be a better error message.

Supported browser is actually a bit longer also:

Canary
Chrome
Chromium
Edge
Edge Beta
Edge Canary
Edge Dev
Electron
Firefox (Beta support)
Firefox Developer Edition (Beta support)
Firefox Nightly (Beta support)

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Apr 10, 2020
@jennifer-shehane jennifer-shehane added cli stage: ready for work The issue is reproducible and in scope and removed stage: ready for work The issue is reproducible and in scope labels Apr 10, 2020
@jennifer-shehane jennifer-shehane added the good first issue Good for newcomers label May 13, 2020
@flozender
Copy link

flozender commented May 13, 2020

Hi, I'd like to work on this! I do need a little help getting started. What directories would I have to go through in order to make the changes? Thank you!

@flozender
Copy link

flozender commented May 13, 2020

One way to do it would be to add a conditional statement in packages/server/lib/errors.coffee, in the when "BROWSER_NOT_FOUND_BY_NAME" switch case, and modify the error string accordingly for when safari is an argument. Please let me know if I am on the right track.

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: ready for work The issue is reproducible and in scope labels May 13, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels May 15, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels May 26, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 29, 2020

The code for this is done in cypress-io/cypress#7375, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot added stage: pending release stage: ready for work The issue is reproducible and in scope and removed stage: needs review The PR code is done & tested, needs review stage: pending release labels May 29, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 8, 2020

Released in 4.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.8.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: ready for work The issue is reproducible and in scope label Jun 8, 2020
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants