Wiki/.github/workflows/e2e.yml
Corentin JOGUET e9695450ef
Some checks are pending
CI / Lint bridge (Biome) (push) Waiting to run
CI / Type-check bridge (push) Blocked by required conditions
CI / Tests unit bridge (push) Blocked by required conditions
CI / Tests integration bridge (push) Blocked by required conditions
CI / Security scan (push) Waiting to run
CI / Docker build + healthcheck (push) Blocked by required conditions
E2E Playwright / Playwright e2e (chromium) (push) Waiting to run
test(e2e): add Playwright cross-stack tests for R3.1.e database-view
7 scenarios covering the full bridge+DocAdenice+Baserow chain:
auth login, database-view insert, inline edit persistence, SSE realtime
update (no reload), RBAC write-denied, kanban drag-drop, calendar reschedule.

Includes docker-compose.e2e.yml (Postgres+Redis+Baserow+bridge+DocAdenice),
playwright.config.ts (3 projects: chromium/firefox/webkit), auth+baserow+cleanup
fixtures, global setup (API login + Baserow seed), and GitHub Actions e2e.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 00:37:23 +02:00

148 lines
5.2 KiB
YAML

name: E2E Playwright
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
name: Playwright e2e (chromium)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
# ------------------------------------------------------------------
# Build e2e stack
# ------------------------------------------------------------------
- name: Create .env.e2e (CI defaults — no real secrets)
run: |
cat > .env.e2e << 'EOF'
E2E_DOCMOST_APP_SECRET=ci_docmost_app_secret_32chars_min_xx
E2E_DOCMOST_URL=http://localhost:5173
E2E_DOCMOST_SERVER_URL=http://localhost:3001
E2E_DOCMOST_DB_NAME=docmost_e2e
E2E_DOCMOST_DB_USER=docmost
E2E_DOCMOST_DB_PASSWORD=docmost_e2e_password
E2E_ADMIN_EMAIL=admin@acadenice-e2e.local
E2E_ADMIN_PASSWORD=E2eAdminPassword123!
E2E_READER_EMAIL=reader@acadenice-e2e.local
E2E_READER_PASSWORD=E2eReaderPassword123!
E2E_BASEROW_URL=http://localhost:8081
E2E_BASEROW_ADMIN_EMAIL=admin@acadenice-e2e.local
E2E_BASEROW_ADMIN_PASSWORD=E2eAdminPassword123!
E2E_BASEROW_API_TOKEN=e2e_baserow_token_placeholder
E2E_BRIDGE_API_TOKENS=[{"token":"brg_e2e_admin","name":"e2e-admin","scopes":["admin:*"]}]
E2E_BASEROW_WEBHOOK_SECRET=e2e_webhook_secret_32_chars_minimum_x
E2E_LOG_LEVEL=warn
EOF
- name: Build bridge Docker image
run: docker build -t formation-hub-bridge:e2e ./bridge
- name: Start e2e stack
run: |
docker compose \
-f docker-compose.e2e.yml \
--env-file .env.e2e \
up -d --wait
timeout-minutes: 10
- name: Wait for all healthchecks to pass
run: |
echo "Checking service health..."
for service in e2e-postgres e2e-redis e2e-baserow e2e-bridge e2e-docadenice-server e2e-docadenice-client; do
status=$(docker inspect --format='{{.State.Health.Status}}' "formation-hub-e2e-${service}-1" 2>/dev/null || echo "unknown")
echo " ${service}: ${status}"
done
- name: Show docker compose status
if: always()
run: docker compose -f docker-compose.e2e.yml ps
# ------------------------------------------------------------------
# Playwright setup
# ------------------------------------------------------------------
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: e2e/package.json
- name: Install e2e dependencies
working-directory: e2e
run: npm install
- name: Install Playwright browsers (chromium only for CI)
working-directory: e2e
run: npx playwright install --with-deps chromium
# ------------------------------------------------------------------
# Run tests
# ------------------------------------------------------------------
- name: Run Playwright e2e tests (chromium)
working-directory: e2e
env:
CI: true
E2E_DOCMOST_URL: http://localhost:5173
E2E_DOCMOST_SERVER_URL: http://localhost:3001
E2E_BASEROW_URL: http://localhost:8081
E2E_BRIDGE_URL: http://localhost:4001
E2E_ADMIN_EMAIL: admin@acadenice-e2e.local
E2E_ADMIN_PASSWORD: E2eAdminPassword123!
E2E_READER_EMAIL: reader@acadenice-e2e.local
E2E_READER_PASSWORD: E2eReaderPassword123!
E2E_BASEROW_ADMIN_EMAIL: admin@acadenice-e2e.local
E2E_BASEROW_ADMIN_PASSWORD: E2eAdminPassword123!
run: npx playwright test --project=chromium
# ------------------------------------------------------------------
# Artifacts
# ------------------------------------------------------------------
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-results-${{ github.run_id }}
path: e2e/test-results/
retention-days: 7
- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ github.run_id }}
path: e2e/playwright-report/
retention-days: 7
# ------------------------------------------------------------------
# Teardown
# ------------------------------------------------------------------
- name: Collect Docker logs on failure
if: failure()
run: |
docker compose -f docker-compose.e2e.yml logs --tail=500 > /tmp/e2e-docker-logs.txt 2>&1 || true
- name: Upload Docker logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-logs-${{ github.run_id }}
path: /tmp/e2e-docker-logs.txt
retention-days: 7
- name: Teardown e2e stack
if: always()
run: |
docker compose -f docker-compose.e2e.yml down -v || true