Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell represents a data table cell.
type DataTable ¶
type DataTable struct {
// contains filtered or unexported fields
}
DataTable wraps a data table step argument
func (DataTable) HeaderTable ¶
func (d DataTable) HeaderTable() *HeaderTable
HeaderTable returns the data table as a header table which is a wrapper around the table which assumes that the first row is the table header.
type HeaderTable ¶
type HeaderTable struct {
DataTable
// contains filtered or unexported fields
}
HeaderTable is a wrapper around a table which assumes that the first row is \ the table header.
func (*HeaderTable) Get ¶
func (h *HeaderTable) Get(row int, col string) *Cell
Get returns the cell at the provided row offset (skipping the header row) and column name (as indicated in the header).
func (*HeaderTable) NumRows ¶
func (h *HeaderTable) NumRows() int
NumRows returns the number of rows in the table (excluding the header row).
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is a test runner.
func NewRunner ¶
func NewRunner(t *testing.T, initScenario func(t TestingT) StepDefinitions) *Runner
NewRunner constructs a new Runner with the provided initScenario function. initScenario will be called for each test case returning a new suite instance for each test case which can be used for sharing state between steps. It is expected that the suite will retain a copy of the TestingT instance for usage in each step. Complex initialization should not be done in initScenario but rather with a Before hook.
func (*Runner) NonParallel ¶
NonParallel instructs the runner not to run tests in parallel (which is the default).
func (*Runner) Path ¶ added in v0.3.0
Path specifies glob paths for the runner to look up .feature files. The default is `features/*.feature`.
func (*Runner) Step ¶
Step can be used to manually register a step with the runner. step should be a string or *regexp.Regexp instance. definition should be a function which takes the suite as its first argument (usually an instance method), parameter arguments next (with string, int64, *big.Int, and *apd.Decimal as valid parameter values) and gocuke.DocString or gocuke.DataTable as the last argument if this step uses a doc string or data table respectively. Custom step definitions will always take priority of auto-discovered step definitions.
type Scenario ¶ added in v0.3.0
type Scenario interface {
Name() string
Tags() []string
// contains filtered or unexported methods
}
Scenario is a special step argument type that can be used in a step definition or hook method.
type StepDefinitions ¶ added in v0.3.0
type StepDefinitions interface{}
StepDefinitions is a dummy interface to mark a struct containing step definitions.
type TestingT ¶
type TestingT interface {
Error(args ...interface{})
Errorf(format string, args ...interface{})
Fail()
FailNow()
Failed() bool
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
Log(args ...interface{})
Logf(format string, args ...interface{})
Skip(args ...interface{})
SkipNow()
Skipf(format string, args ...interface{})
Helper()
}
TestingT is the common subset of testing methods exposed to test suite instances and expected by common assertion and mocking libraries.