Skip to content

Instantly share code, notes, and snippets.

@juanpicado
Created October 15, 2016 14:17
Show Gist options
  • Save juanpicado/b3d1e0d32b77d3109ca96405b00cc283 to your computer and use it in GitHub Desktop.
Save juanpicado/b3d1e0d32b77d3109ca96405b00cc283 to your computer and use it in GitHub Desktop.
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