Created
October 15, 2016 14:17
-
-
Save juanpicado/b3d1e0d32b77d3109ca96405b00cc283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wd = require('wd'); | |
require('colors'); | |
var chai = require("chai"); | |
var chaiAsPromised = require("chai-as-promised"); | |
chai.use(chaiAsPromised); | |
chai.should(); | |
var browser = wd.remote('localhost', 9515); | |
browser.init({ | |
browserName: "chrome", | |
chromeOptions: { | |
"androidPackage": "com.android.chrome" | |
} | |
}, function () { | |
browser.get("http://admc.io/wd/test-pages/guinea-pig.html", function () { | |
browser.title(function (err, title) { | |
title.should.include('WD'); | |
browser.elementById('i am a link', function (err, el) { | |
browser.clickElement(el, function () { | |
/* jshint evil: true */ | |
browser.eval("window.location.href", function (err, href) { | |
href.should.include('guinea-pig2'); | |
browser.quit(); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment