ISSUE-743 # Support external CSV header referencing and add withHeaders#755
Open
IgnatiosSar wants to merge 1 commit intoauthorjapps:masterfrom
Open
ISSUE-743 # Support external CSV header referencing and add withHeaders#755IgnatiosSar wants to merge 1 commit intoauthorjapps:masterfrom
IgnatiosSar wants to merge 1 commit intoauthorjapps:masterfrom
Conversation
Author
|
Hello, @authorjapps |
authorjapps
reviewed
Apr 13, 2026
| } | ||
| ], | ||
| "parameterized": { | ||
| "withHeaders" : true, |
authorjapps
reviewed
Apr 13, 2026
| } | ||
| ], | ||
| "parameterized": { | ||
| "withHeaders" : true, |
authorjapps
approved these changes
Apr 13, 2026
Owner
|
Once this PR is merged, also merge the next PR #756 with notice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support external CSV header referencing and replace
ignoreHeaderwithwithHeadersFixed Which Issue?
Fixes Feature: Named Parameter Support for External CSVs in Scenario DSL #743
PR Branch
https://github.com/IgnatiosSar/zerocode/tree/feature/743
Motivation and Context
This PR addresses Issue #743 by introducing native support for CSV headers in parameterized tests, enabling referencing those headers using ${PARAM.columnName} syntax and replacing the old
ignoreHeaderlogic.About the issue & Error Handling:
I discovered that referencing headers in external CSVs was already partially implemented, so I created the required tests to prove and ensure that it works. To make it robust, I added a regex validation. If a user tries to reference a header that doesn't exist in the CSV file, it now throws a clear
RuntimeExceptionexplicitly listing the invalid column and the available valid headers.Replacing
ignoreHeaderwithwithHeaders:withHeadersfield, which completely replaces and removesignoreHeader. (Note: This is a breaking change for existing users using the old flag)."withHeaders": true. The absence of this flag means that the CSV only contains raw data.withHeaderscurrently supports both piped (| |) and standard header syntax (no pipes), but the piped syntax is deprecated and should be removed in later versions.Testing:
For everything I’ve changed, I created or fixed the corresponding unit and integration tests to prove and ensure that the feature works. I also fixed some other tests that broke due to these changes (e.g., the removal of
ignoreHeader).Checklist:
1. New Unit tests were added
2. Integration tests were added
3. Test names are meaningful
3.1 Feature manually tested and outcome is successful
4. PR doesn't break any of the earlier features for end users
Note: As agreed, the old
ignoreHeaderfield has been removed and replaced bywithHeaders. Existing user scenarios using the old flag will need to be updated.5. PR doesn't break the HTML report features directly
/targetfolder and they look fine6. PR doesn't break any HTML report features indirectly
7. Branch build passed in CI
8. No 'package.*' in the imports
9. Relevant Documentation page added or updated with clear instructions and examples for the end user
10. Http test added to
http-testing-examplesmodule(if applicable) ?11. Kafka test added to
kafka-testing-examplesmodule(if applicable) ?Documentation
CSV Headers
If a CSV has headers, you must explicitly set withHeaders:true in the parameterized section.
Example
Referencing Headers in external CSVs
You can reference external CSV columns by their header names in your scenarios using ${PARAM.columnName}.
Example: External CSV
users.csvSample Scenario DSL
{ "scenarioName": "Test with named CSV parameters", "steps": [ { "name": "get_user_details", "url": "/users/${PARAM.username}", "operation": "GET", "request": {}, "assertions": { "status": 200, "body": { "login": "${PARAM.username}", "name": "${PARAM.fullname}", "location": "${PARAM.location}", "id": "(int)${PARAM.userid}" } } } ], "parameterized": { "withHeaders": true, "csvSource": "parameterized_csv/users.csv" } }Important Notes for the documentation
withHeaders:trueshould also be added in any other test that is using CSV with headers as an exampleignoreHeadershould be removed from any existing documentation