Documentation ¶
Index ¶
- Constants
- Variables
- type Command
- type CommandType
- type FeaturesConfig
- type FeaturesFilterConfig
- type FeaturesOrder
- type FeaturesOrderType
- type GeneratedExpression
- type Location
- type ParameterTypeConfig
- type Pattern
- type PatternMatch
- type PatternType
- type RuntimeConfig
- type Status
- type StepDefinition
- type StepDefinitionConfig
- type SupportCodeConfig
- type TestCase
- type TestCaseHookDefinition
- type TestCaseHookDefinitionConfig
- type TestResult
- type TestRunResult
Constants ¶
const ( // CommandTypeStart is received to start the process CommandTypeStart = CommandType("start") // CommandTypeActionComplete is received when the caller has completed an action CommandTypeActionComplete = CommandType("action_complete") // CommandTypeRunBeforeTestRunHooks is sent to have the caller run before test run hooks CommandTypeRunBeforeTestRunHooks = CommandType("run_before_test_run_hooks") // CommandTypeInitializeTestCase is sent to have the caller initialize a test case CommandTypeInitializeTestCase = CommandType("initialize_test_case") // CommandTypeRunBeforeTestCaseHook is sent to have the caller run a before test case hook CommandTypeRunBeforeTestCaseHook = CommandType("run_before_test_case_hook") // CommandTypeRunTestStep is sent to have the caller run a step CommandTypeRunTestStep = CommandType("run_test_step") // CommandTypeRunAfterTestCaseHook is sent to have the caller run a after test case hook CommandTypeRunAfterTestCaseHook = CommandType("run_after_test_case_hook") // CommandTypeRunAfterTestRunHooks is sent to have the caller run after test run hooks CommandTypeRunAfterTestRunHooks = CommandType("run_after_test_run_hooks") // CommandTypeEvent is sent when an event occurs CommandTypeEvent = CommandType("event") // CommandTypeGenerateSnippet is sent to have the caller generate a step snippet for a pattern CommandTypeGenerateSnippet = CommandType("generate_snippet") // CommandTypeError is sent when an error occurs CommandTypeError = CommandType("error") )
const ( // FeaturesOrderTypeDefined is for the order of definition FeaturesOrderTypeDefined = FeaturesOrderType("defined") // FeaturesOrderTypeRandom is for a random order (with a given seed) FeaturesOrderTypeRandom = FeaturesOrderType("random") )
const ( // PatternTypeCucumberExpression is for a cucumber expression PatternTypeCucumberExpression = PatternType("cucumber_expression") // PatternTypeRegularExpression is for a regular expression PatternTypeRegularExpression = PatternType("regular_expression") )
Variables ¶
var ( // StatusAmbiguous is the status for a step with multiple definitions StatusAmbiguous = Status("ambiguous") // StatusFailed is the status for a hook/step that failed StatusFailed = Status("failed") // StatusPassed is the status for a hook/step that passod StatusPassed = Status("passed") // StatusPending is the status for a step with an incomplete definition StatusPending = Status("pending") // StatusSkipped is the status for a hook/step that is skipped deliberately // to cause the scenarin to be skipped or there was a previous error StatusSkipped = Status("skipped") // StatusUndefined is the status for a step without a definition StatusUndefined = Status("undefined") )
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { ID string `json:"id"` Type CommandType `json:"type"` // Used for type "action complete" ResponseTo string `json:"responseTo"` // Used for type "action complete" when action was // "run before/after test case hook" or "run test step" // and for type "run after test case hook" Result *TestResult `json:"result"` // Used for type "start" BaseDirectory string `json:"baseDirectory"` FeaturesConfig *FeaturesConfig `json:"featuresConfig"` RuntimeConfig *RuntimeConfig `json:"runtimeConfig"` SupportCodeConfig *SupportCodeConfig `json:"supportCodeConfig"` // Used for type "initialize_test_case", "run before/after test case hook", // and "run test step" TestCaseID string `json:"testCaseId"` // Used for type "initialize_test_case" TestCase *TestCase `json:"testCase"` Pickle *gherkin.Pickle `json:"pickle"` // Used for type "run before/after test case hook" TestCaseHookDefinitionID string `json:"testCaseHookDefinitionId"` // Used for type "run test step" StepDefinitionID string `json:"stepDefinitionId"` PatternMatches []*PatternMatch `json:"patternMatches"` // Used for type "run test step" and "generate snippet" PickleArguments []gherkin.Argument `json:"pickleArguments"` // Used for type "generate snippet" GeneratedExpressions []*GeneratedExpression `json:"generatedExpressions"` // Used for type "action complete" when action was "generate_snippet" Snippet string `json:"snippet"` // Used for type "event" Event interface{} `json:"event"` // Used for type "error" Error string `json:"error"` }
Command is a the struct used to communicate between this process and the calling process
type CommandType ¶
type CommandType string
CommandType is an enumeration of the available values for the Type field
type FeaturesConfig ¶
type FeaturesConfig struct { Language string `json:"language"` Order *FeaturesOrder `json:"order"` AbsolutePaths []string `json:"absolutePaths"` Filters *FeaturesFilterConfig `json:"filters"` }
FeaturesConfig is the configuration for what features to run
type FeaturesFilterConfig ¶
type FeaturesFilterConfig struct { TagExpression string `json:"tagExpression"` Names []string `json:"names"` Lines map[string][]int `json:"lines"` }
FeaturesFilterConfig is the configuration for how to filter the features
type FeaturesOrder ¶
type FeaturesOrder struct { Type FeaturesOrderType `json:"type"` Seed int64 `json:"seed"` }
FeaturesOrder is the configuration for what order to run the features in
type FeaturesOrderType ¶
type FeaturesOrderType string
FeaturesOrderType is an enumeration of the available values for the Type field in the FeaturesOrder struct
type GeneratedExpression ¶
type GeneratedExpression struct { Text string `json:"text"` ParameterTypeNames []string `json:"parameterTypeNames"` }
GeneratedExpression is an expression generated for an undefined step
type Location ¶
Location is location information within a file
func NewLocationForPickle ¶
NewLocationForPickle returns a Location for the given pickle and uri
func NewLocationForPickleStep ¶
func NewLocationForPickleStep(step *gherkin.PickleStep, uri string) *Location
NewLocationForPickleStep returns a Location for the given pickle step and uri
type ParameterTypeConfig ¶
type ParameterTypeConfig struct { Name string `json:"name"` Regexps []string `json:"regexps"` PreferForRegexpMatch bool `json:"preferForRegexpMatch"` UseForSnippets bool `json:"useForSnippets"` }
ParameterTypeConfig is the config for a cucumber expressions parameter type
type Pattern ¶
type Pattern struct { Source string `json:"source"` Type PatternType `json:"type"` }
Pattern is how the step definition matches text
func (Pattern) Expression ¶
func (p Pattern) Expression(parameterTypeRegistry *cucumberexpressions.ParameterTypeRegistry) (cucumberexpressions.Expression, error)
Expression returns the cucumber expression this pattern defines
type PatternMatch ¶
type PatternMatch struct { Captures []string `json:"captures"` ParameterTypeName string `json:"parameterTypeName"` }
PatternMatch is a match from the step pattern
type PatternType ¶
type PatternType string
PatternType is an enumeration of the available values for the Type field in the Pattern struct
type RuntimeConfig ¶
type RuntimeConfig struct { IsFailFast bool `json:"isFailFast"` IsDryRun bool `json:"isDryRun"` IsStrict bool `json:"isStrict"` MaxParallel int `json:"maxParallel"` }
RuntimeConfig is the configuration for the run
type Status ¶
type Status string
Status is an enumeration of the available values for the Status field in the TestResult struct
type StepDefinition ¶
type StepDefinition struct { ID string Expression cucumberexpressions.Expression URI string Line int }
StepDefinition is a StepDefinitionConfig where the patten has been converted to a cucumber expression
func (*StepDefinition) Location ¶
func (s *StepDefinition) Location() *Location
Location returns a Location for the step defio
type StepDefinitionConfig ¶
type StepDefinitionConfig struct { ID string `json:"id"` Pattern Pattern `json:"pattern"` URI string `json:"uri"` Line int `json:"line"` }
StepDefinitionConfig is the implementation of a step
type SupportCodeConfig ¶
type SupportCodeConfig struct { BeforeTestCaseHookDefinitionConfigs []*TestCaseHookDefinitionConfig `json:"beforeTestCaseHookDefinitions"` AfterTestCaseHookDefinitionConfigs []*TestCaseHookDefinitionConfig `json:"afterTestCaseHookDefinitions"` StepDefinitionConfigs []*StepDefinitionConfig `json:"stepDefinitions"` ParameterTypeConfigs []*ParameterTypeConfig `json:"parameterTypes"` }
SupportCodeConfig is the configuration for the support code
type TestCase ¶
type TestCase struct {
SourceLocation *Location `json:"sourceLocation"`
}
TestCase is the location information for a test case
type TestCaseHookDefinition ¶
type TestCaseHookDefinition struct { ID string TagExpression tagexpressions.Evaluatable URI string Line int }
TestCaseHookDefinition is a TestCaseHookDefinitionConfig where the tag expression has been converted to a TagExpression
func (*TestCaseHookDefinition) Location ¶
func (t *TestCaseHookDefinition) Location() *Location
Location returns a Location for the test case hook definition
type TestCaseHookDefinitionConfig ¶
type TestCaseHookDefinitionConfig struct { ID string `json:"id"` TagExpression string `json:"tagExpression"` URI string `json:"uri"` Line int `json:"line"` }
TestCaseHookDefinitionConfig is hook that run before or after a test case
type TestResult ¶
type TestResult struct { Duration int `json:"duration"` Status Status `json:"status"` Message string `json:"message"` }
TestResult is the result of a test case
type TestRunResult ¶
TestRunResult is the result of a test run
func NewTestRunResult ¶ added in v0.0.3
func NewTestRunResult() *TestRunResult
NewTestRunResult creates a new test run result
func (*TestRunResult) Update ¶ added in v0.0.3
func (t *TestRunResult) Update(testCaseResult *TestResult, isStrict bool)
Update updates the test run result with a test case result
Source Files ¶
- command.go
- command_type.go
- features_config.go
- features_filter_config.go
- features_order.go
- features_order_type.go
- generated_expression.go
- location.go
- parameter_type_config.go
- pattern.go
- pattern_match.go
- pattern_type.go
- runtime_config.go
- status.go
- step_definition.go
- support_code_config.go
- test_case.go
- test_case_hook_definition.go
- test_result.go
- test_run_result.go