This project has the tests using cypress for app frontend that is running locally.
These instructions will get you run the integration tests on altinn-app-frontend.
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.
- Start your local development server for
app-frontend-react
:
yarn start
- 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
).
-
Clone the apps ( ttd/frontend-test, ttd/anonymous-stateless-app, ttd/stateless-app, ttd/signing-test, and ttd/expression-validation-test ) to be tested.
-
Create (or update)
.env
file with the correct paths (seetemplate.env
) -
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
- 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
To run a single test case open cypress runner using
yarn run cy:open -e environment=<environment>