mirror of
https://github.com/appium/appium.git
synced 2026-02-12 04:50:08 -06:00
fix launchAndQuit to actually wait for safari dirs if we need them
This commit is contained in:
@@ -526,7 +526,7 @@ IOS.prototype.setLocale = function (cb) {
|
||||
|
||||
if ((this.args.language || this.args.locale || this.args.calendarFormat) && this.args.udid === null) {
|
||||
if (!settings.simDirsExist(this.iOSSDKVersion)) {
|
||||
this.instantLaunchAndQuit(setLoc);
|
||||
this.instantLaunchAndQuit(false, setLoc);
|
||||
} else {
|
||||
setLoc();
|
||||
}
|
||||
@@ -598,18 +598,25 @@ IOS.prototype.setPreferences = function (cb) {
|
||||
logger.debug("Setting iOS and app preferences");
|
||||
if (!settings.simDirsExist(this.iOSSDKVersion) ||
|
||||
(needToSetSafari && !settings.safari7DirsExist(this.iOSSDKVersion))) {
|
||||
this.instantLaunchAndQuit(setPrefs);
|
||||
this.instantLaunchAndQuit(needToSetSafari, setPrefs);
|
||||
} else {
|
||||
setPrefs();
|
||||
}
|
||||
};
|
||||
|
||||
IOS.prototype.instantLaunchAndQuit = function (cb) {
|
||||
IOS.prototype.instantLaunchAndQuit = function (needSafariDirs, cb) {
|
||||
logger.debug("Sim files for the " + this.iOSSDKVersion + " SDK do not yet exist, launching the sim " +
|
||||
"to populate the applications and preference dirs");
|
||||
|
||||
var condition = function () {
|
||||
return settings.simDirsExist(this.iOSSDKVersion);
|
||||
var simDirsExist = settings.simDirsExist(this.iOSSDKVersion);
|
||||
var safariDirsExist = settings.safari7DirsExist(this.iOSSDKVersion);
|
||||
var okToGo = simDirsExist && (!needSafariDirs || safariDirsExist);
|
||||
if (!okToGo) {
|
||||
logger.debug("We launched the simulator but the required dirs don't " +
|
||||
"yet exist. Waiting some more...");
|
||||
}
|
||||
return okToGo;
|
||||
}.bind(this);
|
||||
|
||||
this.setDeviceAndLaunchSimulator(function (err) {
|
||||
|
||||
@@ -142,7 +142,7 @@ var getSafari7Dirs = function (sdk) {
|
||||
if (safariDir) {
|
||||
safariDirs.push(safariDir);
|
||||
} else {
|
||||
logger.warn("Could not find MobileSafari in sim applications at " +
|
||||
logger.info("Could not find MobileSafari in sim applications at " +
|
||||
appsDir);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"adm-zip": "~0.4.4",
|
||||
"appium-adb": "1.2.0",
|
||||
"appium-atoms": "~0.0.5",
|
||||
"appium-instruments": "~1.1.1",
|
||||
"appium-instruments": "~1.1.2",
|
||||
"appium-uiauto": "~1.2.1",
|
||||
"argparse": "~0.1.15",
|
||||
"async": "~0.9.0",
|
||||
|
||||
Submodule submodules/appium-instruments updated: d0fdb496a2...80e3a9f065
Reference in New Issue
Block a user