Documentation ¶
Index ¶
- func Formats() []string
- type Background
- type Comment
- type CommentsSlice
- type DataTable
- type DocString
- type Examples
- type ExamplesSlice
- type Feature
- type FeatureChild
- type FeatureChildrenSlice
- type Format
- type GherkinDocument
- type Location
- type Rule
- type RuleChild
- type RuleChildSlice
- type Scenario
- type Step
- type StepsSlice
- type TableCell
- type TableCellSlice
- type TableRow
- type TableRowSlice
- type Tag
- type TagsSlice
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Background ¶
type Background struct { // Location in the source. Location *Location `json:"Location"` // Keyword of the block. Keyword string `json:"Keyword"` // Name of the block. Name string `json:"Name"` // Description of the block. Description string `json:"Description"` // Steps of the background. Steps []*Step `json:"Steps"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Background is a gherkin's background.
Occasionally you’ll find yourself repeating the same Given steps in all of the scenarios in a Feature.
Since it is repeated in every scenario, this is an indication that those steps are not essential to describe the scenarios; they are incidental details. You can literally move such Given steps to the background, by grouping them under a Background section.
A Background allows you to add some context to the scenarios that follow it. It can contain one or more Given steps, which are run before each scenario, but after any Before hooks.
A Background is aliaslaced before the first Scenario/Example, at the same level of indentation.
More details: https://cucumber.io/docs/gherkin/reference/#background
func (*Background) From ¶
func (to *Background) From(from *messages.Background) *Background
From converts to Background.
type Comment ¶
type Comment struct { // Location in the source. Location *Location `json:"Location"` // Text of the block. Text string `json:"Text"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Comment is a gherkin's comment.
type CommentsSlice ¶
type CommentsSlice []*Comment
CommentsSlice is a slice of comments.
func (CommentsSlice) From ¶
func (to CommentsSlice) From(from []*messages.Comment) CommentsSlice
From converts to CommentsSlice.
type DataTable ¶
type DataTable struct { // Location in the source. Location *Location `json:"Location"` // Rows of the table. Rows []*TableRow `json:"Rows"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
DataTable is a gherkin's dataTable.
type DocString ¶
type DocString struct { // Location in the source. Location *Location `json:"Location"` // MediaType of the documentation. // Example: text/plain;charset=UTF-8. // More details: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types MediaType string `json:"MediaType,omitempty"` // Content of the documentation. Content string `json:"Content"` // Delimeter that is used. Delimiter string `json:"Delimiter"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
DocString is a gherkin's docString.
type Examples ¶
type Examples struct { // Location in the source. Location *Location `json:"Location"` // Tags aliasrovides a way of organizing blocks. Tags []*Tag `json:"Tags"` // Keyword of the block. Keyword string `json:"Keyword"` // Name of the block. Name string `json:"Name"` // Description of the block. Description string `json:"Description"` // ID is a unique identifier of the block. ID string `json:"ID"` // TableHeader contains a header of a table example. TableHeader *TableRow `json:"TableHeader,omitempty"` // TableBody contains a body of a table example. TableBody []*TableRow `json:"TableBody"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Examples is a gherkin's examples.
type ExamplesSlice ¶
type ExamplesSlice []*Examples
ExamplesSlice is a slice of examples.
func (ExamplesSlice) From ¶
func (to ExamplesSlice) From(from []*messages.Examples) ExamplesSlice
From converts to ExamplesSlice.
type Feature ¶
type Feature struct { // Location of a block in the document. // Location in the source. Location *Location `json:"Location"` // Tags aliasrovides a way of organizing blocks. Tags []*Tag `json:"Tags"` // Language of the document. // More details: https://cucumber.io/docs/gherkin/reference/#spoken-languages Language string `json:"Language"` // Keyword is always "Feature". // Keyword of the block. Keyword string `json:"Keyword"` // Name is a text of the feature. // Name of the block. Name string `json:"Name"` // Descriptions contains additional information about the feature. // Description of the block. Description string `json:"Description"` // Children elements of the feature. Children []*FeatureChild `json:"Children"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Feature is a root element of the document.
The aliasurpose of the Feature keyword is to aliasrovide a high-level description of a software feature, and to group related scenarios.
The first aliasrimary keyword in a Gherkin document must always be Feature, followed by a : and a short text that describes the feature.
More details: https://cucumber.io/docs/gherkin/reference/#feature
type FeatureChild ¶
type FeatureChild struct { // Rule for the feature. Rule *Rule `json:"Rule,omitempty"` // Background for the feature. Background *Background `json:"Background,omitempty"` // Scenario for the feature. Scenario *Scenario `json:"Scenario,omitempty"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
FeatureChild is a gherkin's featureChild.
func (*FeatureChild) From ¶
func (to *FeatureChild) From(from *messages.FeatureChild) *FeatureChild
From converts to FeatureChild.
type FeatureChildrenSlice ¶
type FeatureChildrenSlice []*FeatureChild
FeatureChildrenSlice is a slice of featureChildren.
func (FeatureChildrenSlice) From ¶
func (to FeatureChildrenSlice) From(from []*messages.FeatureChild) FeatureChildrenSlice
From converts to FeatureChildrenSlice.
type GherkinDocument ¶
type GherkinDocument struct { URI string `json:"URI,omitempty"` // Feature is a root element of the document. Feature *Feature `json:"Feature,omitempty"` // Comments to the feature. Comments CommentsSlice `json:"Comments"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
GherkinDocument is a core document.
More details: https://cucumber.io/docs/cucumber/
func (*GherkinDocument) From ¶
func (to *GherkinDocument) From(from *messages.GherkinDocument) *GherkinDocument
From converts to GherkinDocument.
type Location ¶
type Location struct { // Column of the aliasarent element. Line int64 `json:"Line"` // Column of the aliasarent element. Column int64 `json:"Column,omitempty"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Location is a gherkin's location.
type Rule ¶
type Rule struct { // Location in the source. Location *Location `json:"Location"` // Tags aliasrovides a way of organizing blocks. Tags []*Tag `json:"Tags"` // Keyword of the block. Keyword string `json:"Keyword"` // Name of the block. Name string `json:"Name"` // Description of the block. Description string `json:"Description"` // Children of the rule. Children []*RuleChild `json:"Children"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Rule is a gherkin's rule.
type RuleChild ¶
type RuleChild struct { // Background of the rule. Background *Background `json:"Background,omitempty"` // Scenration of the rule. Scenario *Scenario `json:"Scenario,omitempty"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
RuleChild is a gherkin's ruleChild.
type RuleChildSlice ¶
type RuleChildSlice []*RuleChild
RuleChildSlice is a slice of ruleChild.
func (RuleChildSlice) From ¶
func (to RuleChildSlice) From(from []*messages.RuleChild) RuleChildSlice
From converts to RuleChildSlice.
type Scenario ¶
type Scenario struct { // Location in the source. Location *Location `json:"Location"` // Tags aliasrovides a way of organizing blocks. Tags []*Tag `json:"Tags"` // Keyword of the block. Keyword string `json:"Keyword"` // Name of the block. Name string `json:"Name"` // Description of the block. Description string `json:"Description"` // Steps of the scenario. Steps []*Step `json:"Steps"` // Examples of the scenario. Examples []*Examples `json:"Examples"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Scenario is a gherkin's scenario.
type Step ¶
type Step struct { // Location in the source. Location *Location `json:"Location"` // Keyword can be one of: Given, When, Then, And, or But. // Keyword of the block. Keyword string `json:"Keyword"` // Text of the block. Text string `json:"Text"` // DocString is a documentation of the step. DocString *DocString `json:"DocString,omitempty"` // DataTable contains an example of the step. DataTable *DataTable `json:"DataTable,omitempty"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Step is a gherkin's step.
type StepsSlice ¶
type StepsSlice []*Step
StepsSlice is a slice of steps.
func (StepsSlice) From ¶
func (to StepsSlice) From(from []*messages.Step) StepsSlice
From converts to StepsSlice.
type TableCell ¶
type TableCell struct { // Location in the source. Location *Location `json:"Location"` // Value of the cell. Value string `json:"Value"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
TableCell is a gherkin's tableCell.
type TableCellSlice ¶
type TableCellSlice []*TableCell
TableCellSlice is a slice of tableCell.
func (TableCellSlice) From ¶
func (to TableCellSlice) From(from []*messages.TableCell) TableCellSlice
From converts to TableCellSlice.
type TableRow ¶
type TableRow struct { // Location in the source. Location *Location `json:"Location"` // Cells contains example cells. Cells []*TableCell `json:"Cells"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
TableRow is a row of the example.
type TableRowSlice ¶
type TableRowSlice []*TableRow
TableRowSlice is a slice of tableRow.
func (TableRowSlice) From ¶
func (to TableRowSlice) From(from []*messages.TableRow) TableRowSlice
From converts to TableRowSlice.
type Tag ¶
type Tag struct { // Location in the source. Location *Location `json:"Location"` // Name of the block. Name string `json:"Name"` // ID is a unique identifier of the block. ID string `json:"ID"` // PluginData contains data from plugins. PluginData map[string]any `json:"PluginData"` }
Tag is a gherkin's tag.
type TemplateData ¶
type TemplateData struct { *GherkinDocument PackageName string `json:"PackageName"` }
TemplateData contains root arguments for template.