result

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPostHook

func AddPostHook(result Result, executionResult *gauge_messages.ProtoExecutionResult)

AddPostHook adds the after hook execution result to the actual result object

func AddPreHook

func AddPreHook(result Result, executionResult *gauge_messages.ProtoExecutionResult)

AddPreHook adds the before hook execution result to the actual result object

func GetProtoHookFailure

func GetProtoHookFailure(executionResult *gauge_messages.ProtoExecutionResult) *(gauge_messages.ProtoHookFailure)

GetProtoHookFailure returns the failure result of hook execution

Types

type ConceptResult added in v0.5.0

type ConceptResult struct {
	ProtoConcept *gauge_messages.ProtoConcept
}

ConceptResult represents result of a concept execution

func NewConceptResult added in v0.5.0

func NewConceptResult(con *gauge_messages.ProtoConcept) *ConceptResult

NewConceptResult creates a ConceptResult with given ProtoConcept

func (*ConceptResult) AddPostHook added in v0.8.4

func (conceptResult *ConceptResult) AddPostHook(_ ...*gauge_messages.ProtoHookFailure)

func (*ConceptResult) AddPreHook added in v0.8.4

func (conceptResult *ConceptResult) AddPreHook(_ ...*gauge_messages.ProtoHookFailure)

func (*ConceptResult) ExecTime added in v0.5.0

func (conceptResult *ConceptResult) ExecTime() int64

ExecTime returns the time taken for concept execution

func (*ConceptResult) GetFailed added in v0.5.0

func (conceptResult *ConceptResult) GetFailed() bool

GetFailed returns the state of the concept result

func (*ConceptResult) GetPostHook added in v0.5.0

func (conceptResult *ConceptResult) GetPostHook() []*gauge_messages.ProtoHookFailure

func (*ConceptResult) GetPreHook added in v0.5.0

func (conceptResult *ConceptResult) GetPreHook() []*gauge_messages.ProtoHookFailure

func (*ConceptResult) GetRecoverable added in v0.6.0

func (conceptResult *ConceptResult) GetRecoverable() bool

GetRecoverable returns the state of the concept result

func (*ConceptResult) Item added in v0.5.0

func (conceptResult *ConceptResult) Item() interface{}

func (*ConceptResult) SetConceptExecResult added in v0.5.0

func (conceptResult *ConceptResult) SetConceptExecResult(conceptExecResult *gauge_messages.ProtoStepExecutionResult)

SetConceptExecResult sets the conceptExecResult as result of concept execution as well as result of ConceptStep

func (*ConceptResult) SetFailure added in v0.5.0

func (conceptResult *ConceptResult) SetFailure()

SetFailure sets the conceptResult as failed

func (*ConceptResult) UpdateConceptExecResult added in v0.5.0

func (conceptResult *ConceptResult) UpdateConceptExecResult()

UpdateConceptExecResult sets the result of Concept execution

type ExecTimeTracker

type ExecTimeTracker interface {
	AddExecTime(int64)
}

ExecTimeTracker is an interface for tracking execution time

type Result

type Result interface {
	GetPreHook() []*gauge_messages.ProtoHookFailure
	GetPostHook() []*gauge_messages.ProtoHookFailure
	GetFailed() bool

	AddPreHook(...*gauge_messages.ProtoHookFailure)
	AddPostHook(...*gauge_messages.ProtoHookFailure)
	SetFailure()

	Item() interface{}
	ExecTime() int64
}

Result represents execution result

type ScenarioResult

type ScenarioResult struct {
	ProtoScenario             *gauge_messages.ProtoScenario
	ScenarioDataTableRow      *gauge_messages.ProtoTable
	ScenarioDataTableRowIndex int
	ScenarioDataTable         *gauge_messages.ProtoTable
}

func NewScenarioResult added in v0.5.0

func NewScenarioResult(sce *gauge_messages.ProtoScenario) *ScenarioResult

func (ScenarioResult) AddContexts

func (s ScenarioResult) AddContexts(contextProtoItems []*gauge_messages.ProtoItem)

func (ScenarioResult) AddExecTime

func (s ScenarioResult) AddExecTime(execTime int64)

func (ScenarioResult) AddItems

func (s ScenarioResult) AddItems(protoItems []*gauge_messages.ProtoItem)

func (ScenarioResult) AddPostHook added in v0.8.4

func (s ScenarioResult) AddPostHook(f ...*gauge_messages.ProtoHookFailure)

func (ScenarioResult) AddPreHook added in v0.8.4

func (s ScenarioResult) AddPreHook(f ...*gauge_messages.ProtoHookFailure)

func (ScenarioResult) AddTearDownSteps added in v0.3.0

func (s ScenarioResult) AddTearDownSteps(tearDownProtoItems []*gauge_messages.ProtoItem)

func (ScenarioResult) ExecTime added in v0.5.0

func (s ScenarioResult) ExecTime() int64

ExecTime returns the time taken for scenario execution

func (ScenarioResult) GetFailed added in v0.5.0

func (s ScenarioResult) GetFailed() bool

GetFailed returns the state of the scenario result

func (ScenarioResult) GetPostHook added in v0.5.0

func (s ScenarioResult) GetPostHook() []*gauge_messages.ProtoHookFailure

func (ScenarioResult) GetPreHook added in v0.5.0

func (ScenarioResult) Item added in v0.5.0

func (s ScenarioResult) Item() interface{}

func (ScenarioResult) SetFailure

func (s ScenarioResult) SetFailure()

SetFailure sets the scenarioResult as failed

func (ScenarioResult) UpdateExecutionTime

func (s ScenarioResult) UpdateExecutionTime()

type SpecResult

type SpecResult struct {
	ProtoSpec            *gauge_messages.ProtoSpec
	ScenarioFailedCount  int
	ScenarioCount        int
	IsFailed             bool
	FailedDataTableRows  []int32
	ExecutionTime        int64
	Skipped              bool
	ScenarioSkippedCount int
	Errors               []*gauge_messages.Error
}

SpecResult represents the result of spec execution

func (*SpecResult) AddExecTime

func (specResult *SpecResult) AddExecTime(execTime int64)

func (*SpecResult) AddPostHook added in v0.8.4

func (specResult *SpecResult) AddPostHook(f ...*gauge_messages.ProtoHookFailure)

func (*SpecResult) AddPreHook added in v0.8.4

func (specResult *SpecResult) AddPreHook(f ...*gauge_messages.ProtoHookFailure)

func (*SpecResult) AddScenarioResults

func (specResult *SpecResult) AddScenarioResults(scenarioResults []Result)

AddScenarioResults adds the scenario result to the spec result.

func (*SpecResult) AddSpecItems

func (specResult *SpecResult) AddSpecItems(resolvedItems []*gauge_messages.ProtoItem)

func (*SpecResult) AddTableDrivenScenarioResult

func (specResult *SpecResult) AddTableDrivenScenarioResult(r *ScenarioResult, t *gauge_messages.ProtoTable, scenarioRowIndex int, specRowIndex int, specTableDriven bool)

func (*SpecResult) AddTableRelatedScenarioResult added in v0.8.4

func (specResult *SpecResult) AddTableRelatedScenarioResult(scenarioResults [][]Result, index int)

AddTableRelatedScenarioResult aggregates the data table driven spec results.

func (*SpecResult) ExecTime added in v0.5.0

func (specResult *SpecResult) ExecTime() int64

func (*SpecResult) GetFailed added in v0.5.0

func (specResult *SpecResult) GetFailed() bool

GetFailed returns the state of the result

func (*SpecResult) GetPostHook added in v0.5.0

func (specResult *SpecResult) GetPostHook() []*gauge_messages.ProtoHookFailure

func (*SpecResult) GetPreHook added in v0.5.0

func (specResult *SpecResult) GetPreHook() []*gauge_messages.ProtoHookFailure

func (*SpecResult) Item added in v0.5.0

func (specResult *SpecResult) Item() interface{}

func (*SpecResult) SetFailure

func (specResult *SpecResult) SetFailure()

SetFailure sets the result to failed

func (*SpecResult) SetSkipped added in v0.5.0

func (specResult *SpecResult) SetSkipped(skipped bool)

type StepResult added in v0.5.0

type StepResult struct {
	ProtoStep  *gauge_messages.ProtoStep
	StepFailed bool
}

StepResult represents the result of step execution

func NewStepResult added in v0.5.0

func NewStepResult(ps *gauge_messages.ProtoStep) *StepResult

NewStepResult is a constructor for StepResult

func (*StepResult) AddExecTime added in v0.5.0

func (s *StepResult) AddExecTime(t int64)

AddExecTime increments the execution time by the given value

func (*StepResult) AddPostHook added in v0.8.4

func (s *StepResult) AddPostHook(f ...*gauge_messages.ProtoHookFailure)

func (*StepResult) AddPreHook added in v0.8.4

func (s *StepResult) AddPreHook(f ...*gauge_messages.ProtoHookFailure)

func (*StepResult) ExecTime added in v0.5.0

func (s *StepResult) ExecTime() int64

ExecTime returns the time taken to execute the step

func (*StepResult) GetErrorMessage added in v0.5.0

func (s *StepResult) GetErrorMessage() string

GetErrorMessage returns the error message for step failure

func (*StepResult) GetFailed added in v0.5.0

func (s *StepResult) GetFailed() bool

GetFailed returns the state of the result

func (*StepResult) GetPostHook added in v0.5.0

func (s *StepResult) GetPostHook() []*gauge_messages.ProtoHookFailure

func (*StepResult) GetPreHook added in v0.5.0

func (s *StepResult) GetPreHook() []*gauge_messages.ProtoHookFailure

func (*StepResult) GetStackTrace added in v0.5.0

func (s *StepResult) GetStackTrace() string

GetStackTrace returns the stacktrace for step failure

func (*StepResult) GetStepActualText added in v0.5.0

func (s *StepResult) GetStepActualText() string

GetStepActualText returns the Actual text of step from step result

func (*StepResult) GetStepFailed added in v0.5.0

func (s *StepResult) GetStepFailed() bool

GetFailed returns true if the actual step failed, and not step hook.

func (*StepResult) Item added in v0.5.0

func (s *StepResult) Item() interface{}

func (*StepResult) ProtoStepExecResult added in v0.5.0

func (s *StepResult) ProtoStepExecResult() *gauge_messages.ProtoStepExecutionResult

ProtoStepExecResult returns the step execution result used at the proto layer

func (*StepResult) SetFailure added in v0.5.0

func (s *StepResult) SetFailure()

SetFailure sets the result to failed

func (*StepResult) SetProtoExecResult added in v0.5.0

func (s *StepResult) SetProtoExecResult(r *gauge_messages.ProtoExecutionResult)

SetProtoExecResult sets the execution result

func (*StepResult) SetStepFailure added in v0.5.0

func (s *StepResult) SetStepFailure()

SetStepFailure sets the actual step as failed. StepResult.ProtoStep.GetFailed() returns true even if hook failed and not actual step.

type SuiteResult

type SuiteResult struct {
	SpecResults         []*SpecResult
	PreSuite            *(gauge_messages.ProtoHookFailure)
	PostSuite           *(gauge_messages.ProtoHookFailure)
	IsFailed            bool
	SpecsFailedCount    int
	ExecutionTime       int64 //in milliseconds
	UnhandledErrors     []error
	Environment         string
	Tags                string
	ProjectName         string
	Timestamp           string
	SpecsSkippedCount   int
	PreHookMessages     []string
	PostHookMessages    []string
	PreHookScreenshots  [][]byte
	PostHookScreenshots [][]byte
}

SuitResult represents the result of suit execution

func NewSuiteResult

func NewSuiteResult(tags string, startTime time.Time) *SuiteResult

NewSuiteResult is a constructor for SuitResult

func (*SuiteResult) AddPostHook added in v0.8.4

func (sr *SuiteResult) AddPostHook(f ...*gauge_messages.ProtoHookFailure)

func (*SuiteResult) AddPreHook added in v0.8.4

func (sr *SuiteResult) AddPreHook(f ...*gauge_messages.ProtoHookFailure)

func (*SuiteResult) AddSpecResult

func (sr *SuiteResult) AddSpecResult(specResult *SpecResult)

AddSpecResult adds a specs result to suit result.

func (*SuiteResult) AddSpecResults added in v0.5.0

func (sr *SuiteResult) AddSpecResults(specResults []*SpecResult)

AddSpecResults adds multiple spec results to suit result.

func (*SuiteResult) AddUnhandledError added in v0.5.0

func (sr *SuiteResult) AddUnhandledError(err error)

AddUnhandledError adds the unhandled error to suit result.

func (*SuiteResult) ExecTime added in v0.5.0

func (sr *SuiteResult) ExecTime() int64

ExecTime returns the time taken to execute the suit

func (*SuiteResult) GetFailed added in v0.5.0

func (sr *SuiteResult) GetFailed() bool

GetFailed returns the state of the result

func (*SuiteResult) GetPostHook added in v0.5.0

func (sr *SuiteResult) GetPostHook() []*gauge_messages.ProtoHookFailure

func (*SuiteResult) GetPreHook added in v0.5.0

func (sr *SuiteResult) GetPreHook() []*gauge_messages.ProtoHookFailure

func (*SuiteResult) Item added in v0.5.0

func (sr *SuiteResult) Item() interface{}

func (*SuiteResult) SetFailure

func (sr *SuiteResult) SetFailure()

SetFailure sets the result to failed

func (*SuiteResult) SetSpecsSkippedCount added in v0.5.0

func (sr *SuiteResult) SetSpecsSkippedCount()

SetSpecsSkippedCount sets the count of specs skipped.

func (*SuiteResult) UpdateExecTime added in v0.5.0

func (sr *SuiteResult) UpdateExecTime(startTime time.Time)

Jump to

Keyboard shortcuts

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