docling-studio/e2e/src/test/resources/documents/size-validation.feature
Pier-Jean Malandrino cfc5bb5c35 feat: add E2E API tests with Karate V2
Set up a full E2E test suite (39 scenarios) using Karate against
the real API stack. Hybrid architecture: domain-based features +
cross-domain workflows, with data-driven testing and callable helpers.

Structure:
- e2e/pom.xml: Maven + karate-core 1.5
- 3 helpers (upload, analyze+poll, cleanup)
- 3 JSON schemas (health, document, analysis)
- 12 feature files across health, documents, analyses, workflows
- Tags: @smoke (2), @regression (35), @e2e (2)
- generate-test-data.py: fpdf2-based PDF generation (no binaries)

Also adds:
- RATE_LIMIT_RPM env var to make rate limiter configurable (0=disabled)
- CI job e2e with needs: [backend, frontend]
- e2e/ in .dockerignore

Closes #119
2026-04-08 13:47:03 +02:00

22 lines
735 B
Gherkin

@regression
Feature: Document size validation
Background:
* url baseUrl
Scenario: File within size limit is accepted
Given path '/api/documents/upload'
And multipart file file = { read: 'classpath:common/data/generated/small.pdf', filename: 'small.pdf', contentType: 'application/pdf' }
When method POST
Then status 200
And match response.id == '#string'
# Cleanup
* def docId = response.id
* call read('classpath:common/helpers/cleanup.feature') { docId: '#(docId)' }
Scenario: Health endpoint exposes max file size
Given path '/api/health'
When method GET
Then status 200
# maxFileSizeMb is present when > 0
And match response.maxFileSizeMb == '#? _ == null || _ > 0'