Files
Stirling-PDF/testing/cucumber/features/analysis.feature
Anthony Stirling 0be10b2dff Cucumber concurrency validation plus fix (#7379)
# Description of Changes

cucumber tests to run multiple threads of commands at same time 

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### Translations (if applicable)

- [ ] I ran
[`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have run `task check` to verify linters, typechecks, and tests
pass
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing)
for more details.
2026-08-14 14:01:45 +01:00

210 lines
9.5 KiB
Gherkin

@analysis
Feature: Analysis API Endpoints
Analysis endpoints inspect a PDF and return structured JSON (HTTP 200).
No binary output is produced; all responses are application/json with
a non-empty body.
# ---------------------------------------------------------------------------
# /api/v1/analysis/page-count
# ---------------------------------------------------------------------------
@page-count @positive
Scenario Outline: page-count returns JSON with pageCount for different page numbers
Given I generate a PDF file as "fileInput"
And the pdf contains <pages> pages
When I send the API request to the endpoint "/api/v1/analysis/page-count"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
Examples:
| pages |
| 1 |
| 5 |
| 20 |
# ---------------------------------------------------------------------------
# /api/v1/analysis/basic-info
# ---------------------------------------------------------------------------
@basic-info @positive
Scenario: basic-info returns JSON for a standard PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 4 pages
When I send the API request to the endpoint "/api/v1/analysis/basic-info"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@basic-info @positive
Scenario: basic-info returns JSON for a single-page PDF
Given I generate a PDF file as "fileInput"
When I send the API request to the endpoint "/api/v1/analysis/basic-info"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@basic-info @positive
Scenario: basic-info returns JSON for a PDF with text content
Given I generate a PDF file as "fileInput"
And the pdf contains 3 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/basic-info"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/document-properties
# ---------------------------------------------------------------------------
@document-properties @positive
Scenario: document-properties returns JSON for a plain PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages
When I send the API request to the endpoint "/api/v1/analysis/document-properties"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@document-properties @positive
Scenario: document-properties returns JSON for a multi-page PDF with text
Given I generate a PDF file as "fileInput"
And the pdf contains 5 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/document-properties"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/page-dimensions
# ---------------------------------------------------------------------------
@page-dimensions @positive
Scenario Outline: page-dimensions returns JSON for PDFs of different sizes
Given I generate a PDF file as "fileInput"
And the pdf contains <pages> pages
When I send the API request to the endpoint "/api/v1/analysis/page-dimensions"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
Examples:
| pages |
| 1 |
| 3 |
| 10 |
@page-dimensions @positive
Scenario: page-dimensions returns JSON for a LETTER-sized PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/page-dimensions"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/form-fields
# ---------------------------------------------------------------------------
@form-fields @positive
Scenario: form-fields returns JSON for a PDF without any form fields
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages
When I send the API request to the endpoint "/api/v1/analysis/form-fields"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@form-fields @positive
Scenario: form-fields returns JSON for a multi-page PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 10 pages
When I send the API request to the endpoint "/api/v1/analysis/form-fields"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/annotation-info
# ---------------------------------------------------------------------------
@annotation-info @positive
Scenario: annotation-info returns JSON for a PDF with no annotations
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages
When I send the API request to the endpoint "/api/v1/analysis/annotation-info"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@annotation-info @positive
Scenario: annotation-info returns JSON for a text-content PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 4 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/annotation-info"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/font-info
# ---------------------------------------------------------------------------
@font-info @positive
Scenario: font-info returns JSON for a blank PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages
When I send the API request to the endpoint "/api/v1/analysis/font-info"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@font-info @positive
Scenario: font-info returns JSON for a PDF containing text
Given I generate a PDF file as "fileInput"
And the pdf contains 3 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/font-info"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
# ---------------------------------------------------------------------------
# /api/v1/analysis/security-info
# ---------------------------------------------------------------------------
@security-info @positive
Scenario: security-info returns JSON for an unencrypted PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 2 pages
When I send the API request to the endpoint "/api/v1/analysis/security-info"
And this operation is run 5 times in parallel
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0
@security-info @positive
Scenario: security-info returns JSON for a multi-page PDF
Given I generate a PDF file as "fileInput"
And the pdf contains 5 pages with random text
When I send the API request to the endpoint "/api/v1/analysis/security-info"
Then the response status code should be 200
And the response content type should be "application/json"
And the response file should have size greater than 0