mirror of
https://github.com/appium/appium.git
synced 2026-10-29 04:36:39 +08:00
cleaning app opt at the beginning
This commit is contained in:
@@ -20,6 +20,12 @@ commands.createSession = async function (caps) {
|
||||
// merge caps onto opts so we don't need to worry about what's where
|
||||
Object.assign(this.opts, this.caps);
|
||||
|
||||
|
||||
// Prevents empty string caps so we don't need to test it everywhere
|
||||
if (typeof this.opts.app === 'string' && this.opts.app.trim() === '') {
|
||||
this.opts.app = null;
|
||||
}
|
||||
|
||||
if (!_.isUndefined(this.caps.newCommandTimeout)) {
|
||||
this.newCommandTimeoutMs = (this.caps.newCommandTimeout * 1000);
|
||||
}
|
||||
|
||||
+3
-1
@@ -12,9 +12,11 @@ import request from 'request';
|
||||
const ZIP_EXTS = ['.zip', '.ipa'];
|
||||
|
||||
async function configureApp (app, appExt) {
|
||||
if (_.isNull(app) || _.isUndefined(app)) { return; }
|
||||
|
||||
let newApp = null;
|
||||
let shouldUnzipApp = _.contains(ZIP_EXTS, path.extname(app));
|
||||
if (app.substring(0, 4).toLowerCase() === "http") {
|
||||
if ((app || '').substring(0, 4).toLowerCase() === "http") {
|
||||
logger.info(`Using downloadable app ${app}`);
|
||||
newApp = await downloadApp(app, shouldUnzipApp ? ".zip" : appExt);
|
||||
logger.info(`Downloaded app to ${newApp}`);
|
||||
|
||||
Reference in New Issue
Block a user