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
misc: Add browser support check and update supported browser messages #29066
base: develop
Are you sure you want to change the base?
misc: Add browser support check and update supported browser messages #29066
Conversation
|
@jennifer-shehane, recreated this PR as the last one had a messy git history/I made some mistakes when rebasing/merging - apologies for any confusion/extra work on your end. Thank you for sending @emilyrohrbough 's PR (https://github.com/cypress-io/cypress/pull/28377/files). A few thoughts around adding
I think the potential options are:
I'm not sure if there is a better solution that I'm missing entirely (I could just be overthinking this). |
6110af9
to
5db5279
Compare
8fcaa87
to
bc444e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR! I think this is a great start to improving the developer experience with these error messages.
I do think that this change is a great time to combine webkit and electron into the KnownBrowsers list, though, despite the additional scope.
|
||
Cypress supports the following browsers: | ||
${fmt.listItems(['electron', 'chrome', 'chromium', 'chrome:canary', 'edge', 'firefox'])} | ||
${fmt.listItems(['electron', 'chrome', 'chromium', 'chrome:canary', 'edge', 'firefox', 'webkit'])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we note here that webkit support is still experimental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cacieprins @jennifer-shehane sorry for the delay, will jump back on the pr this week
25324ab
to
e646ce0
Compare
477bb5e
to
d8f8c02
Compare
d8f8c02
to
949663b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a few system tests need to be updated? https://app.circleci.com/pipelines/github/cypress-io/cypress/60732/workflows/ada99278-62c9-4dbd-bbf1-e49ef1444d99/jobs/2546978/tests#failed-test-2
@0v00 let us know if you need help updating those!
Additional details
Current messages for browser support/browser's not found can be confusing e.g.:
Browser: chrome was not found on your system or is not supported by Cypress.
This PR aims to provide clear messaging if a browser is not supported, or if it was not found by name or path.
BROWSER_NOT_SUPPORTED
error message.C:\some\path\msedge.exe
) but is not found on their system, they will still see the appropriateBROWSER_NOT_FOUND_BY_NAME
orBROWSER_NOT_FOUND_BY_PATH
error. However, if a user misspells a browser name e.g.webkitt
, or enters an unsupported browser name e.g.arc
, they will see theBROWSER_NOT_SUPPORTED
error message.canary
error message to theBROWSER_NOT_SUPPORTED
error message.getBrowserLauncher()
now throws theBROWSER_NOT_SUPPORTED
error instead ofBROWSER_NOT_FOUND_BY_NAME
- ifelectron
or one of the supported browser families is not found, then it should be safe to assume that this browser is not supported.webkit
to the list of supported browsers in theBROWSER_NOT_SUPPORTED
error message.BROWSER_NOT_FOUND_BY_NAME
error - this error message may still need to be made clearer.chrome:someunsupportedchannel
- this will throw aBROWSER_NOT_FOUND_BY_NAME
error. I think this behavior makes sense as we want to avoid any false negatives - if the name/path contains e.g.chrome
, we can assume it's supported and then throw a more appropriate error later on.Steps to test
Test the following commands:
yarn cypress:run --browser unsupportedbrowser --project /your/project
yarn cypress:run --browser badname:channel--project /your/project
yarn cypress:run --browser /path/to/unsupported/browser --project /your/project
yarn test test/unit/browsers/browsers_spec.js
to verify passing testsyarn test
inpackages/errors
to verify passing testsHow has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?