Last active
December 17, 2015 16:09
-
-
Save asmod3us/5636710 to your computer and use it in GitHub Desktop.
using selenium-webdriver and mocha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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