Class FeatureParser
java.lang.Object
com.arc_e_tect.gradle.gherkin.parser.FeatureParser
Parses a single Gherkin
.feature file and extracts all scenario titles.
Titles are returned in document order as "keyword: name" strings
(e.g. "Scenario: User logs in"). Scenarios nested inside Rule
blocks are also included.
If the file cannot be read or parsed, the error is logged as a warning and an empty list is returned — the task never fails due to a single bad file.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newFeatureParserwith a pre-configuredGherkinParser. -
Method Summary
-
Constructor Details
-
FeatureParser
public FeatureParser()Creates a newFeatureParserwith a pre-configuredGherkinParser. Source envelopes and pickles are excluded from parsing to minimise memory usage.
-
-
Method Details
-
parse
Parses the given.featurefile and returns all scenario titles.- Parameters:
featureFile- the Gherkin feature file to parse; must not benull- Returns:
- unmodifiable list of scenario titles in document order; empty if the file cannot be read, is empty, or contains no scenarios
-