Skip to content

Cypress Testing

Christopher Savan edited this page May 11, 2021 · 3 revisions

Note: Updated May 2021

Currently, we run our tests using Cypress, a JavaScript end-to-end testing framework.
Here is the link to the essential methods and code examples:
https://docs.cypress.io/api/table-of-contents

Run Tests

  1. Navigate to the "client" directory and run npm start
  2. Navigate to the "server" directory and run node app.js
  3. ssh into the ALL server (involves port-forwarding)
  4. Navigate to the root directory (where the "client", "server", and "cypress" directories are on the same level) and run npm test. The Cypress UI will open.
  5. Click on any test you wish to run.

Testing File Structure

  • Write all test files that you intend to directly run in the integration directory
  • Place all environment variables in cypress.json
  • Place all mock data in fixtures/data.json
  • All reusable code / functions go in either support/commands.js or plugins/index.js (this will help a lot!)
  • The "integrations/examples" directory came from the initial installation of Cypress. There is no need to change these files; they are used solely for inspiration.