Skip to content

Instantly share code, notes, and snippets.

@asmod3us
Last active December 17, 2015 16:09
Show Gist options
  • Save asmod3us/5636710 to your computer and use it in GitHub Desktop.
Save asmod3us/5636710 to your computer and use it in GitHub Desktop.
using selenium-webdriver and mocha
var webdriver = require('selenium-webdriver'),
client = new webdriver.Builder().withCapabilities({'browserName': 'phantomjs'}).build(),
chai = require('chai'),
assert = chai.assert,
should = chai.should(),
expect = chai.expect;
describe('Test main page', function(){
before(function(done) {
client.get('http://google.com').then(function(){
done();
});
});
it('should see the correct title', function(done) {
client.getTitle().then(function(title){
expect(title).to.equal('Google');
done();
});
});
after(function(done) {
client.quit().then(function(){
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment