Created
January 25, 2016 12:56
-
-
Save rorymckinley/dde1869d248b2ca0e49f to your computer and use it in GitHub Desktop.
The mocha-casperjs equivalent to Hello World
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 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