Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Document e2e tests

Josiah Sprague8cc86f21a694
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bfc1d8281..b91e390ed 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -24,9 +24,39 @@ If you want to submit your own contributions, follow these steps;
We ask that you follow these guidelines with your contributions;
-### Tests
+### Unit Tests
-All of the automated tests for this project need to pass before your submission will be accepted. You can run `npm test` in the command line after making changes to verify that the tests pass. If you add new functionality, please consider adding tests for that functionality as well.
+All of the unit tests for this project need to pass before your submission will be accepted. You can run `npm test` in the command line after making changes to verify that the tests pass. If you add new functionality, please consider adding tests for that functionality as well.
+
+### End-to-end Tests
+
+You can run the included end-to-end tests to test the app in Chrome and Firefox. The tests run the Cucumber features in the `./e2e/features` using Nightwatch and Selenium.
+
+To run tests in Chrome;
+
+1) Run `npm run e2e:chrome`
+
+To run tests in Firefox;
+
+1) [Create a new Firefox profile](https://developer.mozilla.org/en-US/Firefox/Multiple_profiles) called 'nightwatch'
+2) Run `npm run e2e:firefox`
+
+You can run tests for both browsers in sequence by running `npm run e2e`,
+
+To run tests in Browserstack;
+
+1) Log into your [Browserstack automation](https://www.browserstack.com/automate) and get your username and access key from the upper left
+2) Set these environmental variables in your shell;
+ - `export BROWSERSTACK_ACCESS_KEY=yourkeyhere`
+ - `export BROWSERSTACK_USER=yourusernamehere`
+3) Configure `./e2e/environments.json` with the browsers you want to test.
+4) Run `npm run browserstack`
+
+#### End-to-end Test Reports
+
+After running end-to-end tests, reports are generated and saved in `./e2e/reports`. You can convert these to HTML by running `npm run report <environment>` where `<environment>` is either the lowercase name of the browser for local tests (`chrome` or `firefox`) or the name of the Browserstack environment, such as `Chrome_61-0_OS_X_El_Capitan-1` (you can get this name from the JSON files in `./e2e/reports`).
+
+The end-to-end tests are a little bit flaky, so they aren't required to pass before a submission will be accepted, but you should run them and read through the results to make sure that you haven't broken any functionality. Please also consider adding end-to-end tests to cover any functionality you add.
### Commits