I've got a scenario testing setup going with Sauce Labs, WebDriver, I'm including chai and the chai-as-promise library. I've been pulling bits and pieces out of examples and have got as far as:
require('colors');
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
chai.should();
var wd = require('wd');
var asserters = wd.asserters;
chaiAsPromised.transferPromiseness = wd.transferPromiseness;
var browser = wd.promiseChainRemote(
"ondemand.saucelabs.com", 80,
"-------------",
"------------------------------");
browser
.on('status', function(info){
console.log('\x1b[36m%s\x1b[0m', info.cyan);
})
.on('command', function(meth, path, data){
console.log(' > \x1b[33m%s\x1b[0m: %s', meth.yellow, path.grey, data || '');
})
.init({
browserName: 'chrome',
version: '31',
platform: 'Mac 10.8',
tags: ["test"],
name: "Test"
})
.
.
.
but I'm not really sure where to go from here. The ReadMe at https://github.com/admc/wd has a great overview and description of the concepts. I can comb through source files like https://github.com/admc/wd/blob/master/lib/commands.js to get some ideas. But what I really need is some documentation with a list of all functions available. A few tutorials to do common tests would be nice.
Essentially, are there any helpful resources out there to get me going here?
Thanks.
EDIT:
For example, something simple, checking the length of a list in the dom:
.
.
.
.waitForElementByCss('.list-item', asserters.isDisplayed, 2000)
.should.eventually.have.length(10)
is giving me the error:
AssertionError: expected { Object (value, browser) } to have a property 'length'
What am I missing here?