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

Make it easy to add trace categories on top of the default ones for Chrome #1090

Merged
merged 1 commit into from Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/chrome/webdriver/chromeDevtoolsProtocol.js
Expand Up @@ -34,8 +34,13 @@ class ChromeDevtoolsProtocol {
);
}

if (this.chrome.traceCategories) {
log.info('Use Chrome trace categories: %s', this.chrome.traceCategories);
if (this.chrome.traceCategory) {
const extraCategories = util.toArray(this.chrome.traceCategory);
Array.prototype.push.apply(this.chromeTraceCategories, extraCategories);
}

if (this.chrome.traceCategories || options.cpu) {
log.info('Use Chrome trace categories: %s', this.chromeTraceCategories);
}
}

Expand Down
6 changes: 6 additions & 0 deletions lib/support/cli.js
Expand Up @@ -183,6 +183,12 @@ module.exports.parseCommandLine = function parseCommandLine() {
type: 'string',
group: 'chrome'
})
.option('chrome.traceCategory', {
describe:
'Add a trace category to the default ones. Use --chrome.traceCategory multiple times if you want to add multiple categories',
type: 'string',
group: 'chrome'
})
.option('chrome.enableTraceScreenshots', {
alias: 'enableTraceScreenshots',
describe:
Expand Down