Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
adding sauce testing files
Browse files Browse the repository at this point in the history
  • Loading branch information
dethe committed Sep 24, 2013
1 parent 85f866a commit f077dbf
Show file tree
Hide file tree
Showing 2 changed files with 1,000,041 additions and 0 deletions.
41 changes: 41 additions & 0 deletions saucetesting/sample.js
@@ -0,0 +1,41 @@
var webdriver = require('wd')
, assert = require('assert');

var browser = webdriver.remote(
"ondemand.saucelabs.com"
, 80
, "dethe"
, "6b6df5e4-65b8-457d-9896-6dbf23c74e71"
);

browser.on('status', function(info){
console.log('\x1b[36m%s\x1b[0m', info);
});

browser.on('command', function(meth, path){
console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path);
});

var desired = {
browserName: 'iphone'
, version: '5.0'
, platform: 'Mac 10.6'
, tags: ["examples"]
, name: "This is an example test"
}

browser.init(desired, function() {
browser.get("http://saucelabs.com/test/guinea-pig", function() {
browser.title(function(err, title) {
assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');
browser.elementById('submit', function(err, el) {
browser.clickElement(el, function() {
browser.eval("window.location.href", function(err, href) {
assert.ok(~href.indexOf('guinea'), 'Wrong URL!');
browser.quit()
})
})
})
})
})
})

0 comments on commit f077dbf

Please sign in to comment.