Provides a REST API to execute headless browser tests, which can then be used like uptime checks
npm install
.env.sample
to .env
and fill in account numbers for testsWrite CasperJS scrapers using the CasperJS testing framework.
Place any sensitive variables in .env
to omit them from source control.
Several utilities are provided to easily test these scrapers while developing, since it would be a pain to have to run the server each time and request an endpoint in the browser over and over.
> npm run test -- <test name>
Loads the environment variables from .env
and runs the provided test using --ignore-ssl-errors=true
> npm run capture
Runs a web server at localhost:8002
that listens
for screenshots from CasperJS tests. To have your tests send screenshots, include require('../capture')(300)
at the top, as seen in water-commercial.js
> npm run server
Runs a web server with GET
paths created for each test, using the name of the file without the file extension.
For instance, http://<domain>.com/water-commercial
.
The request will respond with a status code of 200
if the test passes and 500
if it fails, along with
the output of the CasperJS test.