https://github.com/aripalo/casperjs-e2e-testing
https://github.com/aripalo/casperjs-e2e-testing
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/aripalo/casperjs-e2e-testing
- Owner: aripalo
- Created: 2013-11-13T21:59:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T05:13:13.000Z (over 8 years ago)
- Last Synced: 2025-04-08T07:56:51.439Z (6 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CasperJS testing
Examples of using [CasperJS](http://casperjs.org/) for end-to-end testing where we load Google and do a search, then we test if we are on the right results page and did we get enough results.
## Prequisites
Requires [PhantomJS](http://phantomjs.org/) to be installed. You can check it by typing `phantomjs -v` in your terminal.
## Installation
Run `npm install` on this project's root folder
## Usage
You have 2 different ways of testing:
- [Pure CasperJS way](http://docs.casperjs.org/en/latest/testing.html) by running `casperjs test with-pure-casper.coffee`
- CasperJS with [Mocha](http://visionmedia.github.io/mocha/) & [Chai](http://chaijs.com/) via [CasperJS Mocha plugin](https://github.com/nathanboktae/mocha-casperjs) by running `mocha-casperjs with-casper-mocha-chai.coffee`Also for the sake of example, both CoffeeScript and vanilla JavaScript versions are provided.
## Jenkins CI integration
To integrate these end-to-end tests with Jenkins we use XUnit XML files.
For pure CasperJS, use:
`casperjs test with-pure-casper.coffee --xunit=xunit.xml`For CasperJS with Mocha plugin, use:
`mocha-casperjs --reporter=xunit with-casper-mocha-chai.coffee > xunit.xml`