Class FeatureParser
java.lang.Object
com.arc_e_tect.gradle.gherkin.parser.FeatureParser
Parses a single Gherkin
.feature file and extracts all scenarios.
Scenarios are returned in document order. Scenarios nested inside Rule
blocks are also included.
A Scenario Outline is not one scenario but a template for as many as its
Examples table has rows - the same way Cucumber itself runs one test case per row - so
ScenarioOutlineExpander expands every outline into one ScenarioInfo per row,
each with that row's values substituted into its title and steps. See that class for exactly
how each row is named.
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
Modifier and TypeMethodDescriptionParses the given.featurefile and returns all scenarios.
-
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 scenarios.- Parameters:
featureFile- the Gherkin feature file to parse; must not benull- Returns:
- unmodifiable list of scenarios in document order, one per
Examplesrow of everyScenario Outline; empty if the file cannot be read, is empty, or contains no scenarios
-