1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-04 02:18:00 +01:00
vaultwarden/playwright
2024-06-25 16:52:32 +02:00
..
tests Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
.gitignore Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
global-setup.ts Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
global-utils.ts Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
package-lock.json Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
package.json Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
playwright.config.ts Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
README.md Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00
test.env Add playwright create/login test for all db 2024-06-25 16:52:32 +02:00

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

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"