Playwright tests for vault-web
.
npm install
npx playwright install
You need to generate vault-wasm-nodejs
to run the tests. See section vault-wasm-nodejs
in vault-wasm
README.md section.
cd ../vault-wasm
wasm-pack build --target nodejs --out-dir ../vault-web-tests/vault-wasm-nodejs --out-name vault-wasm
./fix-helpers-nodejs.sh ../vault-web-tests/vault-wasm-nodejs
scripts/use-fake-remote.sh ../vault-web/public/config.json
scripts/use-fake-remote.sh ../vault-web/dist/config.json
Before running tests you need to make sure vite
is running in vault-web
:
cd ../vault-web
vite
Run tests:
# Runs the end-to-end tests (headless).
npx playwright test
# Runs the end-to-end tests (non-headless).
npx playwright test --headed
# Starts the interactive UI mode.
npx playwright test --ui
# Runs the tests only on Desktop Chrome.
npx playwright test --project=chromium
# Runs the tests in a specific file.
npx playwright test example
# Runs the tests in debug mode.
npx playwright test --debug
# Auto generate tests with Codegen.
npx playwright codegen
npx ts-node helpers/webVaultClientExample.ts