Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.92 KB

use-cypress.md

File metadata and controls

46 lines (32 loc) · 1.92 KB
layout title parent grand_parent nav_order
default
How to use Cypress
Testing
Guides
20

How to use Cypress

{: .no_toc }

Advices and "must-know" things regarding Cypress usage.

{% include page-toc.md %}


Overview

Cypress is a tool that helps performing end-to-end (E2E) tests that aim at testing the UI and the user workflows.

It is open source and free to use from the command line (doesn't count as Tests recording).

Several utility scripts have been configured to help with E2E testing, each script takes an optional CYPRESS_STAGE environment variable, which defines the config file (in cypress/) that will be used (development by default):

  • yarn e2e:open: Runs the test suite in a local browser
    • Requires Cypress to be installed first using yarn e2e:install
    • Targets localhost development website. (uses cypress/config-development.json)
  • yarn e2e:run: Runs the test suite in a local console
    • Targets localhost development website. (uses cypress/config-development.json)

It is also possible to test all the apps at once:

  • yarn e2e:all:production: This will run each production e2e test run (in series, parallel is not free)

We used the following Cypress <> Next.js tutorial to get started.

Note that our current installation doesn't provide test coverage. It's a bit harder to setup, here is a tutorial if ever needed.

Resources