Merge pull request #2643 from Jonahss/master

stabilized android webview tests
This commit is contained in:
seb vincent
2014-05-22 17:53:14 -05:00
2 changed files with 10 additions and 4 deletions

View File

@@ -4,6 +4,4 @@ var androidWebviewTests = require('../common/android-webview-base');
// TODO: androidWebviewTests is using an app built by selendroid. Need to build it once
// and save it into asset so that it can be used by android tests
// TODO: when I run it on android I don't see the WEBVIEW context, this needs
// to be investigated
describe('android - web_view @skip-ci @skip-android-all', androidWebviewTests);

View File

@@ -2,7 +2,8 @@
"use strict";
var env = require('../../helpers/env')
, setup = require("./setup-base");
, setup = require("./setup-base")
, Asserter = require('wd').Asserter;
var desired = {
app: "sample-code/apps/selendroid-test-app.apk",
@@ -14,10 +15,17 @@ module.exports = function () {
var driver;
setup(this, desired).then(function (d) { driver = d; });
var webviewContextAvailable = new Asserter(
function (driver) {
return driver
.contexts().should.eventually.have.length(2);
}
);
beforeEach(function (done) {
driver
.waitForElementByName('buttonStartWebviewCD').click()
.sleep(500)
.waitFor(webviewContextAvailable, 1000, 100)
.context('WEBVIEW')
.nodeify(done);
});