Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.72 KB

README.md

File metadata and controls

35 lines (23 loc) · 1.72 KB

Browser testing

Our browser tests are based on Cypress. We are using End-to-End (E2E) tests. To get an overview of Cypress, we recommend going through their very extensive and well-written guides, especially Writing your first test and Introduction to Cypress.

Running the tests

The tests are automatically run by the CI environment.

To run them locally, you can use the Cypress test runner. Make sure you have the correct dependencies installed by running: yarn cypress verify. Known dependencies for Ubuntu: libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1.

If you want to, you can override the launch URLs:

export CYPRESS_baseUrl='http://localhost:1314'

Then, open the test runner:

yarn cypress open --e2e --browser electron

Production tests

To run tests against the production site, you need to make sure to set the correct base URL and environment:

export CYPRESS_baseUrl='https://www.datarequests.org'
export CYPRESS_baseUrl_DE='https://www.datenanfragen.de'
export CYPRESS_ENVIRONMENT=production

If you are writing a test that doesn't work in production, you can then use skipOn(isOn('production')) to skip it for production tests after importing import { isOn, skipOn } from '@cypress/skip-test'. See the @cypress/skip-test README for more details.

TODO: Change to skipOn('production') once the plugin actually behaves as documented, see: cypress-io/cypress-skip-test#41