Skip to content

Instantly share code, notes, and snippets.

@sebv
Created May 2, 2013 10:31
Show Gist options
  • Save sebv/5501390 to your computer and use it in GitHub Desktop.
Save sebv/5501390 to your computer and use it in GitHub Desktop.
var wd;
try {
wd = require('wd');
} catch( err ) {
wd = require('../lib/main');
}
var browser = wd.remote();
browser.test = require('./test');
browser.on('status', function(info){
console.log('\x1b[36m%s\x1b[0m', info);
});
browser.on('command', function(meth, path, data){
console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path, data || '');
});
browser.chain()
.init({
browserName:'chrome'
, tags : ["examples"]
, name: "This is an example test"
})
.get("http://admc.io/wd/test-pages/guinea-pig.html")
.test()
.quit();
var assert = require('assert');
module.exports = function(cb) {
var _this = this;
_this.elementById('i am a link', function(err, element) {
if (err) return cb(err);
_this.moveTo(element, function(err) {
if (err) return cb(err);
assert(true);
if(cb) cb(null);
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment