Actual on the web
E2E tests
E2E (end-to-end) tests use Playwright. Running them requires an Actual server to be running either locally or on a remote server.
Functional
Running against the local server:
yarn start
yarn e2e
Running against a remote server:
E2E_START_URL=http://my-remote-server.com yarn e2e
Visual regression
Visual regression tests (also known as screenshot tests) check that the visual appearance of the product has not regressed. Each environment has slightly different colors, fonts etc. Mac differs from Windows which differs from Linux. In order to have a stable test environment for visual comparisons - you must use a standartised docker container. This ensures that the tests are always ran in a consistent environment.
Prerequisites:
Running against the local server
First start a dev instance:
HTTPS=true yarn start
or using the dev container:
HTTPS=true docker compose up --build
Note the network IP address and port the dev instance is listening on.
Next, navigate to the root of your project folder, run the standardized docker container, and launch the visual regression tests from within it.
Run via yarn:
yarn vrt:docker
yarn vrt:docker --e2e-start-url https://ip:port
yarn vrt:docker --e2e-start-url https://ip:port --update-snapshots
Run manually:
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.56.0-jammy /bin/bash
docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.56.0-jammy /bin/bash
E2E_START_URL=https://ip:port yarn vrt
E2E_START_URL=https://ip:port yarn vrt --update-snapshots
Running against a remote server
You can also run the tests against a remote server by passing the URL:
Run in standardized docker container:
E2E_START_URL=https://my-remote-server.com yarn vrt:docker
yarn vrt:docker --e2e-start-url https://my-remote-server.com
Run locally:
E2E_START_URL=https://my-remote-server.com yarn vrt