e8e38e911b
For reasons I don't understand, it appears that in Travis CI we're now seeing errors using Casper that seem to correspond to a compatibility issue introduced in PhantomJS 2, even though we're still using 1.9.8. The solution for that compatability issue of patching casper's bootstrap.js to get arguments from system.args at a slightly different time than before seems to work in our setting as well, and that's what this implements. Probably the right long-term solution involves upgrading both phantomjs and Casper to the latest versions. |
||
---|---|---|
.. | ||
batchbin | ||
bin | ||
modules | ||
rpm | ||
rubybin | ||
samples | ||
tests | ||
.gitignore | ||
.gitmodules | ||
.jshintconfig | ||
.jshintignore | ||
.travis.yml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
CONTRIBUTORS.md | ||
LICENSE.md | ||
README.md | ||
casperjs.gemspec | ||
package.json |
README.md
CasperJS
CasperJS is a navigation scripting & testing utility for PhantomJS. It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntaxic sugar for doing common tasks such as:
- defining & ordering navigation steps
- filling forms
- clicking links
- capturing screenshots of a page (or an area)
- making assertions on remote DOM
- logging & events
- downloading base64 encoded resources, even binary ones
- catching errors and react accordingly
- writing functional test suites, exporting results as JUnit XML (xUnit)
Browse the sample examples repository. Don't hesitate to pull request for any cool example of yours as well!
Read the full documentation on casperjs dedicated website.
Subscribe to the project mailing-list
Follow the CasperJS project on twitter and Google+.
Show me some code!
Sample test to see if some dropdown can be opened:
casper.start('http://twitter.github.com/bootstrap/javascript.html#dropdowns', function() {
this.test.assertExists('#navbar-example');
this.click('#dropdowns .nav-pills .dropdown:last-of-type a.dropdown-toggle');
this.waitUntilVisible('#dropdowns .nav-pills .open', function() {
this.test.pass('Dropdown is open');
});
});
casper.run(function() {
this.test.done();
});
Run the script:
Contributing
Contributing code
Please read the CONTRIBUTING.md file contents.
Contributing documentation
CasperJS's documentation is written using the Markdown format, and hosted on Github thanks to the Github Pages Feature.
To view the source files on github, head to the gh-pages branch, and check the documentation's README for further instructions.