Skip to content

Latest commit

 

History

History
executable file
·
87 lines (57 loc) · 2.53 KB

README.md

File metadata and controls

executable file
·
87 lines (57 loc) · 2.53 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

This is only needed the first time, or when dependencies are updated:

yarn --immutable

Please refer to Linux Prerequisites to run Cypress on Linux/Wsl.

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:
npx cypress run --env environment=tt02 -s 'test/e2e/integration/*/*.ts'

Running tests locally

  1. Clone app-localtest and follow the instructions in the README to start the local environment.

  2. Clone one or more of the apps we've made automatic tests for:

  1. Start the app you want to test:
cd <app-folder>/App
dotnet run
  1. Start the tests for a given app:

If you ran app-localtest with Docker:

npx cypress run --env environment=docker -s 'test/e2e/integration/frontend-test/*.ts'

If you ran app-localtest with podman:

npx cypress run --env environment=podman -s 'test/e2e/integration/frontend-test/*.ts'
  1. Stop the running app (using Ctrl+C in the terminal where it's running) and repeat step 3 and 4 for the next app you want to test.

Running a single test/opening the Cypress runner

To run a single test case, open the Cypress runner using:

npx cypress open --env environment=<environment>

Then click on the test you want to run.

Tip: Most test files contain multiple test cases. You can run a single test case by adding .only to the it function in the test file. Be sure not to commit this change.

- it('should do something', () => {
+ it.only('should do something', () => {