Files
appium/test/functional/android/app-path-base.js
T
Jonathan Lipps a3873bb7c6 fix selendroid/android spaces-in-app-path bugs
by upgrading adb
fix #3461
2014-09-15 16:26:24 -07:00

38 lines
1.2 KiB
JavaScript

"use strict";
var initSession = require('../../helpers/session').initSession
, getTitle = require('../../helpers/title').getTitle
, _ = require('underscore')
, getAppPath = require('../../helpers/app').getAppPath
, tempdir = require('../../../lib/tempdir')
, ncp = require('ncp');
require('../../helpers/setup-chai.js');
module.exports.spacesTest = function (desired) {
var session;
var title = getTitle(this);
var oldAppPath = getAppPath('ApiDemos');
var newAppPath = '/tmp/App With Spaces.apk';
before(function (done) {
tempdir.open({prefix: 'app with spaces', suffix: '.apk'}, function (err, info) {
if (err) return done(err);
console.log("Copying '" + oldAppPath + "' to '" + info.path + "'");
ncp(oldAppPath, info.path, function (err) {
if (err) return done(err);
newAppPath = info.path;
done();
});
});
});
after(function () { return session.tearDown(this.currentTest.state === 'passed'); });
it('should work with spaces in app path', function (done) {
session = initSession(_.defaults({'app': newAppPath}, desired));
return session.setUp(title)
.should.eventually.be.fulfilled
.nodeify(done);
});
};