gauge

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2016 License: GPL-3.0, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpecHeading     = 0
	ScenarioHeading = 1
)

Variables

This section is empty.

Functions

func ConvertToProtoItem added in v0.3.2

func ConvertToProtoItem(item Item) *gauge_messages.ProtoItem

func ConvertToProtoSpec added in v0.3.2

func ConvertToProtoSpec(spec *Specification) *gauge_messages.ProtoSpec

func ConvertToProtoStepValue added in v0.3.2

func ConvertToProtoStepValue(stepValue *StepValue) *gauge_messages.ProtoStepValue

func ConvertToProtoSuiteResult added in v0.3.2

func ConvertToProtoSuiteResult(suiteResult *result.SuiteResult) *gauge_messages.ProtoSuiteResult

func NewProtoScenario added in v0.3.2

func NewProtoScenario(scenario *Scenario) *gauge_messages.ProtoScenario

func NewSpecResult added in v0.3.2

func NewSpecResult(specification *Specification) *result.SpecResult

Types

type ArgLookup added in v0.3.2

type ArgLookup struct {
	//helps to access the index of an arg at O(1)
	ParamIndexMap map[string]int
	// contains filtered or unexported fields
}

func (*ArgLookup) AddArgName added in v0.3.2

func (lookup *ArgLookup) AddArgName(argName string)

func (*ArgLookup) AddArgValue added in v0.3.2

func (lookup *ArgLookup) AddArgValue(param string, stepArg *StepArg)

func (*ArgLookup) ContainsArg added in v0.3.2

func (lookup *ArgLookup) ContainsArg(param string) bool

func (*ArgLookup) FromDataTable added in v0.3.2

func (lookup *ArgLookup) FromDataTable(datatable *Table) *ArgLookup

create an empty lookup with only args to resolve dynamic params for steps

func (*ArgLookup) FromDataTableRow added in v0.3.2

func (lookup *ArgLookup) FromDataTableRow(datatable *Table, index int) *ArgLookup

func (*ArgLookup) GetArg added in v0.3.2

func (lookup *ArgLookup) GetArg(param string) *StepArg

func (*ArgLookup) GetCopy added in v0.3.2

func (lookup *ArgLookup) GetCopy() *ArgLookup

func (ArgLookup) String added in v0.3.2

func (lookup ArgLookup) String() string

type ArgType added in v0.3.2

type ArgType string
const (
	Static               ArgType = "static"
	Dynamic              ArgType = "dynamic"
	TableArg             ArgType = "table"
	SpecialString        ArgType = "special_string"
	SpecialTable         ArgType = "special_table"
	ParameterPlaceholder         = "{}"
)

type ByLineNo added in v0.3.2

type ByLineNo []*Concept

func (ByLineNo) Len added in v0.3.2

func (s ByLineNo) Len() int

func (ByLineNo) Less added in v0.3.2

func (s ByLineNo) Less(i, j int) bool

func (ByLineNo) Swap added in v0.3.2

func (s ByLineNo) Swap(i, j int)

type Comment added in v0.3.2

type Comment struct {
	Value  string
	LineNo int
}

func (*Comment) Kind added in v0.3.2

func (comment *Comment) Kind() TokenKind

type Concept

type Concept struct {
	ConceptStep *Step
	FileName    string
}

type ConceptDictionary added in v0.3.2

type ConceptDictionary struct {
	ConceptsMap map[string]*Concept
	// contains filtered or unexported fields
}

func NewConceptDictionary added in v0.3.2

func NewConceptDictionary() *ConceptDictionary

func (*ConceptDictionary) ReplaceNestedConceptSteps added in v0.3.2

func (dict *ConceptDictionary) ReplaceNestedConceptSteps(conceptStep *Step)

func (*ConceptDictionary) Search added in v0.3.2

func (dict *ConceptDictionary) Search(stepValue string) *Concept

func (*ConceptDictionary) UpdateLookupForNestedConcepts added in v0.3.2

func (dict *ConceptDictionary) UpdateLookupForNestedConcepts()

type DataTable added in v0.3.2

type DataTable struct {
	Table      Table
	Value      string
	LineNo     int
	IsExternal bool
}

func (*DataTable) IsInitialized added in v0.3.2

func (dataTable *DataTable) IsInitialized() bool

func (*DataTable) Kind added in v0.3.2

func (externalTable *DataTable) Kind() TokenKind

type Heading added in v0.3.2

type Heading struct {
	Value       string
	LineNo      int
	HeadingType HeadingType
}

func (*Heading) Kind added in v0.3.2

func (heading *Heading) Kind() TokenKind

type HeadingType added in v0.3.2

type HeadingType int

type Item added in v0.3.2

type Item interface {
	Kind() TokenKind
}

type Scenario added in v0.3.2

type Scenario struct {
	Heading      *Heading
	Steps        []*Step
	Comments     []*Comment
	Tags         *Tags
	Items        []Item
	DataTableRow Table
	Span         *Span
}

func (*Scenario) AddComment added in v0.3.2

func (scenario *Scenario) AddComment(comment *Comment)

func (*Scenario) AddHeading added in v0.3.2

func (scenario *Scenario) AddHeading(heading *Heading)

func (*Scenario) AddItem added in v0.3.2

func (scenario *Scenario) AddItem(itemToAdd Item)

func (*Scenario) AddStep added in v0.3.2

func (scenario *Scenario) AddStep(step *Step)

func (*Scenario) AddTags added in v0.3.2

func (scenario *Scenario) AddTags(tags *Tags)

func (*Scenario) InSpan added in v0.5.0

func (scenario *Scenario) InSpan(lineNumber int) bool

func (Scenario) Kind added in v0.3.2

func (scenario Scenario) Kind() TokenKind

func (*Scenario) LatestStep added in v0.3.2

func (scenario *Scenario) LatestStep() *Step

func (*Scenario) NTags added in v0.5.0

func (scenario *Scenario) NTags() int

func (*Scenario) Traverse added in v0.3.2

func (scenario *Scenario) Traverse(traverser ScenarioTraverser)

type ScenarioTraverser added in v0.3.2

type ScenarioTraverser interface {
	ScenarioHeading(*Heading)
	ScenarioTags(*Tags)
	Step(*Step)
	Comment(*Comment)
}

type Span added in v0.5.0

type Span struct {
	Start int
	End   int
}

Span represents scope of Scenario based on line number

type SpecCollection added in v0.4.0

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

func NewSpecCollection added in v0.4.0

func NewSpecCollection(s []*Specification) *SpecCollection

func (*SpecCollection) Add added in v0.4.0

func (s *SpecCollection) Add(spec *Specification)

func (*SpecCollection) HasNext added in v0.4.0

func (s *SpecCollection) HasNext() bool

func (*SpecCollection) Next added in v0.4.0

func (s *SpecCollection) Next() *Specification

func (*SpecCollection) Size added in v0.4.0

func (s *SpecCollection) Size() int

func (*SpecCollection) SpecNames added in v0.4.0

func (s *SpecCollection) SpecNames() []string

func (*SpecCollection) Specs added in v0.4.0

func (s *SpecCollection) Specs() []*Specification

type SpecItemFilter added in v0.3.2

type SpecItemFilter interface {
	Filter(Item) bool
}

type SpecTraverser added in v0.3.2

type SpecTraverser interface {
	SpecHeading(*Heading)
	SpecTags(*Tags)
	DataTable(*Table)
	ExternalDataTable(*DataTable)
	ContextStep(*Step)
	Scenario(*Scenario)
	ScenarioHeading(*Heading)
	ScenarioTags(*Tags)
	Step(*Step)
	TearDown(*TearDown)
	Comment(*Comment)
}

type Specification added in v0.3.2

type Specification struct {
	Heading       *Heading
	Scenarios     []*Scenario
	Comments      []*Comment
	DataTable     DataTable
	Contexts      []*Step
	FileName      string
	Tags          *Tags
	Items         []Item
	TearDownSteps []*Step
}

func (*Specification) AddComment added in v0.3.2

func (spec *Specification) AddComment(comment *Comment)

func (*Specification) AddContext added in v0.3.2

func (spec *Specification) AddContext(contextStep *Step)

func (*Specification) AddDataTable added in v0.3.2

func (spec *Specification) AddDataTable(table *Table)

func (*Specification) AddExternalDataTable added in v0.3.2

func (spec *Specification) AddExternalDataTable(externalTable *DataTable)

func (*Specification) AddHeading added in v0.3.2

func (spec *Specification) AddHeading(heading *Heading)

func (*Specification) AddItem added in v0.3.2

func (spec *Specification) AddItem(itemToAdd Item)

func (*Specification) AddScenario added in v0.3.2

func (spec *Specification) AddScenario(scenario *Scenario)

func (*Specification) AddTags added in v0.3.2

func (spec *Specification) AddTags(tags *Tags)

func (*Specification) Filter added in v0.3.2

func (spec *Specification) Filter(filter SpecItemFilter)

func (*Specification) GetSpecItems added in v0.3.2

func (spec *Specification) GetSpecItems() []Item

func (*Specification) Kind added in v0.5.0

func (spec *Specification) Kind() TokenKind

func (*Specification) LatestContext added in v0.3.2

func (spec *Specification) LatestContext() *Step

func (*Specification) LatestScenario added in v0.3.2

func (spec *Specification) LatestScenario() *Scenario

func (*Specification) LatestTeardown added in v0.3.2

func (spec *Specification) LatestTeardown() *Step

func (*Specification) NTags added in v0.5.0

func (spec *Specification) NTags() int

func (*Specification) PopulateConceptLookup added in v0.3.2

func (spec *Specification) PopulateConceptLookup(lookup *ArgLookup, conceptArgs []*StepArg, stepArgs []*StepArg)

func (*Specification) ProcessConceptStepsFrom added in v0.3.2

func (spec *Specification) ProcessConceptStepsFrom(conceptDictionary *ConceptDictionary)

func (*Specification) RenameSteps added in v0.3.2

func (spec *Specification) RenameSteps(oldStep Step, newStep Step, orderMap map[int]int) bool

func (*Specification) Traverse added in v0.3.2

func (spec *Specification) Traverse(traverser SpecTraverser)

type Step

type Step struct {
	LineNo         int
	Value          string
	LineText       string
	Args           []*StepArg
	IsConcept      bool
	Lookup         ArgLookup
	ConceptSteps   []*Step
	Fragments      []*gauge_messages.Fragment
	Parent         *Step
	HasInlineTable bool
	Items          []Item
	PreComments    []*Comment
	Suffix         string
}

func (*Step) AddArgs added in v0.3.2

func (step *Step) AddArgs(args ...*StepArg)

func (*Step) AddInlineTableHeaders added in v0.3.2

func (step *Step) AddInlineTableHeaders(headers []string)

func (*Step) AddInlineTableRow added in v0.3.2

func (step *Step) AddInlineTableRow(row []TableCell)

func (*Step) CopyFrom added in v0.3.2

func (self *Step) CopyFrom(another *Step)

func (*Step) GetArg added in v0.3.2

func (step *Step) GetArg(name string) *StepArg

func (*Step) GetCopy added in v0.3.2

func (self *Step) GetCopy() *Step

Not copying parent as it enters an infinite loop in case of nested concepts. This is because the steps under the concept are copied and their parent copying again comes back to copy the same concept.

func (*Step) GetFragments added in v0.5.0

func (step *Step) GetFragments() []*gauge_messages.Fragment

func (*Step) GetLineText added in v0.5.0

func (step *Step) GetLineText() string

func (*Step) InConcept added in v0.5.0

func (step *Step) InConcept() bool

InConcept returns true if the step belongs to a concept

func (Step) Kind added in v0.3.2

func (step Step) Kind() TokenKind

func (*Step) PopulateFragments added in v0.3.2

func (step *Step) PopulateFragments()

func (*Step) Rename added in v0.3.2

func (step *Step) Rename(oldStep Step, newStep Step, isRefactored bool, orderMap map[int]int, isConcept *bool) bool

func (*Step) ReplaceArgsWithDynamic added in v0.3.2

func (step *Step) ReplaceArgsWithDynamic(args []*StepArg)

type StepArg added in v0.3.2

type StepArg struct {
	Name    string
	Value   string
	ArgType ArgType
	Table   Table
}

func (*StepArg) String added in v0.3.2

func (stepArg *StepArg) String() string

type StepValue added in v0.3.2

type StepValue struct {
	Args                   []string
	StepValue              string
	ParameterizedStepValue string
}

type Table added in v0.3.2

type Table struct {
	Columns [][]TableCell
	Headers []string
	LineNo  int
	// contains filtered or unexported fields
}

func (*Table) AddHeaders added in v0.3.2

func (table *Table) AddHeaders(columnNames []string)

func (*Table) AddRowValues added in v0.3.2

func (table *Table) AddRowValues(rowValues []string)

func (*Table) Get added in v0.3.2

func (table *Table) Get(header string) []TableCell

func (*Table) GetDynamicArgs added in v0.3.2

func (table *Table) GetDynamicArgs() []string

func (*Table) GetRowCount added in v0.3.2

func (table *Table) GetRowCount() int

func (*Table) IsInitialized added in v0.3.2

func (table *Table) IsInitialized() bool

func (*Table) Kind added in v0.3.2

func (table *Table) Kind() TokenKind

func (*Table) Rows added in v0.3.2

func (table *Table) Rows() [][]string

func (*Table) String added in v0.3.2

func (table *Table) String() string

type TableCell added in v0.3.2

type TableCell struct {
	Value    string
	CellType ArgType
}

func GetDefaultTableCell added in v0.3.2

func GetDefaultTableCell() TableCell

func GetTableCell added in v0.3.2

func GetTableCell(value string) TableCell

func (*TableCell) GetValue added in v0.3.2

func (cell *TableCell) GetValue() string

type Tags added in v0.3.2

type Tags struct {
	Values []string
}

func (*Tags) Kind added in v0.3.2

func (tags *Tags) Kind() TokenKind

type TearDown added in v0.3.2

type TearDown struct {
	LineNo int
	Value  string
}

func (*TearDown) Kind added in v0.3.2

func (t *TearDown) Kind() TokenKind

type TokenKind added in v0.3.2

type TokenKind int
const (
	SpecKind TokenKind = iota
	TagKind
	ScenarioKind
	CommentKind
	StepKind
	TableHeader
	TableRow
	HeadingKind
	TableKind
	DataTableKind
	TearDownKind
)

Jump to

Keyboard shortcuts

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