mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
Merge pull request #2461 from imurchie/isaac-fix-context
Fix iOS context change
This commit is contained in:
@@ -1497,7 +1497,7 @@ iOSController.setContext = function (name, cb, skipReadyCheck) {
|
||||
// allow user to pass in "WEBVIEW" without an index
|
||||
idx = '1';
|
||||
}
|
||||
this.getContexts(function () {
|
||||
var pickContext = function () {
|
||||
if (_.contains(this.contexts, idx)) {
|
||||
var pageIdKey = parseInt(idx, 10);
|
||||
var next = function () {
|
||||
@@ -1538,7 +1538,16 @@ iOSController.setContext = function (name, cb, skipReadyCheck) {
|
||||
, value: "Context '" + name + "' does not exist"
|
||||
});
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this);
|
||||
|
||||
// only get contexts if they haven't already been gotten
|
||||
if (typeof this.contexts === 'undefined') {
|
||||
this.getContexts(function () {
|
||||
pickContext();
|
||||
}.bind(this));
|
||||
} else {
|
||||
pickContext();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user