Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat: pass list of browsers to plugins file #5068
Conversation
This comment has been minimized.
This comment has been minimized.
Testing it locally with command
Which shows the browser detection happens first, and then the plugins file loading, so we do have this information
|
This comment has been minimized.
This comment has been minimized.
cypress
bot
commented
Aug 30, 2019
•
Test summaryRun details
View run in Cypress Dashboard This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
In terms of the API changes, @brian-mann mentioned that we should have a method call like |
This comment has been minimized.
This comment has been minimized.
I think simplicity right now wins - if you mutate the other configuration values, you can screw things up, but how often users would screw the list of browsers and leave the invalid configuration? If they send an invalid browser, we could validate - just like we should validate the entire modified config object after getting it back. |
This comment has been minimized.
This comment has been minimized.
This PR also enables to run tests in Microsft Edge Beta (Chromium-based) or Brave browser by simply returning them from the plugins file module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
const pathToBrave =
'/Applications/Brave Browser.app/Contents/MacOS/Brave Browser'
config.browsers.push({
name: 'brave',
family: 'chrome',
displayName: 'Brave',
version: 'unknown',
path: pathToBrave,
majorVersion: 'unknown'
})
return config
} |
.then (browsers = []) -> | ||
debug("searching for browser '%s' among %s", | ||
nameOrPath, pluralize("browser", browsers.length, true)) |
This comment has been minimized.
This comment has been minimized.
flotwig
Nov 15, 2019
Member
this seems unnecessary, debug logs should be consistent and not change wording based on what's being logged
|
- adjust spacing of items - distinguish between arrays and objects (via expanded arrays having the text `"Array ({length})"` after the colon
Co-Authored-By: Zach Bloomquist <github@chary.us>
Co-Authored-By: Zach Bloomquist <github@chary.us>
Co-Authored-By: Zach Bloomquist <github@chary.us>
…ress-io/cypress into pass-list-of-browsers-to-config-5067
bahmutov commentedAug 30, 2019
•
edited
Passes list of detected browsers to the plugins file and lets the user modify the list.
User facing changelog
config.browsers
. The currently available browsers is also displayed within the configuration panel under Settings in the Test Runner.Additional details
Reworking browser detection and config to do the following:
cypress open
)electron
, which if the user removes from the list will cause an error--browser <name>
CLI then pick that browser from the current updated list of browsers--browser <path>
disregard the updated list and discover the browser just like we do nowHow has the user experience changed?
Example use: https://github.com/cypress-io/cypress-example-electron/blob/master/cypress/plugins/index.js
Config Before
Config After
PR Tasks
cypress-documentation
been submitted to document any user-facing changes? cypress-io/cypress-documentation#2245[object], ...
for the list of browserscypress.json
but in the plugins only