Testing

This page describes how to run FixMyStreet’s test suite.

Server testing

You can run the test suite for the backend codebase by running the following command in the fixmystreet directory:

$ script/test

The master branch of the repository should always be passing all tests for our developers and on mySociety’s servers.

Client testing

To run the front-end tests, you will need to install Cypress using npm (not direct download):

npm install cypress@3.8.3

Make sure the cypress command is on your PATH. Then you can run the front-end tests headlessly using:

$ bin/browser-tests run

This uses its own test server and database, not affecting your development database. If you wish to run the tests interactively for debugging, use:

$ bin/browser-tests open

If you’re running FixMyStreet in a Vagrant box, you can use this script to run the test server in the VM and Cypress outside of it:

$ bin/browser-tests --vagrant run