formats

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBootstrapFormatterFunc

func NewBootstrapFormatterFunc(s *config.Settings) godog.FormatterFunc

NewBootstrapFormatterFunc builds a new FormatterFunc to be used when registering BootstrapFormat with godog

func NewCompositeFormatterFunc

func NewCompositeFormatterFunc(formatters []string) godog.FormatterFunc

NewCompositeFormatterFunc builds the formatter constructor function used by godog when registering this formatter

func NewCucumberFormatterFunc

func NewCucumberFormatterFunc(s *config.Settings) godog.FormatterFunc

NewCucumberFormatterFunc builds a new FormatterFunc to be used when registering CucumberFormatter with godog

func NewSimpleFormatterFunc

func NewSimpleFormatterFunc(s *config.Settings) godog.FormatterFunc

NewSimpleFormatterFunc builds a new FormatterFunc to be used when registering SimpleFormat with godog

Types

type BootstrapFormat

type BootstrapFormat struct {
	CucumberFormatter
}

BootstrapFormat ...

func (*BootstrapFormat) Defined

func (b *BootstrapFormat) Defined(s *gherkin.Step, sd *godog.StepDef)

Defined ...

func (*BootstrapFormat) Failed

func (b *BootstrapFormat) Failed(s *gherkin.Step, sd *godog.StepDef, err error)

Failed ...

func (*BootstrapFormat) Feature

func (b *BootstrapFormat) Feature(f *gherkin.Feature, p string, src []byte)

Feature ...

func (*BootstrapFormat) Node

func (b *BootstrapFormat) Node(n interface{})

Node ...

func (*BootstrapFormat) Passed

func (b *BootstrapFormat) Passed(s *gherkin.Step, sd *godog.StepDef)

Passed ...

func (*BootstrapFormat) Pending

func (b *BootstrapFormat) Pending(s *gherkin.Step, sd *godog.StepDef)

Pending ...

func (*BootstrapFormat) Skipped

func (b *BootstrapFormat) Skipped(s *gherkin.Step, sd *godog.StepDef)

Skipped ...

func (*BootstrapFormat) Summary

func (b *BootstrapFormat) Summary()

Summary ...

func (*BootstrapFormat) Undefined

func (b *BootstrapFormat) Undefined(s *gherkin.Step, sd *godog.StepDef)

Undefined ...

type CompositeFormat

type CompositeFormat struct {
	// contains filtered or unexported fields
}

CompositeFormat allows using more than one formatter at a time

func (*CompositeFormat) Defined

func (c *CompositeFormat) Defined(s *gherkin.Step, sd *godog.StepDef)

Defined calls the Defined functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Failed

func (c *CompositeFormat) Failed(s *gherkin.Step, sd *godog.StepDef, err error)

Failed calls the Failed functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Feature

func (c *CompositeFormat) Feature(ft *gherkin.Feature, p string, src []byte)

Feature calls the Feature functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Node

func (c *CompositeFormat) Node(n interface{})

Node calls the Node functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Passed

func (c *CompositeFormat) Passed(s *gherkin.Step, sd *godog.StepDef)

Passed calls the Passed functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Pending

func (c *CompositeFormat) Pending(s *gherkin.Step, sd *godog.StepDef)

Pending calls the Pending functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Skipped

func (c *CompositeFormat) Skipped(s *gherkin.Step, sd *godog.StepDef)

Skipped calls the Skipped functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Summary

func (c *CompositeFormat) Summary()

Summary calls the Summary functions on each formatter composing this CompositeFormat.

func (*CompositeFormat) Undefined

func (c *CompositeFormat) Undefined(s *gherkin.Step, sd *godog.StepDef)

Undefined calls the Undefined functions on each formatter composing this CompositeFormat.

type CucumberFormatter

type CucumberFormatter struct {
	CucumberReport
	Settings *config.Settings
	// contains filtered or unexported fields
}

CucumberFormatter builds out a data structure that maps to Cucumber JSON format.

func NewCucumberFormatter

func NewCucumberFormatter(s *config.Settings) CucumberFormatter

NewCucumberFormatter builds a new CucumberFormat struct

func (*CucumberFormatter) Defined

func (b *CucumberFormatter) Defined(s *gherkin.Step, sd *godog.StepDef)

Defined ...

func (*CucumberFormatter) Failed

func (b *CucumberFormatter) Failed(s *gherkin.Step, sd *godog.StepDef, err error)

Failed records a failed step

func (*CucumberFormatter) Feature

func (b *CucumberFormatter) Feature(ft *gherkin.Feature, p string, c []byte)

Feature records a new Feature for the Bootstrap report

func (*CucumberFormatter) Node

func (b *CucumberFormatter) Node(n interface{})

Node captures the Scenario or Outline that is the owner of the following steps

func (*CucumberFormatter) Passed

func (b *CucumberFormatter) Passed(s *gherkin.Step, sd *godog.StepDef)

Passed records a passed step

func (*CucumberFormatter) Pending

func (b *CucumberFormatter) Pending(s *gherkin.Step, sd *godog.StepDef)

Pending records steps that could not be matched to an implementation method

func (*CucumberFormatter) Skipped

func (b *CucumberFormatter) Skipped(s *gherkin.Step, sd *godog.StepDef)

Skipped records a skipped step

func (*CucumberFormatter) Summary

func (b *CucumberFormatter) Summary()

Summary indicates the end of the test

func (*CucumberFormatter) Undefined

func (b *CucumberFormatter) Undefined(s *gherkin.Step, sd *godog.StepDef)

Undefined ...

type CucumberReport

type CucumberReport struct {
	Features        []CukeFeature
	ProjectName     string
	AppVersion      string
	Environment     string
	Browser         string
	Platform        string
	RunTime         time.Duration
	OS              string
	Timestamp       string
	ElementsPassed  int
	ElementsFailed  int
	ElementsPending int
	StepsPassed     int
	StepsFailed     int
	StepsPending    int
	StepsSkipped    int
	TotalElements   int
	TotalSteps      int
	// contains filtered or unexported fields
}

CucumberReport holds the jsonResults of a test execution

func NewCucumberReport

func NewCucumberReport(s *config.Settings) CucumberReport

NewCucumberReport creates a new CucumberReport struct and initializes it.

type CukeComment

type CukeComment struct {
	Value string `json:"value"`
	Line  int    `json:"line"`
}

CukeComment is any single-line comment.

type CukeDataTableRow

type CukeDataTableRow struct {
	Cells []string `json:"cells"`
}

CukeDataTableRow represents a row in a DataTable owned by a step

type CukeDocstring

type CukeDocstring struct {
	Value       string `json:"value"`
	ContentType string `json:"content_type"`
	Line        int    `json:"line"`
}

CukeDocstring is a docstring (multi-line comment).

type CukeElement

type CukeElement struct {
	ID           string     `json:"id"`
	Keyword      string     `json:"keyword"`
	Name         string     `json:"name"`
	Description  string     `json:"description"`
	Line         int        `json:"line"`
	Type         string     `json:"type"`
	Tags         []CukeTag  `json:"tags,omitempty"`
	Steps        []CukeStep `json:"steps,omitempty"`
	StepsPassed  int        `json:"stepsPassed"`
	StepsFailed  int        `json:"stepsFailed"`
	StepsPending int        `json:"stepsPending"`
	StepsSkipped int        `json:"stepsSkipped"`
}

CukeElement represents any block nested within a Feature:

  • Background
  • Scenario
  • Scneario Outline

func (*CukeElement) GetTrimmedDescription

func (e *CukeElement) GetTrimmedDescription() string

GetTrimmedDescription removes leading and trailing whitespace from the Scenario's description and returns the result.

func (*CukeElement) GetTrimmedKeyword

func (e *CukeElement) GetTrimmedKeyword() string

GetTrimmedKeyword removes leading and trailing whitespace from the Scenario's keyword.

type CukeEmbedding

type CukeEmbedding struct {
	MimeType string `json:"mime_type"`
	Data     string `json:"data"`
}

CukeEmbedding is any file or binary content attached to a step.

type CukeFeature

type CukeFeature struct {
	URI             string        `json:"uri"`
	ID              string        `json:"id"`
	Keyword         string        `json:"keyword"`
	Name            string        `json:"name"`
	Description     string        `json:"description"`
	Line            int           `json:"line"`
	Comments        []CukeComment `json:"comments,omitempty"`
	Tags            []CukeTag     `json:"tags,omitempty"`
	Elements        []CukeElement `json:"elements,omitempty"`
	ElementsPassed  int           `json:"elementsPassed"`
	ElementsFailed  int           `json:"elementsFailed"`
	ElementsPending int           `json:"elementsPending"`
	StepsPassed     int           `json:"stepsPassed"`
	StepsFailed     int           `json:"stepsFailed"`
	StepsPending    int           `json:"stepsPending"`
	StepsSkipped    int           `json:"stepsSkipped"`
}

CukeFeature is a single feature in JSONReport.

func (*CukeFeature) GetTrimmedDescription

func (f *CukeFeature) GetTrimmedDescription() string

GetTrimmedDescription returns the features description after removing leading and trailing whitespace from each line.

type CukeMatch

type CukeMatch struct {
	Location string `json:"location"`
}

CukeMatch is the method matched to a step.

type CukeResult

type CukeResult struct {
	Status   string `json:"status"`
	Error    string `json:"error_message,omitempty"`
	Duration *int   `json:"duration,omitempty"`
}

CukeResult is the result of executing a step.

func (*CukeResult) GetDurationInSeconds

func (r *CukeResult) GetDurationInSeconds() string

GetDurationInSeconds convers the millisecond representation of duration to seconds (accurate to 2 decimal places) and returns the result.

type CukeStep

type CukeStep struct {
	Keyword    string              `json:"keyword"`
	Name       string              `json:"name"`
	Line       int                 `json:"line"`
	Docstring  *CukeDocstring      `json:"doc_string,omitempty"`
	Match      CukeMatch           `json:"match"`
	Result     CukeResult          `json:"result"`
	Embeddings []*CukeEmbedding    `json:"embeddings,omitempty"`
	DataTable  []*CukeDataTableRow `json:"rows,omitempty"`
}

CukeStep is a single step in a cukeElement.

func (*CukeStep) GetTrimmedKeyword

func (s *CukeStep) GetTrimmedKeyword() string

GetTrimmedKeyword removes leading and trailing whitespace from the Step's keyword.

func (*CukeStep) GetTrimmedName

func (s *CukeStep) GetTrimmedName() string

GetTrimmedName removes leading and trailing whitespace from the Step's name.

type CukeTag

type CukeTag struct {
	Name string `json:"name"`
	Line int    `json:"line"`
}

CukeTag is any tag added to a feature or scenario.

type SimpleFormat

type SimpleFormat struct {
	CucumberFormatter
}

SimpleFormat ...

func (*SimpleFormat) Defined

func (b *SimpleFormat) Defined(s *gherkin.Step, sd *godog.StepDef)

Defined ...

func (*SimpleFormat) Failed

func (b *SimpleFormat) Failed(s *gherkin.Step, sd *godog.StepDef, err error)

Failed ...

func (*SimpleFormat) Feature

func (b *SimpleFormat) Feature(f *gherkin.Feature, p string, src []byte)

Feature ...

func (*SimpleFormat) Node

func (b *SimpleFormat) Node(n interface{})

Node ...

func (*SimpleFormat) Passed

func (b *SimpleFormat) Passed(s *gherkin.Step, sd *godog.StepDef)

Passed ...

func (*SimpleFormat) Pending

func (b *SimpleFormat) Pending(s *gherkin.Step, sd *godog.StepDef)

Pending ...

func (*SimpleFormat) Skipped

func (b *SimpleFormat) Skipped(s *gherkin.Step, sd *godog.StepDef)

Skipped ...

func (*SimpleFormat) Summary

func (b *SimpleFormat) Summary()

Summary ...

func (*SimpleFormat) Undefined

func (b *SimpleFormat) Undefined(s *gherkin.Step, sd *godog.StepDef)

Undefined ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL