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
61 changes: 61 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Playwright E2E Tests

on:
push:
branches:
- main
pull_request:

jobs:
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Build web bundle
run: npm run web:build
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
EXPO_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
EXPO_PUBLIC_SUPABASE_URL: ${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}

- name: Start app server
run: npx serve dist -l 3000 &
env:
CI: true

- name: Wait for server to be ready
run: npx wait-on http://localhost:3000 --timeout 60000

- name: Run Playwright tests
run: npm run test:e2e
env:
CI: true

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 30
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ app-example
/android

.env.local

# Playwright
test-results/
playwright-report/
playwright/.cache/
Loading