Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-builder-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}

# Configure Workload Identity Federation and generate an access token
- id: 'auth'
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Run E2e Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

env:
PROJECT_ID: 'benefit-decision-toolkit-play'
WORKLOAD_IDENTITY_PROVIDER: 'projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github'

jobs:
run-e2e-tests:
runs-on: 'ubuntu-latest'

# Add these permissions for Workload Identity Federation
permissions:
contents: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*

# Devbox Setup #
- name: 'Create .env file' # Devbox needs a .env file to exist, even if it's empty
run: touch .env

- name: Rename env files
run: |
mv builder-frontend/.env.example builder-frontend/.env
mv builder-api/.env.example builder-api/.env

- name: 'Install devbox' # Setup devbox which includes Node.js, Firebase CLI, and Google Cloud SDK
uses: 'jetify-com/devbox-install-action@v0.12.0'
with:
enable-cache: true

# Cache Maven dependencies to speed up builds
- name: 'Cache Maven dependencies'
uses: 'actions/cache@v4'
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- id: 'auth' # Configure Workload Identity Federation and generate an access token
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com
project_id: ${{ env.PROJECT_ID }}

- name: Cache node modules
uses: actions/cache@v4
with:
path: builder-frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('builder-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install frontend dependencies
working-directory: builder-frontend
run: devbox run install-builder-frontend-ci

- name: Load E2E emulator data
run: |
rm -rf emulator-data
cp -r e2e/e2e-emulator-data emulator-data

- name: Run all Devbox services
run: devbox services up -b
continue-on-error: true

# E2E Testing #
- name: Install Playwright dependencies
run: npm ci
working-directory: e2e

- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: e2e

# - name: Wait for Firebase emulators to be available
# uses: nev7n/wait_for_response@v1
# with:
# url: 'http://localhost:4000/'
# responseCode: 200
# timeout: 90000
# interval: 1000
# continue-on-error: true

- name: Wait for App to be available
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:5173/'
responseCode: 200
timeout: 90000
interval: 1000
continue-on-error: true

- name: Run Playwright tests
run: npx playwright test
working-directory: e2e
continue-on-error: true

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 30

# Devbox Cleanup #
- name: Stop all Devbox services
run: devbox services stop
continue-on-error: true
3 changes: 2 additions & 1 deletion devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"firebase-tools@latest",
"google-cloud-sdk@latest",
"nodejs@22",
"bruno-cli@latest"
"bruno-cli@latest",
"process-compose@latest"
],
"env_from": ".env",
"shell": {
Expand Down
48 changes: 48 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,54 @@
}
}
},
"process-compose@latest": {
"last_modified": "2025-11-23T21:50:36Z",
"resolved": "github:NixOS/nixpkgs/ee09932cedcef15aaf476f9343d1dea2cb77e261#process-compose",
"source": "devbox-search",
"version": "1.78.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/d00iad83k88x0fq045h5pzhfj9ibdd3a-process-compose-1.78.0",
"default": true
}
],
"store_path": "/nix/store/d00iad83k88x0fq045h5pzhfj9ibdd3a-process-compose-1.78.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/zx59c11mchqfjpl0yvv2fad87pf3p8mn-process-compose-1.78.0",
"default": true
}
],
"store_path": "/nix/store/zx59c11mchqfjpl0yvv2fad87pf3p8mn-process-compose-1.78.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/hwipxpsgzpv8d51xvqdjyx3vbzaaf3rr-process-compose-1.78.0",
"default": true
}
],
"store_path": "/nix/store/hwipxpsgzpv8d51xvqdjyx3vbzaaf3rr-process-compose-1.78.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vw9d8v9r0kp44lmizysj7idmqyf9747l-process-compose-1.78.0",
"default": true
}
],
"store_path": "/nix/store/vw9d8v9r0kp44lmizysj7idmqyf9747l-process-compose-1.78.0"
}
}
},
"quarkus@latest": {
"last_modified": "2025-08-11T16:06:55Z",
"resolved": "github:NixOS/nixpkgs/4e942f9ef5b35526597c354d1ded817d1c285ef1#quarkus",
Expand Down
4 changes: 4 additions & 0 deletions e2e/.auth/user.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"cookies": [],
"origins": []
}
8 changes: 8 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
25 changes: 25 additions & 0 deletions e2e/e2e-emulator-data/auth_export/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"kind": "identitytoolkit#DownloadAccountResponse",
"users": [
{
"localId": "E2uB0h1FpSUKq5rGObr9jvmbn15E",
"lastLoginAt": "1766942325287",
"emailVerified": false,
"email": "test@example.com",
"salt": "fakeSaltirMZBjlsDBLmp2MfKjTv",
"passwordHash": "fakeHash:salt=fakeSaltirMZBjlsDBLmp2MfKjTv:password=testpassword123",
"passwordUpdatedAt": 1766942325288,
"validSince": "1766942325",
"createdAt": "1766942325287",
"providerUserInfo": [
{
"providerId": "password",
"email": "test@example.com",
"federatedId": "test@example.com",
"rawId": "test@example.com"
}
],
"lastRefreshAt": "2025-12-28T17:18:45.288Z"
}
]
}
1 change: 1 addition & 0 deletions e2e/e2e-emulator-data/auth_export/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"signIn":{"allowDuplicateEmails":false},"emailPrivacyConfig":{"enableImprovedEmailPrivacy":false}}
16 changes: 16 additions & 0 deletions e2e/e2e-emulator-data/firebase-export-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "14.11.2",
"firestore": {
"version": "1.19.8",
"path": "firestore_export",
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
},
"auth": {
"version": "14.11.2",
"path": "auth_export"
},
"storage": {
"version": "14.11.2",
"path": "storage_export"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions e2e/e2e-emulator-data/storage_export/buckets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"buckets": [
{
"id": "demo-bdt-dev.appspot.com"
}
]
}
97 changes: 97 additions & 0 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "e2e",
"version": "1.0.0",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@playwright/test": "^1.57.0",
"@types/node": "^24.10.1"
}
}
Loading
Loading