-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
stop chromedriver proxies when reset command is called. fixes #12083 #495
Conversation
Oh, and should I add an e2e test for this case? |
Fixes #495 |
lib/commands/general.js
Outdated
@@ -228,7 +228,7 @@ commands.reset = async function () { | |||
await androidHelpers.resetApp(this.adb, Object.assign({}, this.opts, {fastReset: true})); | |||
// reset context since we don't know what kind on context we will end up after app launch. | |||
this.curContext = NATIVE_WIN; | |||
|
|||
await this.stopChromedriverProxies(); |
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.
What about calling switchContext(NATIVE_WIN)
?
As you mentioned in your side note, if we set native window, the method calls stop or suspend chrome driver properly..?
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.
Sure. I was just following the pattern from closeApp
in the same file. If we call switchContect
we get the added benefit of respecting the recreateChromeDriverSessions
desired cap.
On closeApp
are we ok leaving chromedriver still running if somebody set this cap?
133ea74
to
cb5fa9e
Compare
@KazuCocoa just pushed another try at this.
|
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 left one comment. Otherwise, LGTM 👍
lib/commands/context.js
Outdated
@@ -37,7 +37,7 @@ commands.getContexts = async function () { | |||
}; | |||
|
|||
commands.setContext = async function (name) { | |||
if (name === null) { | |||
if (name === null || name === undefined) { |
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.
what about #hasValue
by import { util } from 'appium-support';
?
https://github.com/appium/appium-support/blob/2fcf470576f0357e3200f8014f8b1898b326d79e/lib/util.js#L14
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.
ooh that's much better. I love that.
cb5fa9e
to
d773c11
Compare
@KazuCocoa PR updated with suggestion for using |
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.
👍
CI tests failed, so I want to take a look before merging. Looks related. |
d773c11
to
0b66aad
Compare
0b66aad
to
0d75041
Compare
The same exact command is already being called on
closeApp
: https://github.com/appium/appium-android-driver/blob/master/lib/commands/general.js#L262A side note: should both of these commands respect the
recreateChromeDriverSessions
desired capability? Then we should callsuspendChromedriverProxy
instead ofstopChromedriverProxies
like here:https://github.com/appium/appium-android-driver/blob/master/lib/commands/context.js#L71