Skip to content

Instantly share code, notes, and snippets.

@christian-bromann
Created September 2, 2013 20:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christian-bromann/6416864 to your computer and use it in GitHub Desktop.
Save christian-bromann/6416864 to your computer and use it in GitHub Desktop.
run WebdriverJS with Jasmine
var webdriverjs = require('webdriverjs');
describe('my webdriverjs tests', function() {
var client = {};
jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;
beforeEach(function() {
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init();
});
it('test it', function(done) {
client
.url('https://github.com/')
.getElementSize('.header-logo-wordmark', function(err, result) {
expect(err).toBe(null);
expect(result.height).toBe(32);
expect(result.width).toBe(89);
})
.getTitle(function(err, title) {
expect(err).toBe(null);
expect(title).toBe('GitHub · Build software better, together.');
})
.getElementCssProperty('css selector','a[href="/plans"]', 'color', function(err, result){
expect(err).toBe(null);
expect(result).toBe('rgba(65,131,196,1)');
})
.call(done);
});
afterEach(function(done) {
client.end(done);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment