mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-02 21:03:34 +03:00
# 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.
127 lines
5.5 KiB
Gherkin
127 lines
5.5 KiB
Gherkin
@proprietary @forms
|
|
Feature: Forms API Validation
|
|
|
|
@fields @positive
|
|
Scenario: Get form fields from plain PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
When I send the API request to the endpoint "/api/v1/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
|
|
|
|
@fields @positive
|
|
Scenario: Get form fields from multi-page PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 5 pages
|
|
When I send the API request to the endpoint "/api/v1/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
|
|
|
|
@fields-with-coordinates @positive
|
|
Scenario: Get form fields with coordinates from PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
When I send the API request to the endpoint "/api/v1/form/fields-with-coordinates"
|
|
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
|
|
|
|
@fields-with-coordinates @positive
|
|
Scenario: Get form fields with coordinates from multi-page PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 4 pages
|
|
When I send the API request to the endpoint "/api/v1/form/fields-with-coordinates"
|
|
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
|
|
|
|
@fill @positive
|
|
Scenario: Fill PDF form with default options
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
And the pdf has form fields
|
|
When I send the API request to the endpoint "/api/v1/form/fill"
|
|
Then the response status code should be 200
|
|
And the response content type should be "application/pdf"
|
|
And the response file should have size greater than 0
|
|
And the response file should have extension ".pdf"
|
|
|
|
@fill @positive
|
|
Scenario: Fill and flatten PDF form
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 3 pages
|
|
And the pdf has form fields
|
|
And the request data includes
|
|
| parameter | value |
|
|
| flatten | true |
|
|
When I send the API request to the endpoint "/api/v1/form/fill"
|
|
Then the response status code should be 200
|
|
And the response content type should be "application/pdf"
|
|
And the response file should have size greater than 0
|
|
And the response file should have extension ".pdf"
|
|
|
|
@modify-fields @negative
|
|
Scenario: Modify form fields with no updates payload returns 400
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
When I send the API request to the endpoint "/api/v1/form/modify-fields"
|
|
And this operation is run 5 times in parallel
|
|
Then the response status code should be 400
|
|
|
|
@modify-fields @negative
|
|
Scenario: Modify form fields in multi-page PDF with no updates payload returns 400
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 5 pages
|
|
When I send the API request to the endpoint "/api/v1/form/modify-fields"
|
|
Then the response status code should be 400
|
|
|
|
@delete-fields @negative
|
|
Scenario: Delete form fields with no names payload returns 400
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
When I send the API request to the endpoint "/api/v1/form/delete-fields"
|
|
And this operation is run 5 times in parallel
|
|
Then the response status code should be 400
|
|
|
|
@delete-fields @negative
|
|
Scenario: Delete form fields from multi-page PDF with no names payload returns 400
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 4 pages
|
|
When I send the API request to the endpoint "/api/v1/form/delete-fields"
|
|
Then the response status code should be 400
|
|
|
|
|
|
@extract-csv @positive
|
|
Scenario: extract-csv returns CSV for a form PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
And the pdf has form fields
|
|
When I send the API request to the endpoint "/api/v1/form/extract-csv"
|
|
And this operation is run 5 times in parallel
|
|
Then the response status code should be 200
|
|
And the response content type should be "text/csv"
|
|
|
|
|
|
@extract-xlsx @positive
|
|
Scenario: extract-xlsx returns a spreadsheet for a form PDF
|
|
Given I generate a PDF file as "file"
|
|
And the pdf contains 2 pages
|
|
And the pdf has form fields
|
|
When I send the API request to the endpoint "/api/v1/form/extract-xlsx"
|
|
And this operation is run 5 times in parallel
|
|
Then the response status code should be 200
|
|
And the response file should have size greater than 200
|
|
|
|
|
|
@extract-csv @negative
|
|
Scenario: extract-csv rejects a upload sent under the wrong part name
|
|
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/form/extract-csv"
|
|
Then the response status code should be 400
|
|
And the response JSON error should contain "file"
|