mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
allow pushStrings to work with 'app' as package, not just file
fix #2749 and add tests also fix tryNTimes, I think it was vacuously succeeding all the time (cc @sebv)
This commit is contained in:
@@ -62,7 +62,7 @@ androidCommon.configureApp = function (cb) {
|
||||
|
||||
if (this.appIsPackageOrBundle(this.args.app)) {
|
||||
// we have a package instead of app
|
||||
this.args.androidPackage = this.args.app;
|
||||
this.args.appPackage = this.args.app;
|
||||
this.args.app = null;
|
||||
logger.debug("App is an Android package, will attempt to run on device");
|
||||
cb();
|
||||
|
||||
@@ -187,11 +187,10 @@ describe("apidemo - basic @skip-ci", function () {
|
||||
try3Times(function () {
|
||||
return session.setUp(title)
|
||||
.catch(function (err) { throw err.data; })
|
||||
.should.be.rejectedWith(/Error locating the app/);
|
||||
.should.eventually.be.rejectedWith(/Error locating the app/);
|
||||
}).nodeify(done);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('pre-existing uiautomator session', function () {
|
||||
@@ -259,6 +258,14 @@ describe("apidemo - basic @skip-ci", function () {
|
||||
session.setUp(title + "- zip url").nodeify(done);
|
||||
});
|
||||
|
||||
it('should load an app via package', function (done) {
|
||||
var caps = _.clone(desired);
|
||||
caps.app = 'io.appium.android.apis';
|
||||
caps.appActivity = '.ApiDemos';
|
||||
session = initSession(caps, desired);
|
||||
session.setUp(title + "- package").nodeify(done);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var tryNTimes = function (n, fn) {
|
||||
if (n <= 0) return;
|
||||
if (n === 1) return fn();
|
||||
return fn().catch(function () {
|
||||
return tryNTimes(n - 1, fn);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user