Documentation
¶
Overview ¶
This project is created as the alternative to https://github.com/DATA-DOG/godog and is inspirited by it. There are a few differences between both solutions:
- GoBDD uses the built-in testing framework
- GoBDD is run as standard test case (not a separate program)
- you can use every Go native feature like build tags, pprof and so on
- the context in every test case contains all the required information to run (values passed from previous steps or step parameters). More information can be found in the readme file https://github.com/go-bdd/gobdd/blob/master/README.md
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Holds all the information about the suite (options, steps to execute etc)
func NewSuite ¶
func NewSuite(t *testing.T, options SuiteOptions) *Suite
Creates a new suites with given configuration and empty steps defined
func (*Suite) AddStep ¶
Adds a step to the suite The first parameter is the step definition which can be:
* string which will be converted to a regexp * [] byte which will be converted to a regexp as well * regexp
No other types are supported ¶
The second parameter is a function which will be executed when while running a scenario one of the steps will match the given pattern
type SuiteOptions ¶
type SuiteOptions struct {
// contains filtered or unexported fields
}
Holds all the information about how the suite or features/steps should be configured
func NewSuiteOptions ¶
func NewSuiteOptions() SuiteOptions
NewSuiteOptions creates a new suite configuration with default values
func (SuiteOptions) WithFeaturesPath ¶
func (options SuiteOptions) WithFeaturesPath(path string) SuiteOptions
Configures a pattern (regexp) where feature can be found. The default value is "features/*.feature"
func (SuiteOptions) WithIgnoredTags ¶
func (options SuiteOptions) WithIgnoredTags(tags []string) SuiteOptions
Configures which tags should be skipped while executing a suite Every tag has to start with @
func (SuiteOptions) WithTags ¶
func (options SuiteOptions) WithTags(tags []string) SuiteOptions
Configures which tags should be skipped while executing a suite Every tag has to start with @