diff --git a/bin/test.sh b/bin/test.sh index 5588513e635..71a90b8d8c1 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -59,7 +59,7 @@ if $ios_only || $all_tests; then echo "RUNNING IOS 6.1 TESTS" echo "---------------------" ios_testfile="./test/functional/_joined/ios.js" - ios_dirs="prefs safari testapp uicatalog webview" + ios_dirs="prefs safari testapp uicatalog webview appium" join_testfiles ios6.1 $ios_testfile $ios_dirs if test -d /Applications/Xcode-6.1.app; then echo "Found Xcode for iOS 6.1, switching to it" diff --git a/lib/appium.js b/lib/appium.js index 5446b74da2f..67552fe2247 100644 --- a/lib/appium.js +++ b/lib/appium.js @@ -328,7 +328,8 @@ Appium.prototype.configureDownloadedApp = function(appPath, origin, cb) { try { downloadFile(appUrl, function(appPath) { this.tempFiles.push(appPath); - cb(null, appPath); + this.args.app = appPath; + cb(null); }.bind(this)); } catch (e) { var err = e.toString(); diff --git a/test/functional/apidemos/basic.js b/test/functional/apidemos/basic.js index 60b08dd6490..30bd0c77374 100644 --- a/test/functional/apidemos/basic.js +++ b/test/functional/apidemos/basic.js @@ -11,6 +11,8 @@ var path = require('path') , appAct2 = "ApiDemos" , appAct3 = "com.example.android.apis.ApiDemos" , appAct4 = ".Blargimarg" + , appUrl = 'http://appium.s3.amazonaws.com/ApiDemos-debug.apk' + , describeUrl = require('../../helpers/driverblock.js').describeForApp(appUrl, "android", appPkg, appAct) , driverBlock = require("../../helpers/driverblock.js") , describeWd = driverBlock.describeForApp(appPath, "android", appPkg, appAct) , describeWd2 = driverBlock.describeForApp(appPath, "android", appPkg, appAct2) @@ -191,3 +193,14 @@ describe('pre-existing uiautomator session', function() { }); }); }); + +describeUrl('appium android', function(h) { + it('should load a zipped app via url', function(done) { + h.driver.execute("mobile: currentActivity", function(err, activity) { + should.not.exist(err); + activity.should.include("ApiDemos"); + done(); + }); + }); +}); + diff --git a/test/functional/uicatalog/basic.js b/test/functional/uicatalog/basic.js index 4356cdccb95..7020400645f 100644 --- a/test/functional/uicatalog/basic.js +++ b/test/functional/uicatalog/basic.js @@ -1,7 +1,12 @@ +/*global it:true */ "use strict"; var describeWd = require("../../helpers/driverblock.js").describeForApp('UICatalog') - , it = require("../../helpers/driverblock.js").it + , path = require('path') + , appUrl = 'http://appium.s3.amazonaws.com/UICatalog6.0.app.zip' + , appZip = path.resolve(__dirname, "../../../assets/UICatalog6.0.app.zip") + , describeZip = require('../../helpers/driverblock.js').describeForApp(appZip) + , describeUrl = require('../../helpers/driverblock.js').describeForApp(appUrl) , should = require('should'); describeWd('basic', function(h) { @@ -67,3 +72,33 @@ describeWd('basic', function(h) { }); }); + +describeZip('appium ios', function(h) { + it('should load a zipped app via path', function(done) { + h.driver.elementByTagName('tableView', function(err, element) { + should.not.exist(err); + should.exist(element.value); + done(); + }); + }); +}); + +describeUrl('appium ios', function(h) { + it('should load a zipped app via url', function(done) { + h.driver.elementByTagName('tableView', function(err, element) { + should.not.exist(err); + should.exist(element.value); + done(); + }); + }); +}); + +describeWd('appium ios', function(h) { + it('should go back to using app from before', function(done) { + h.driver.elementsByTagName('tableView', function(err, elements) { + should.not.exist(err); + elements.length.should.be.above(0); + done(); + }); + }); +});