Skip to content

fix: filter empty suite titles from Cucumber URI path parts#243

Merged
gibiw merged 1 commit intomainfrom
fix/filter-empty-cucumber-suite-titles
Apr 9, 2026
Merged

fix: filter empty suite titles from Cucumber URI path parts#243
gibiw merged 1 commit intomainfrom
fix/filter-empty-cucumber-suite-titles

Conversation

@gibiw
Copy link
Copy Markdown
Contributor

@gibiw gibiw commented Apr 9, 2026

Summary

  • Fixed Cucumber reporters failing to upload results with HTTP 422 when feature files are resolved via file:/// URI (common with Gradle)
  • Splitting the URI on / produced empty path segments sent as suite entries with blank titles — the API rejected them with "relations.suite.data.1.title field is required"
  • Empty/blank segments are now filtered out in buildCucumberRelations() before building suite relations
  • Affects all Cucumber reporter versions (v3–v7)
  • Bumped version to 4.1.51 and updated all example projects

Root Cause

V7TestCaseAdapter.getUriPathParts() calls testCase.getUri().toString().split("/"). For a file:///path/to/features/file.feature URI, split("/") produces ["file:", "", "", "path", ...] — empty strings at indices 1 and 2 from the triple slash. These become SuiteData objects with empty title, which the Qase API rejects (422).

Test plan

  • Added unit test fromCucumber_fileUriPathPartsWithEmptySegments_filtersOutBlanks that reproduces the exact scenario
  • All 26 existing TestResultBuilderTest tests pass
  • Manual verification with Cucumber v7 + Gradle + TestNG example project

When Cucumber tests are run with Gradle using file-system feature paths,
the feature URI has the form file:///absolute/path/features/file.feature.
Splitting this on "/" produces empty strings at indices 1 and 2 (from the
triple slash), which are sent as SuiteData entries with blank titles.
The Qase API rejects these with HTTP 422: "relations.suite.data.1.title
field is required".

Filter out null and blank path segments in buildCucumberRelations() before
creating SuiteData entries. This affects all Cucumber reporter versions
(v3–v7).

Also bump version to 4.1.51 and update all example projects.
@gibiw gibiw merged commit 1eb5a7e into main Apr 9, 2026
14 checks passed
@gibiw gibiw deleted the fix/filter-empty-cucumber-suite-titles branch April 9, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant