Documentation ¶
Index ¶
- type SuiteBuilder
- func (suite *SuiteBuilder) Build() (map[string][]TestCase, error)
- func (suite *SuiteBuilder) GlobalName(name string) *SuiteBuilder
- func (suite *SuiteBuilder) GroupBy(column int) *SuiteBuilder
- func (suite *SuiteBuilder) Headers(haveHeaders bool) *SuiteBuilder
- func (suite *SuiteBuilder) RowTransformer(transformer func(row []string) []interface{}) *SuiteBuilder
- func (suite *SuiteBuilder) TestExecutor(executor TestExecutor) *SuiteBuilder
- func (suite *SuiteBuilder) Variables(vars map[string]interface{}) *SuiteBuilder
- type TestCase
- type TestExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SuiteBuilder ¶
type SuiteBuilder struct { Name string // contains filtered or unexported fields }
SuiteBuilder - Test suite main class.
func NewSuiteBuilder ¶
func NewSuiteBuilder(inputFile string) *SuiteBuilder
NewSuiteBuilder - Creates a new SuiteBuilder setting up input data file.
func (*SuiteBuilder) Build ¶
func (suite *SuiteBuilder) Build() (map[string][]TestCase, error)
Build - Takes the current state of the suite builder and creates the test cases ready to be executed. Steps to follow (each one will return the proper error if present): - Verify input file. - Replace parameters with text/template. - Read CSV rows and transform them from []string to []interface{}. - Skip first row if headers are present. - Group the final row properly. - Return the TestCase groups. ---
func (*SuiteBuilder) GlobalName ¶
func (suite *SuiteBuilder) GlobalName(name string) *SuiteBuilder
GlobalName - Sets up the suite name.
func (*SuiteBuilder) GroupBy ¶
func (suite *SuiteBuilder) GroupBy(column int) *SuiteBuilder
GroupBy - Sets up the column by which test cases should be grouped. If column value is invalid it will be ignored.
func (*SuiteBuilder) Headers ¶
func (suite *SuiteBuilder) Headers(haveHeaders bool) *SuiteBuilder
Headers - Sets up whether or not the input file have headers. False by default.
func (*SuiteBuilder) RowTransformer ¶
func (suite *SuiteBuilder) RowTransformer(transformer func(row []string) []interface{}) *SuiteBuilder
RowTransformer - Sets up a custom way to transform input values.
func (*SuiteBuilder) TestExecutor ¶
func (suite *SuiteBuilder) TestExecutor(executor TestExecutor) *SuiteBuilder
TestExecutor - Sets up the way in which data will be validated.
func (*SuiteBuilder) Variables ¶
func (suite *SuiteBuilder) Variables(vars map[string]interface{}) *SuiteBuilder
Variables - Sets up a map with the input variables values.
type TestCase ¶
type TestCase struct { Group string // contains filtered or unexported fields }
TestCase - Abstraction for the individual test case execution.
type TestExecutor ¶
type TestExecutor func(data []interface{}) bool
TestExecutor - Signature of the test executor function.