Documentation ¶
Index ¶
- type CaseData
- type DatabaseCheck
- type Test
- func (t *Test) AfterRequestScriptPath() string
- func (t *Test) AfterRequestScriptTimeout() int
- func (t *Test) BeforeScriptPath() string
- func (t *Test) BeforeScriptTimeout() int
- func (t *Test) Clone() models.TestInterface
- func (t *Test) ContentType() string
- func (t *Test) Cookies() map[string]string
- func (t *Test) DbQueryString() string
- func (t *Test) DbResponseJson() []string
- func (t *Test) DisallowExtraFields() bool
- func (t *Test) Fixtures() []string
- func (t *Test) GetCombinedVariables() map[string]string
- func (t *Test) GetDatabaseChecks() []models.DatabaseCheck
- func (t *Test) GetDescription() string
- func (t *Test) GetFileName() string
- func (t *Test) GetForm() *models.Form
- func (t *Test) GetMethod() string
- func (t *Test) GetName() string
- func (t *Test) GetRequest() string
- func (t *Test) GetResponse(code int) (string, bool)
- func (t *Test) GetResponseHeaders(code int) (map[string]string, bool)
- func (t *Test) GetResponses() map[int]string
- func (t *Test) GetStatus() string
- func (t *Test) GetVariables() map[string]string
- func (t *Test) GetVariablesToSet() map[int]map[string]string
- func (t *Test) Headers() map[string]string
- func (t *Test) IgnoreArraysOrdering() bool
- func (t *Test) IgnoreDbOrdering() bool
- func (t *Test) NeedsCheckingValues() bool
- func (t *Test) Path() string
- func (t *Test) Pause() int
- func (t *Test) ServiceMocks() map[string]interface{}
- func (t *Test) SetDatabaseChecks(checks []models.DatabaseCheck)
- func (t *Test) SetDbQueryString(query string)
- func (t *Test) SetDbResponseJson(responses []string)
- func (t *Test) SetForm(val *models.Form)
- func (t *Test) SetHeaders(val map[string]string)
- func (t *Test) SetMethod(val string)
- func (t *Test) SetPath(val string)
- func (t *Test) SetQuery(val string)
- func (t *Test) SetRequest(val string)
- func (t *Test) SetResponses(val map[int]string)
- func (t *Test) SetStatus(status string)
- func (t *Test) ToJSON() ([]byte, error)
- func (t *Test) ToQuery() string
- type TestDefinition
- type VariablesToSet
- type YamlFileLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaseData ¶
type CaseData struct { RequestArgs map[string]interface{} `json:"requestArgs" yaml:"requestArgs"` ResponseArgs map[int]map[string]interface{} `json:"responseArgs" yaml:"responseArgs"` BeforeScriptArgs map[string]interface{} `json:"beforeScriptArgs" yaml:"beforeScriptArgs"` AfterRequestScriptArgs map[string]interface{} `json:"afterRequestScriptArgs" yaml:"afterRequestScriptArgs"` DbQueryArgs map[string]interface{} `json:"dbQueryArgs" yaml:"dbQueryArgs"` DbResponseArgs map[string]interface{} `json:"dbResponseArgs" yaml:"dbResponseArgs"` DbResponse []string `json:"dbResponse" yaml:"dbResponse"` Description string `json:"description" yaml:"description"` Variables map[string]interface{} `json:"variables" yaml:"variables"` }
type DatabaseCheck ¶
type Test ¶
type Test struct { TestDefinition Filename string Request string Responses map[int]string ResponseHeaders map[int]map[string]string BeforeScript string AfterRequestScript string DbQuery string DbResponse []string CombinedVariables map[string]string DbChecks []models.DatabaseCheck }
func (*Test) AfterRequestScriptPath ¶
func (*Test) AfterRequestScriptTimeout ¶
func (*Test) BeforeScriptPath ¶
func (*Test) BeforeScriptTimeout ¶
func (*Test) Clone ¶
func (t *Test) Clone() models.TestInterface
func (*Test) ContentType ¶
TODO: it might make sense to do support of case-insensitive checking
func (*Test) DbQueryString ¶
func (*Test) DbResponseJson ¶
func (*Test) DisallowExtraFields ¶
func (*Test) GetCombinedVariables ¶
func (*Test) GetDatabaseChecks ¶
func (t *Test) GetDatabaseChecks() []models.DatabaseCheck
func (*Test) GetDescription ¶
func (*Test) GetFileName ¶
func (*Test) GetRequest ¶
func (*Test) GetResponseHeaders ¶
func (*Test) GetResponses ¶
func (*Test) GetVariables ¶
func (*Test) IgnoreArraysOrdering ¶
func (*Test) IgnoreDbOrdering ¶
func (*Test) NeedsCheckingValues ¶
func (*Test) ServiceMocks ¶
func (*Test) SetDatabaseChecks ¶
func (t *Test) SetDatabaseChecks(checks []models.DatabaseCheck)
func (*Test) SetDbQueryString ¶
func (*Test) SetDbResponseJson ¶
func (*Test) SetHeaders ¶
func (*Test) SetRequest ¶
func (*Test) SetResponses ¶
type TestDefinition ¶
type TestDefinition struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` Status string `json:"status" yaml:"status"` Variables map[string]string `json:"variables" yaml:"variables"` VariablesToSet VariablesToSet `json:"variables_to_set" yaml:"variables_to_set"` Form *models.Form `json:"form" yaml:"form"` Method string `json:"method" yaml:"method"` RequestURL string `json:"path" yaml:"path"` QueryParams string `json:"query" yaml:"query"` RequestTmpl string `json:"request" yaml:"request"` ResponseTmpls map[int]string `json:"response" yaml:"response"` ResponseHeaders map[int]map[string]string `json:"responseHeaders" yaml:"responseHeaders"` BeforeScriptParams scriptParams `json:"beforeScript" yaml:"beforeScript"` AfterRequestScriptParams scriptParams `json:"afterRequestScript" yaml:"afterRequestScript"` HeadersVal map[string]string `json:"headers" yaml:"headers"` CookiesVal map[string]string `json:"cookies" yaml:"cookies"` Cases []CaseData `json:"cases" yaml:"cases"` ComparisonParams compare.CompareParams `json:"comparisonParams" yaml:"comparisonParams"` FixtureFiles []string `json:"fixtures" yaml:"fixtures"` MocksDefinition map[string]interface{} `json:"mocks" yaml:"mocks"` PauseValue int `json:"pause" yaml:"pause"` DbQueryTmpl string `json:"dbQuery" yaml:"dbQuery"` DbResponseTmpl []string `json:"dbResponse" yaml:"dbResponse"` DatabaseChecks []DatabaseCheck `json:"dbChecks" yaml:"dbChecks"` }
type VariablesToSet ¶
func (*VariablesToSet) UnmarshalYAML ¶
func (v *VariablesToSet) UnmarshalYAML(unmarshal func(interface{}) error) error
There can be two types of data in yaml-file:
- JSON-paths: VariablesToSet: <code1>: <varName1>: <JSON_Path1> <varName2>: <JSON_Path2>
- Plain text: VariablesToSet: <code1>: <varName1> <code2>: <varName2> ... In this case we unmarshall values to format similar to JSON-paths format with empty paths: VariablesToSet: <code1>: <varName1>: "" <code2>: <varName2>: ""
type YamlFileLoader ¶
type YamlFileLoader struct {
// contains filtered or unexported fields
}
func NewLoader ¶
func NewLoader(testsLocation string) *YamlFileLoader
func (*YamlFileLoader) Load ¶
func (l *YamlFileLoader) Load() ([]models.TestInterface, error)
func (*YamlFileLoader) SetFileFilter ¶
func (l *YamlFileLoader) SetFileFilter(f string)
Click to show internal directories.
Click to hide internal directories.