Skip to content
Merged
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
24 changes: 20 additions & 4 deletions .github/workflows/playwright-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci

# Unit tests run under Vitest in a jsdom environment — hermetic, so they
# need neither the database nor a browser. Run them before the e2e-only
# setup so a DB/browser problem can't mask a unit result.
- name: Run Unit Tests
run: npx vitest run

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

Expand All @@ -60,12 +66,22 @@ jobs:
- name: Initialize Database
run: node scripts/init-db.js

- name: Run Unit Tests
run: npx playwright test tests/unit --project=chromium
# The e2e suite drives the real front-end at `/`, which the server renders
# from build/index.pug. Without this build step the route 500s, every test
# times out waiting for window.mmgisAPI, and the job is cancelled at the
# 20-minute cap. Build must run before the tests start the server.
- name: Build frontend
# GitHub Actions auto-sets CI=true, which makes react-scripts promote all
# build warnings to errors. MMGIS ships several intentional warnings (the
# optional dist/ theme assets and the unshipped AOI counties/cities geojson
# dirs loaded via require.context). The production Dockerfile builds with CI
# unset, so mirror that here — otherwise the build fails on non-fatal warnings.
run: npm run build
env:
CI: false

- name: Run E2E Tests
run: npx playwright test tests/e2e --project=chromium
continue-on-error: true

- name: Upload test results
if: always()
Expand Down
Loading
Loading