Class TestSourceParsed
- java.lang.Object
-
- io.cucumber.plugin.event.TestSourceParsed
-
- All Implemented Interfaces:
Event
@API(status=EXPERIMENTAL) public final class TestSourceParsed extends Object
Provides abstract representation of a parsed test source.Cucumber scenarios and individual examples in a scenario outline are compiled into pickles. These pickles are wrapped by a
TestCase
. As such Cucumbers internal representation lacks any hierarchy. I.e. once compiled into a a pickle a scenario is no longer associated with a feature file.However consumers of Cucumbers output generally expect results to be reported in hierarchical fashion. This event allows test cases to be associated with with a
Node
in the hierarchy.Note that this representation is intentionally abstract. To create more detailed reports that recreate a facsimile of the feature file it is recommended to use the Gherkin AST. This AST can be obtained by parsing the source provided by
TestSourceRead
event usinggherkin.Parser
orio.cucumber.gherkin.Gherkin
.Note that a test source may contain multiple root nodes. Though currently there are no parsers that support this yet.
-
-
Constructor Summary
Constructors Constructor Description TestSourceParsed(Instant timeInstant, URI uri, List<Node> nodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instant
getInstant()
Returns instant from epoch.Collection<Node>
getNodes()
The root nodes in the parsed test source.URI
getUri()
-
-
-
Method Detail
-
getNodes
public Collection<Node> getNodes()
The root nodes in the parsed test source.- Returns:
- root nodes in the parsed test source.
-
getUri
public URI getUri()
-
getInstant
public Instant getInstant()
Returns instant from epoch.- Specified by:
getInstant
in interfaceEvent
- Returns:
- time instant in Instant
- See Also:
Instant.now()
-
-