Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 2.42 KB

README.md

File metadata and controls

85 lines (57 loc) · 2.42 KB

Cypress Tests

This project has the tests using cypress for app frontend that is running locally.

Getting Started

These instructions will get you run the integration tests on altinn-app-frontend.

Install dependencies / prerequisites

    yarn --immutable # only needed first time, or when dependencies are updated

If you are running locally you need a copy of app-localtest. - Make sure you have followed instructions on running apps locally.

Running tests against a remote environment

  1. Start your local development server for app-frontend-react:
    yarn start
  1. Run the tests against a remote environment:
    yarn run cy:test:all -e environment=tt02

Other remote environments could also be used (see e2e/config/*.json).

Running tests locally

  1. Clone the apps ( ttd/frontend-test, ttd/anonymous-stateless-app, ttd/stateless-app, ttd/signing-test, and ttd/expression-validation-test ) to be tested.

  2. Create (or update) .env file with the correct paths (see template.env)

  3. To start localtest, app frontend, and the app you configured above, run the command below. (Skip to step 4 if the solutions are already running). The command will not finish, but it will start the app-frontend server in development mode. This command may take some time, depending on if LocalTest has been setup earlier or not, and if the docker cache is hit or not. When the output of this command seems to have stopped, you can continue to the next step.

    yarn run cy:before:appfrontend
  1. Start the tests for a given app from a new terminal:
    yarn run cy:test:frontend -e environment=local

or

    yarn run cy:test:stateless -e environment=local

or

    yarn run cy:test:stateless-anonymous -e environment=local

or

    yarn run cy:test:signing -e environment=local

Running a single test

To run a single test case open cypress runner using

    yarn run cy:open -e environment=<environment>