docling-studio/e2e/api/README.md
Pier-Jean Malandrino fdbab2f49e feat: add Karate UI e2e tests with data-e2e selectors (#124)
- Add e2e/ui/ as peer project to e2e/api/ (own pom.xml, runner, config)
- 5 critical UI journeys: upload, delete, analysis, batch-progress, rechunk
- 4 local-only tests: sidebar, i18n, error-states, pipeline-options
- 1 full happy path workflow covering all modes
- Add data-e2e attributes on all tested Vue components (decoupled from CSS)
- Add CONVENTIONS.md with 7 golden rules for writing Karate UI tests
- Update CI with dedicated e2e-ui job (Chrome headless, --no-sandbox)
- Update docs/contributing.md with UI test instructions

Closes #124
2026-04-08 17:53:52 +02:00

1.8 KiB

E2E API Tests — Karate

End-to-end API tests for Docling Studio using Karate.

Prerequisites

  • JDK 17+ (e.g. brew install openjdk@17)
  • Maven 3.9+ (e.g. brew install maven)
  • Python 3.12+ (for test data generation)
  • Docker (for running the full stack)

Quick start

# 1. Generate test PDFs (from repo root)
python e2e/generate-test-data.py

# 2. Start the stack
docker compose up -d --wait

# 3. Run all API tests
mvn test -f e2e/api/pom.xml

# 4. Tear down
docker compose down

Run by tag

# Smoke only (~30s)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @smoke"

# Regression (~2min)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @regression"

# Full E2E workflows (~5min)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @e2e"

Custom base URL

mvn test -f e2e/api/pom.xml -DbaseUrl=http://your-host:8000

Structure

e2e/api/
├── pom.xml                     # Maven + Karate dependency
├── src/test/java/
│   └── E2ERunner.java          # JUnit5 Karate runner
└── src/test/resources/
    ├── karate-config.js        # Base URL, timeouts, retry config
    ├── common/
    │   ├── helpers/            # Callable features (upload, analyze, cleanup)
    │   └── data/
    │       ├── schemas/        # JSON match schemas
    │       ├── test-cases/     # Data-driven JSON files
    │       └── generated/      # Generated PDFs (gitignored)
    ├── health/                 # @smoke
    ├── documents/              # @regression
    ├── analyses/               # @regression
    └── workflows/              # @e2e (cross-domain)

Reports

After a run, Karate HTML reports are in e2e/api/target/karate-reports/.