Added bundleId for simulator build and did a cleanup for isSafariLauncherApp flag

This commit is contained in:
Sergio Neves Barros
2013-11-04 18:28:22 +00:00
parent 1ddc5f4e19
commit 4b362df4d0
3 changed files with 9 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ var Appium = function(args) {
this.commandTimeoutMs = this.defCommandTimeoutMs;
this.origCommandTimeoutMs = this.commandTimeoutMs;
this.commandTimeout = null;
this.isSafariLauncherApp = false;
};
Appium.prototype.attachTo = function(rest, cb) {
@@ -244,10 +245,12 @@ Appium.prototype.configureApp = function(desiredCaps, hasAppInCaps, cb) {
} else if (this.isIos() && appPath.toLowerCase() === "safari") {
if (this.args.udid) {
this.desiredCapabilities.safari = true;
this.isSafariLauncherApp = true;
this.configureLocalApp("./build/SafariLauncher/SafariLauncher.zip", origin, cb);
} else {
if (parseFloat(this.desiredCapabilities.version) >= 7) {
this.configureSafariForLauncher(desiredCaps, function() {
this.isSafariLauncherApp = true;
this.configureLocalApp("./build/SafariLauncher/SafariLauncherSim.zip", origin, cb);
}.bind(this));
} else {
@@ -527,6 +530,7 @@ Appium.prototype.initDevice = function() {
, startingOrientation: this.desiredCapabilities.deviceOrientation || this.args.orientation
, robotPort: this.args.robotPort
, robotAddress: this.args.robotAddress
, isSafariLauncherApp: this.isSafariLauncherApp
};
this.device = ios(iosOpts);
} else if (this.isAndroid()) {
@@ -657,7 +661,7 @@ Appium.prototype.stop = function(cb) {
}
logger.info('Shutting down appium session...');
if (this.device.isSafariLauncherApp === true) {
if (this.isSafariLauncherApp === true) {
this.device.leaveWebView(function() {
if (this.device.udid === null) {
this.device.instruments.shutdown(function() {

View File

@@ -63,8 +63,7 @@ var IOS = function(args) {
this.onPageChangeCb = null;
this.useRobot = args.robotPort > 0;
this.robotUrl = this.useRobot ? "http://" + args.robotAddress + ":" + args.robotPort + "" : null;
var safariLauncherAppName = "/safarilauncher.app";
this.isSafariLauncherApp = args.app !== null && (typeof args.app !== "undefined") && (args.app.toLowerCase().indexOf(safariLauncherAppName, args.app.length - safariLauncherAppName.length) !== -1);
this.isSafariLauncherApp = args.isSafariLauncherApp;
this.capabilities = {
version: '6.0'
, webStorageEnabled: false

View File

@@ -160,7 +160,9 @@ reset_ios() {
echo "* Cloning/updating SafariLauncher"
run_cmd git submodule update --init submodules/SafariLauncher
echo "* Building SafariLauncher"
run_cmd $grunt buildSafariLauncherApp:iphonesimulator
run_cmd rm -f submodules/Safarilauncher/target.xcconfig
echo "BUNDLE_ID = com.bytearc.SafariLauncher" >> submodules/Safarilauncher/target.xcconfig
run_cmd $grunt buildSafariLauncherApp:iphonesimulator:"target.xcconfig"
echo "* Copying SafariLauncher to build"
run_cmd rm -rf build/SafariLauncher
run_cmd mkdir -p build/SafariLauncher