Captures a gherkin background node.
Captures the evaluation status of a SpecNode.
Defines a failed evaluation status.
Defines a failed evaluation status.
the duration in nanoseconds
the error message
Captures a gherkin feature node.
Captures a gherkin feature node.
set of tags
the feature name
optional description
Abstract syntax tree of a successfully parsed feature.
Abstract syntax tree of a successfully parsed feature. The GherkinParser parses all plain text features into a tree of this type. The interpreter normalises the tree before passing it down to the evaluation engine and lower layers for processing.
the feature
optional background
list of scenarios
optional source feature file
optional list of meta specs
Uses the Gherkin 3 parser to produce an abstract syntax tree.
Uses the Gherkin 3 parser to produce an abstract syntax tree. Althouth the entire Gherkin grammar can be parsed, only the following minimal subset is supported by Gwen (we can add support for the remaining subsets in the future if required).
spec = feature, [background], {scenario} feature = {tag}, "Feature:", name [description] background = "Background:", name [description] {step} scenario = {tag}, "Scenario:", name [description] {step} tag = "@", name step = keyword, expression keyword = "Given" | "When" | "Then" | "And" | "But" name = expression description {expression} comment = "#", expression expression = character, {character}
The parsers defined in this class accept gherkin text as input to produce an abstract syntax tree in the form of a FeatureSpec object. Any input that does not conform to the standard Gherkin grammar results in a parser error. The error contains a the location of the error and a description of the violation.
The following example shows a valid feature that conforms to the grammar and will parse successfully (whether or not it evaluates is the responsibility of the evaluation layer):
Feature: Gwen Background: The butterfly effect Given a deterministic nonlinear system When a small change is initially applied Then a large change will eventually result Scenario: Evaluation Given a software behavior When expressed in Gherkin Then Gwen can evaluate it
Defines a passed evaluation status.
Defines a passed evaluation status.
the duration in nanoseconds
Reperesents a position in the source.
Captures a gherkin scenario.
Captures a gherkin scenario.
set of tags
the scenario name
the optional background description
optional background
list of scenario steps
Base trait for capturing a feature spec in an abstract syntax tree.
Base trait for capturing a feature spec in an abstract syntax tree. An spec node is the raw output produced by the GherkinParser.
Normalises a parsed feature spec in preparation for evaluation.
Captures a gherkin step.
Captures a gherkin step.
the location of the node in the source
keyword identifier (Given, When, Then, etc..)
free format step expression line (that is: the text following the step keyword)
file attachments as name-file pairs (default = Nil)
optional evaluated step def
Captures a gherkin tag.
Captures a gherkin tag.
name the tag name
Defines the loaded status.
Defines the pending status.
Defines the skipped status.
Enumeration of supported spec types.
Enumeration of supported status keywords.
Enumeration of supported step keywords.
Enumeration of supported step keywords. Every Step expression starts with one of the keywords defined here.
Pretty prints a spec node to a string.
Pretty prints a spec node to a string. This object recursively prints
each node to a string and can be invoked as a function. For example,
prettyPrint(spec)
prints an entire spec, and prettyPrint(step)
prints
a single step. Included in the output is the evaluation status of node
(if not pending).
Captures a gherkin background node.
the background name
optional background description
list of background steps