-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix cypress run --headless
#5953
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
@@ -118,7 +118,11 @@ const pluginsBeforeBrowserLaunch = function (browser, args) { | |||
}) | |||
} | |||
|
|||
const _normalizeArgExtensions = function (dest, args) { | |||
const _normalizeArgExtensions = function (dest, args, browser) { |
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.
can we have some JSDocs here? or comments if the browser is headless, then we cannot load any extensions, thus we return arguments as is. Because it is unclear what this function does - if the browser is headless we return args - but what if the arguments include LOAD_EXTENSION
? shouldn't we filter them out?
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.
if the plugin returns extensions, they are filtered out elsewhere. in any case, chrome will still successfully launch with --load-extension
passed, but no extension will really be loaded
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.
converted the .js to .ts and added documentation: 86969ee
|
||
pathToTheme = extension.getPathToTheme() | ||
|
||
chrome.open("chrome", "http://", { isHeadless: true, isHeaded: false }, @automation) | ||
chrome.open({ isHeadless: true, isHeaded: false }, "http://", {}, @automation) |
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.
I feel here it would be helpful to extract arguments into named objects like maybe
browserInfo = {
isHeadless: true,
isHeaded: false
}
urlToLoad = "http://"
options = {}
chrome.open(browserInfo, urlToLoad, options, @automation)
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 |
packages/server/test/support/fixtures/projects/e2e/cypress/integration/headless_spec.js
Outdated
Show resolved
Hide resolved
Per this PR (cypress-io/cypress#5953), the file `packages/server/lib/browsers/chrome.js` has been renamed to `packages/server/lib/browsers/chrome.ts`. This commit updates that link (also updates the line number to the desired information).
Per this PR (cypress-io/cypress#5953), the file `packages/server/lib/browsers/chrome.js` has been renamed to `packages/server/lib/browsers/chrome.ts`. This commit updates that link (also updates the line number to the desired information).
User facing changelog
cypress run --headless
would not run Chrome-family browsers headlessly.Additional details
chrome.js
and tests didn't catch it :/Results of Browser.getWindowBounds:
How has the user experience changed?
PR Tasks