Merge pull request #3403 from moizjv/samplecode-update

Updating sample-code and adding test for selendroid contactmanager test
This commit is contained in:
Jonathan Lipps
2014-08-18 11:40:52 -07:00
2 changed files with 23 additions and 4 deletions

View File

@@ -5,14 +5,15 @@ require('../../helpers/setup-chai');
var env = require('../../helpers/env')
, initSession = require('../../helpers/session').initSession
, _ = require('underscore')
, desired = require('./desired');
, desired = require('./desired')
, path = require('path');
describe('should not launch app without internet permission', function () {
this.timeout(env.MOCHA_INIT_TIMEOUT);
var session;
var name = this.title;
it('should not launch app', function (done) {
var newDesired = _.defaults({'app': 'sample-code/apps/ContactManager/ContactManager.apk'}, desired);
it('should not launch ContactManager app', function (done) {
var newDesired = _.defaults({'app': path.resolve(__dirname, '..', '..', '..', 'sample-code', 'apps', 'ContactManager', 'ContactManager.apk')}, desired);
afterEach(function (done) {
session
.tearDown(this.currentTest.state === 'failed')
@@ -27,3 +28,21 @@ describe('should not launch app without internet permission', function () {
.nodeify(done);
});
});
describe('should launch app with internet permission', function () {
this.timeout(env.MOCHA_INIT_TIMEOUT);
var session = null
, name = this.title;
afterEach(function (done) {
session
.tearDown(this.currentTest.state === 'passed')
.nodeify(done);
});
it('should launch ContactManager-selendroid app', function (done) {
var newDesired = _.defaults({'app': path.resolve(__dirname, '..', '..', '..', 'sample-code', 'apps', 'ContactManager', 'ContactManager-selendroid.apk')}, desired);
session = initSession(newDesired);
session.setUp(name)
.nodeify(done);
});
});