Created
May 2, 2013 10:31
-
-
Save sebv/5501390 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
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(); | |
This file contains hidden or 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 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