@@ -11,17 +11,23 @@ This repository provides:
11111 . ** E2E test suite** for wallet-frontend and go-wallet-backend integration
12122 . ** Reusable GitHub Action** for CI/CD pipelines
13133 . ** PRF mock** that works around Chrome CDP limitations
14- 4 . ** Version matrix testing** for compatibility verification
14+ 4 . ** Multi-tenancy tests** for tenant isolation verification
15+ 5 . ** Trust API tests** for discover and trust functionality
1516
1617## Quick Start
1718
1819``` bash
1920# Install dependencies
20- npm install
21- npx playwright install chromium
21+ make install
2222
23- # Run tests (servers must be running)
24- npm test
23+ # Start test environment
24+ make up
25+
26+ # Run all tests
27+ make run
28+
29+ # Stop environment
30+ make down
2531```
2632
2733## CI/CD Integration
@@ -58,50 +64,48 @@ See [docs/CI.md](docs/CI.md) for detailed CI integration documentation.
5864
5965## Local Development
6066
61- ### Option 1: Manual server setup
62-
63- Start servers manually and run tests:
67+ ### Using Make Targets (Recommended)
6468
6569` ` ` bash
66- # Terminal 1: Start backend
67- cd ../go-wallet-backend
68- RP_ORIGIN=http://localhost:3000 go run ./cmd/server/...
70+ # Show all available targets
71+ make help
72+
73+ # Install dependencies and Playwright
74+ make install
75+
76+ # Start the test environment (Docker Compose)
77+ make up
6978
70- # Terminal 2: Start frontend
71- cd ../wallet-frontend
72- VITE_WALLET_BACKEND_URL=http://localhost:8080 npm run dev
79+ # Check service status
80+ make status
7381
74- # Terminal 3: Run tests
75- cd wallet-e2e-tests
76- npm test
82+ # Run all tests
83+ make run
84+
85+ # View service logs
86+ make logs
87+
88+ # Stop the environment
89+ make down
90+
91+ # Full CI cycle (up + run + down)
92+ make ci-docker
7793```
7894
79- ### Option 2: Makefile automation
95+ ### Debug Options
8096
8197``` bash
82- # Clone and test specific git refs
83- make setup-git FRONTEND_REF=master BACKEND_REF=main
84- make test
85- make teardown
86-
87- # Or test from existing local checkouts
88- make setup-local FRONTEND_PATH=../wallet-frontend BACKEND_PATH=../go-wallet-backend
89- make test
90- make teardown
91-
92- # Quick start (skip npm install if node_modules exists)
93- make setup-local-quick FRONTEND_PATH=../wallet-frontend BACKEND_PATH=../go-wallet-backend
98+ make test-headed # Run with visible browser
99+ make test-debug # Run with debugger attached
100+ make test-ui # Open Playwright UI
94101```
95102
96- ** Note:** The setup scripts automatically use ` npm install --legacy-peer-deps ` to handle
97- peer dependency conflicts in the wwWallet frontend with newer TypeScript versions.
103+ ### Configuration Variables
98104
99- ### Option 3: Docker
105+ Pass variables to customize the environment:
100106
101107``` bash
102- docker-compose up -d
103- npm test
104- docker-compose down
108+ make run FRONTEND_URL=http://custom:3000 BACKEND_URL=http://custom:8080
105109```
106110
107111## Test Structure
@@ -116,35 +120,41 @@ wallet-e2e-tests/
116120├── helpers/
117121│ └── webauthn.ts # WebAuthn/PRF helper
118122├── specs/
119- │ ├── api/ # API compatibility tests
123+ │ ├── api/ # API tests (discover, trust, verifier)
120124│ ├── authenticated/ # Authenticated flow tests
121125│ ├── diagnostics/ # Diagnostic tests
122126│ ├── full-flow/ # Complete flow tests
123127│ ├── login/ # Login tests
128+ │ ├── multi-tenancy/ # Multi-tenancy tests
124129│ ├── prf/ # PRF mock tests
125130│ └── registration/ # Registration tests
126131├── scripts/
127132│ ├── run-matrix.sh # Version matrix testing
128133│ └── setup-local.sh # Local dev setup
129- ├── docker-compose.yml # Docker configuration
130- ├── Makefile # Build automation
131- └── playwright.config.ts # Playwright config
134+ ├── docker-compose.yml # Docker configuration
135+ ├── docker-compose.test.yml # Full test environment
136+ ├── Makefile # Build automation
137+ └── playwright.config.ts # Playwright config
132138```
133139
134- ## Test Tags
140+ ## Test Categories
135141
136- Run specific test categories :
142+ Tests are organized by functionality :
137143
138- ``` bash
139- npm run test:prf # @prf - PRF extension tests
140- npm run test:registration # @registration - Registration flows
141- npm run test:login # @login - Login flows
142- ```
144+ | Directory | Description |
145+ | -----------| -------------|
146+ | ` specs/api/ ` | API tests (discover, trust, verifier) |
147+ | ` specs/multi-tenancy/ ` | Tenant isolation tests |
148+ | ` specs/registration/ ` | Registration flow tests |
149+ | ` specs/login/ ` | Login flow tests |
150+ | ` specs/prf/ ` | PRF extension tests |
151+ | ` specs/full-flow/ ` | Complete flow tests |
143152
144- Or use Playwright grep:
153+ Run specific tests with Playwright grep:
145154
146155``` bash
147- npx playwright test --grep " @full-flow"
156+ npx playwright test --grep " @multi-tenancy"
157+ npx playwright test specs/api/
148158```
149159
150160## PRF Mock
@@ -166,10 +176,11 @@ test.beforeEach(async ({ page }) => {
166176| ----------| ---------| -------------|
167177| ` FRONTEND_URL ` | ` http://localhost:3000 ` | Frontend URL |
168178| ` BACKEND_URL ` | ` http://localhost:8080 ` | Backend URL |
169- | ` FRONTEND_PATH ` | ` ../wallet-frontend ` | Frontend repo path |
170- | ` BACKEND_PATH ` | ` ../go-wallet-backend ` | Backend repo path |
171- | ` FRONTEND_REF ` | ` master ` | Frontend git ref |
172- | ` BACKEND_REF ` | ` main ` | Backend git ref |
179+ | ` ADMIN_URL ` | ` http://localhost:8081 ` | Admin API URL |
180+ | ` ADMIN_TOKEN ` | (required for multi-tenancy) | Admin API authentication token |
181+ | ` MOCK_ISSUER_URL ` | ` http://localhost:9000 ` | Mock issuer URL |
182+ | ` MOCK_VERIFIER_URL ` | ` http://localhost:9001 ` | Mock verifier URL |
183+ | ` MOCK_PDP_URL ` | ` http://localhost:9091 ` | Mock PDP URL |
173184
174185## Backend Configuration
175186
0 commit comments