Skip to content

Fixes and feat additions #21

Fixes and feat additions

Fixes and feat additions #21

Workflow file for this run

name: E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel superseded runs on the same ref to save CI minutes.
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Cross-browser critical flows ───────────────────────────────────────────
e2e:
name: e2e (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
env:
CI: 'true'
NEXT_PUBLIC_API_URL: 'http://localhost:3000'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browser (${{ matrix.browser }})
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Run Playwright tests
run: npx playwright test --project=${{ matrix.browser }}
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report/
retention-days: 14
- name: Upload test results (traces/videos)
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.browser }}
path: test-results/
retention-days: 14
# ── Coverage report (Chromium V8 coverage) ─────────────────────────────────
coverage:
name: coverage
runs-on: ubuntu-latest
timeout-minutes: 30
env:
CI: 'true'
E2E_COVERAGE: '1'
NEXT_PUBLIC_API_URL: 'http://localhost:3000'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browser (chromium)
run: npx playwright install --with-deps chromium
- name: Run E2E with coverage collection
run: npx playwright test --project=chromium
- name: Generate coverage report
# Convert the raw V8 coverage into lcov + html. Non-blocking so a
# reporting hiccup never fails the pipeline.
continue-on-error: true
run: >-
npx -y monocart-coverage-reports@2
--input coverage/tmp
--report v8,lcovonly,console-summary
--outputDir coverage/report
- name: Upload coverage
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: e2e-coverage
path: coverage/
retention-days: 14