Skip to content

Instantly share code, notes, and snippets.

@Spoygg
Created May 10, 2013 09:39
  • Star 13 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Spoygg/5553460 to your computer and use it in GitHub Desktop.
describe('Test example.com', function(){
before(function(done) {
client.init().url('http://example.com', done);
});
describe('Check homepage', function(){
it('should see the correct title', function(done) {
client.getTitle(function(err, title){
expect(title).to.have.string('Example Domain');
done();
});
});
it('should see the body', function(done) {
client.getText('p', function(err, p){
expect(p).to.have.string(
'for illustrative examples in documents.'
);
done();
})
});
});
after(function(done) {
client.end();
done();
});
});
@marco-faustinelli
Copy link

This gist should be engraved in stone or cast in bronze, because of its importance... THANK YOU!!!!
(coming here from http://code.tutsplus.com/tutorials/headless-functional-testing-with-selenium-and-phantomjs--net-30545 - otherwise a GREAT TUTORIAL page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment