deer-flow/.github/workflows/e2e-tests.yml
Eilen Shin 81de0761ed
feat: improve file attachments and add Office artifact previews (#8009)
* feat(frontend): improve file attachment recovery and artifact presentation

* feat(extensions): add Office artifact previews with search and navigation

* fix: preserve public viewers and HTTP Office previews

* fix: address file preview and upload review findings

* fix: use typed upload errors and linear bookmark allocation

* fix(office-preview): isolate parsing and bound preview resources

* fix(ci): install Office preview fixture dependencies for E2E

* fix(ci): provision matching Playwright browsers before E2E tests

* fix(ci): isolate Python libraries and include Office documentation

* test(frontend): wait for download status to finish rendering
2026-11-12 20:30:17 +08:00

141 lines
4.8 KiB
YAML

name: E2E Tests
on:
push:
branches: [ 'main', '*-dev' ]
paths:
- 'frontend/**'
- 'backend/app/gateway/routers/plugins.py'
- 'backend/extension_test_fixtures/bookmark_plugin_gateway.py'
- 'backend/extension_test_fixtures/browser_asset_gateway.py'
- 'backend/packages/extension-api/**'
- 'backend/packages/harness/deerflow/extensions/**'
- 'backend/packages/harness/deerflow/config/plugin_settings.py'
- 'backend/pyproject.toml'
- 'backend/uv.lock'
- 'examples/deerflow-extension-bookmarks/**'
- 'examples/deerflow-extension-office-preview/**'
- '.github/workflows/e2e-tests.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'frontend/**'
- 'backend/app/gateway/routers/plugins.py'
- 'backend/extension_test_fixtures/bookmark_plugin_gateway.py'
- 'backend/extension_test_fixtures/browser_asset_gateway.py'
- 'backend/packages/extension-api/**'
- 'backend/packages/harness/deerflow/extensions/**'
- 'backend/packages/harness/deerflow/config/plugin_settings.py'
- 'backend/pyproject.toml'
- 'backend/uv.lock'
- 'examples/deerflow-extension-bookmarks/**'
- 'examples/deerflow-extension-office-preview/**'
- '.github/workflows/e2e-tests.yml'
concurrency:
group: e2e-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
e2e-tests:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
# Keep the image version aligned with frontend/pnpm-lock.yaml. Browsers and
# OS libraries are installed together, without per-shard CDN downloads.
container:
image: mcr.microsoft.com/playwright:v1.62.1-noble
options: --ipc=host
env:
# The host tool cache can contain Python built for a newer OpenSSL than
# this image. uv's standalone Python carries compatible runtime libraries.
UV_PYTHON_PREFERENCE: only-managed
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
# Keep aligned with backend/Dockerfile and other backend workflows.
version: "0.11.1"
- name: Install container-compatible Python
run: uv python install 3.12
- name: Install backend dependencies (bookmark plugin gateway)
working-directory: backend
run: |
uv sync --locked
uv run --no-sync python -c 'import ssl, sqlite3'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Enable Corepack
run: corepack enable
- name: Use pinned pnpm version
run: corepack prepare pnpm@10.26.2 --activate
- name: Install frontend dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile
# Playwright collects the resource suite before selecting a shard. Its
# synthetic Office fixtures use JSZip from the extension's locked install.
- name: Install Office preview test dependencies
working-directory: examples/deerflow-extension-office-preview
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Verify Playwright Chromium
working-directory: frontend
id: chromium
run: >-
node --input-type=module -e
'import { chromium } from "@playwright/test";
const browser = await chromium.launch();
await browser.close();'
- name: Run E2E tests
working-directory: frontend
run: >-
pnpm exec playwright test
--shard=${{ matrix.shard }}/4
--workers=1
--reporter=github,html
--output=test-results/e2e
env:
SKIP_ENV_VALIDATION: '1'
PLAYWRIGHT_HTML_OUTPUT_DIR: playwright-report/e2e
- name: Run auth recovery E2E tests
# Keep auth coverage unsharded and run it even if the first shard fails.
if: ${{ !cancelled() && matrix.shard == 1 && steps.chromium.outcome == 'success' }}
working-directory: frontend
run: >-
pnpm exec playwright test -c playwright.auth.config.ts
--reporter=github,html
--output=test-results/auth
env:
SKIP_ENV_VALIDATION: '1'
PLAYWRIGHT_HTML_OUTPUT_DIR: playwright-report/auth
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.shard }}
path: frontend/playwright-report/
retention-days: 7