Skip to content

Instantly share code, notes, and snippets.

View kbingman's full-sized avatar

Keith Bingman kbingman

  • Vancouver, BC Canada
View GitHub Profile
@kbingman
kbingman / gist:6557121
Created September 13, 2013 22:56
Basic casper.js test
casper.test.begin('Home Page', function(test) {
loginAndPreview(baseUrl, bundleLocation, test);
casper.then(function() {
// Home body Class
test.assertExists('.x-home', 'Home body class');
// Main content
test.assertExists('.x-main', 'Main content');
@kbingman
kbingman / gist:6557116
Created September 13, 2013 22:54
lululemon Webdriver.js tests
describe('lululemon', function(){
this.timeout(99999999);
before(function(){
client.init();
});
it('should login', function(done){
client
@kbingman
kbingman / gist:6557074
Created September 13, 2013 22:49
external include for casper.js login and preview
var require = patchRequire(require);
var loginAndPreview = function(baseUrl, bundleLocation, test){
casper.start('http://preview.mobify.com/', function suite() {
// Add a title comment so that you know what's happening and when
casper.test.comment('Lululemon - 2013 Refresh');
// Log out what we are doing
var client = webdriverjs.remote({
desiredCapabilities: {
browserName: browserName
},
logLevel: 'silent'
});
// Extensions to Webdriver
client.addCommand('loginAndPreview', function(callback) {