Skip to content

e2e: WDS context filtering and management functionality (#2188) #25

e2e: WDS context filtering and management functionality (#2188)

e2e: WDS context filtering and management functionality (#2188) #25

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [main, dev]
paths:
- 'frontend/**'
pull_request:
branches: [main, dev]
paths:
- 'frontend/**'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
# Run tests on multiple browsers
browser: [chromium, firefox, webkit]
env:
WARMUP_BROWSER: ${{ matrix.browser }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci
- name: Init MSW worker
working-directory: ./frontend
run: npx msw init public/ --save
- name: Verify MSW worker exists
working-directory: ./frontend
run: ls -la public/mockServiceWorker.js || true
- name: Run TypeScript check
working-directory: ./frontend
run: npx tsc --noEmit
- name: Install Playwright Browsers
working-directory: ./frontend
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Verify Playwright installation
working-directory: ./frontend
run: npx playwright --version
- name: List available tests
working-directory: ./frontend
run: npx playwright test --list --project=${{ matrix.browser }} > /tmp/playwright_list.txt && head -5 /tmp/playwright_list.txt && rm /tmp/playwright_list.txt
- name: Build frontend
working-directory: ./frontend
env:
VITE_USE_MSW: 'true'
run: npm run build
- name: Run Playwright tests
working-directory: ./frontend
run: npx playwright test --project=${{ matrix.browser }}
env:
CI: true
VITE_USE_MSW: 'true'
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.browser }}
path: frontend/playwright-report/
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.browser }}
path: frontend/test-results/
retention-days: 7