-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: add ability to use devtools procotol through cli option #827
Conversation
ca4199f
to
b085065
Compare
@@ -67,6 +67,7 @@ exports.run = () => { | |||
) | |||
.option("--repl-before-test [type]", "open repl interface before test run", Boolean, false) | |||
.option("--repl-on-fail [type]", "open repl interface on test fail only", Boolean, false) | |||
.option("--devtools", "switches the browser to the devtools mode with using CDP protocol") |
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.
Если опция не указана, то devtools: undefined
, а если указана то devtools: true
@@ -99,6 +101,7 @@ exports.run = () => { | |||
beforeTest: replBeforeTest, | |||
onFail: replOnFail, | |||
}, | |||
devtools: devtools || false, |
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.
Если devtools
не указана пользователем, то привожу опцию к false
reporters = [], | ||
}: Partial<RunOpts> = {}, | ||
): Promise<boolean> { | ||
validateUnknownBrowsers(browsers, _.keys(this._config.browsers)); | ||
|
||
RuntimeConfig.getInstance().extend({ updateRefs, requireModules, inspectMode, replMode }); | ||
RuntimeConfig.getInstance().extend({ updateRefs, requireModules, inspectMode, replMode, devtools }); |
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.
Опцию переданную из cli сохраняю в runtime конфиге, чтобы затем заюзать при создании браузера.
b085065
to
7750da9
Compare
src/browser/new-browser.js
Outdated
@@ -100,7 +102,7 @@ module.exports = class NewBrowser extends Browser { | |||
path: gridUri.path(), | |||
queryParams: this._getQueryParams(gridUri.query()), | |||
capabilities, | |||
automationProtocol: config.automationProtocol, | |||
automationProtocol: devtools ? "devtools" : config.automationProtocol, |
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.
почему ты в тестах используешь константу DEVTOOLS_PROTOCOL
, а здесь строкой добавляешь?
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.
Забыл тут заюзать, поправил.
7750da9
to
852f375
Compare
What is done
add ability to use devtools procotol through cli option
--devtools
in order to make it easier to switch between the two protocols (devtools
andwebdriver
).