Skip to content

Instantly share code, notes, and snippets.

@rorymckinley
Created January 25, 2016 12:56
Show Gist options
  • Save rorymckinley/dde1869d248b2ca0e49f to your computer and use it in GitHub Desktop.
Save rorymckinley/dde1869d248b2ca0e49f to your computer and use it in GitHub Desktop.
The mocha-casperjs equivalent to Hello World
var expect = require("chai").expect
describe('Duck Duck Go', function() {
before(function() {
casper.start('http://www.duckduckgo.com/');
})
it('checks for the correct title', function() {
casper.then(function() {
expect(this.getTitle()).to.equal("DuckDuckGo");
expect(this.exists("#search_form_input_homepage")).to.equal(true);
});
});
it('wiat for the element to appear', function() {
casper.waitForSelector("#search_form_input_homepage", function() {
"#search_form_input_homepage".should.be.inDOM;
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment