Node Classes

Nodes representing different elements of a Gherkin feature file.

class gherlint.objectmodel.nodes.Background(line: int, column: int, parent: Node | None, name: str, description: str, steps: List[Step])

Represents a background of a feature.

classmethod from_dict(data: Dict[str, Any], parent: Node | None) Background

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Document(line: int, column: int, filename: str, feature: Feature | None, comments: List[str], parent=None, offset: int = 0)

Represents the file itself

classmethod from_dict(data: Dict[str, Any], parent: Node | None = None) Document

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Examples(parent: Node | None, line: int, column: int, tags: List[Tag], name: str, description: str, parameters: List[str], values: Dict[str, List[str]])
classmethod from_dict(data: Dict[str, Any], parent: Node | None) Examples

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Feature(line: int, column: int, parent: Node | None, tags: List[Tag], language: str, name: str, description: str, scenarios: List[Scenario | ScenarioOutline], background: Background | None = None)

Represents a Feature in a file.

classmethod from_dict(data: Dict[str, Any], parent: Node | None) Feature

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Node(parent: Node | None, line: int, column: int)

Base class for all concrete node types.

abstract classmethod from_dict(data: Dict[str, Any], parent: Node | None) Node

Create a node instance from the dictionary returned by the gherkin parser.

get_root() Node

Get the root node, i.e. the topmost parent in the hierarchy.

class gherlint.objectmodel.nodes.Scenario(line: int, column: int, parent: Node | None, tags: List[Tag], name: str, description: str, examples: List[Examples], steps: List[Step])

Represents a scenario of a feature.

classmethod from_dict(data: Dict[str, Any], parent: Node | None) Scenario

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.ScenarioOutline(line: int, column: int, parent: Node | None, tags: List[Tag], name: str, description: str, examples: List[Examples], steps: List[Step])

Represents a scenario outline of a feature

class gherlint.objectmodel.nodes.Step(parent: Node | None, line: int, column: int, keyword: str, text: str)
classmethod from_dict(data: Dict[str, Any], parent: Node | None) Step

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Tag(parent: Node | None, line: int, column: int, name: str)
classmethod from_dict(data: Dict[str, Any], parent: Node | None) Tag

Create a node instance from the dictionary returned by the gherkin parser.

class gherlint.objectmodel.nodes.Taggable(*args, **kwargs)

A node that can be tagged.

gherlint.objectmodel.nodes.extract_parameters(text: str) Tuple[str]

Extract parameters from a string (e. g. a step text). ‘Parameters’ are placeholders defined in the Examples section of a Scenario Outline and are delimited with < >.