1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-16 04:12:53 +01:00
vaultwarden/playwright/README.md
2024-05-20 15:28:27 +02:00

1,6 KiB

OpenID Keycloak scenarios

This allows running integration tests using Playwright.
It usse its own test.env with different ports to not collide with a running dev instance.

Install

npm install
npx playwright install firefox

Usage

To run all the tests:

npx playwright test

To access the ui to easily run test individually and debug if needed:

npx playwright test --ui

DB

Projects are configured to allow to run tests only on specific database.
You can use:

npx playwright test --project sqllite
npx playwright test --project postgres
npx playwright test --project mysql

SSO

To run the SSO tests:

npx playwright test --project sso-sqllite

Additionnaly if you want you can keep the Keycloak docker-compose runnning with (its state is not impacted by the tests):

KC_KEEP_RUNNNING=true npx playwright test --project sso-sqllite

Running specific tests

To run a whole file you can :

npx playwright test --project=sqllite tests/login.spec.ts
npx playwright test --project=sqllite login

To run only a specifc test (It might fail if it has dependency):

npx playwright test --project=sqllite -g "Account creation"
npx playwright test --project=sqllite tests/login.spec.ts:16

Writing scenario

When creating new scenario use the recorder to more easily identify elements (in general try to rely on visible hint to identify elements and not hidden ids). This does not start the server, you will need to start it manually.

npx playwright codegen "http://127.0.0.1:8000"