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
ignore defaultChromeFlags / PptrDefaultArgs tags #5344
ignore defaultChromeFlags / PptrDefaultArgs tags #5344
Conversation
Haha!
|
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 use 1 parameter for both as they are essentially doing the same thing?
It's possible. |
The user would just need to set: ignorePuppeteerDefaultArgs: {
// default args to be ignored
args: [...]
} |
Ok. I will set a single parameter that affects the 2 lists of default args/flags. |
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.
Could you move ignoreDefaultArgs
into goog:chromeOptions
as it i a custom capability?
packages/devtools/src/launcher.js
Outdated
}, | ||
ignoreDefaultArgs ? { ignoreDefaultArgs: ignoreDefaultArgs } : {} | ||
)) |
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.
No need to use Object.assign:
const chrome = await launchChromeBrowser({
chromePath: chromeOptions.binary,
chromeFlags,
ignoreDefaultArgs: Boolean(ignoreDefaultArgs)
})
packages/devtools/src/launcher.js
Outdated
@@ -109,7 +120,8 @@ function launchBrowser (capabilities, product) { | |||
width: DEFAULT_WIDTH, | |||
height: DEFAULT_HEIGHT | |||
} | |||
}, capabilities[vendorCapKey] || {}) | |||
}, capabilities[vendorCapKey], | |||
ignoreDefaultArgs ? { ignoreDefaultArgs: true } : {}) |
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.
same as above:
const puppeteerOptions = Object.assign({
product,
executablePath,
defaultViewport: {
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT
},
ignoreDefaultArgs: Boolean(ignoreDefaultArgs)
}, capabilities[vendorCapKey] || {})
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.
Could you move
ignoreDefaultArgs
intogoog:chromeOptions
as it i a custom capability?
It's true my first need was for Chrome. But:
-
As I can see in devtools/launcher.js devtools can also be used for other browsers than Chrome. Maybe not yet at the same level as with Chrome, but it's possible.
-
And it seems Puppeteer accepts this
ignoreDefaultArgs
parameter in its experimental support of Firefox (see experimental/puppeteer-firefox/Launcher.js).
so why limit this parameter only for Chrome?
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.
same as above:
const puppeteerOptions = Object.assign({ product, executablePath, defaultViewport: { width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT }, ignoreDefaultArgs: Boolean(ignoreDefaultArgs) }, capabilities[vendorCapKey] || {})
line 124 is actually wrong. It should be like line 75:
ignoreDefaultArgs ? { ignoreDefaultArgs: ignoreDefaultArgs } : {}
as ignoreDefaultArgs
is either a boolean or a array of string (as in Puppeteer)
packages/devtools/src/launcher.js
Outdated
@@ -60,10 +62,13 @@ async function launchChrome (capabilities) { | |||
} | |||
|
|||
log.info(`Launch Google Chrome with flags: ${chromeFlags.join(' ')}`) | |||
const chrome = await launchChromeBrowser({ | |||
|
|||
const chrome = await launchChromeBrowser(Object.assign({ |
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.
We still don't need Object.assign
here if ignoreDefaultArgs
can contain the same values as in Puppeteer we can just do:
const chrome = await launchChromeBrowser({
chromePath: chromeOptions.binary,
ignoreDefaultArgs,
chromeFlags
})
packages/devtools/src/launcher.js
Outdated
@@ -109,7 +114,8 @@ function launchBrowser (capabilities, product) { | |||
width: DEFAULT_WIDTH, | |||
height: DEFAULT_HEIGHT | |||
} | |||
}, capabilities[vendorCapKey] || {}) | |||
}, capabilities[vendorCapKey], | |||
ignoreDefaultArgs ? { ignoreDefaultArgs: ignoreDefaultArgs } : {}) |
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.
we can do the same here:
const puppeteerOptions = Object.assign({
product,
executablePath,
ignoreDefaultArgs,
defaultViewport: {
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT
}
}, capabilities[vendorCapKey] || {})
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 think these specific DevTools capabilities should be documented differently but since we don't have such a section yet I will approve this PR.
Thanks @anemer
Proposed changes
Added 2 optional parameters (in
wdio.conf.js
/capabilities
) that allow:#5339
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers