Documentation ¶
Index ¶
- Constants
- Variables
- func GetLogger() zerolog.Logger
- func Run(testcases ...ITestCase) error
- func SetLogLevel(level string)
- func SetLogPretty()
- func Step(name string) *step
- type Boomer
- type EnumHTTPMethod
- type IStep
- type ITestCase
- type ResponseObject
- type Runner
- type StepData
- type TCase
- type TConfig
- type TRequest
- type TStep
- type TValidator
- type TestCase
- type TestCasePath
- type TestCaseSummary
Constants ¶
View Source
const VERSION = "v0.1.0"
Variables ¶
View Source
var ErrUnsupportedFileExt = fmt.Errorf("unsupported testcase file extension")
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level string)
func SetLogPretty ¶
func SetLogPretty()
Types ¶
type Boomer ¶
func NewStandaloneBoomer ¶
type EnumHTTPMethod ¶
type EnumHTTPMethod string
const ( GET EnumHTTPMethod = "GET" HEAD EnumHTTPMethod = "HEAD" POST EnumHTTPMethod = "POST" PUT EnumHTTPMethod = "PUT" DELETE EnumHTTPMethod = "DELETE" OPTIONS EnumHTTPMethod = "OPTIONS" PATCH EnumHTTPMethod = "PATCH" )
type ResponseObject ¶
type ResponseObject struct {
// contains filtered or unexported fields
}
func NewResponseObject ¶
func (*ResponseObject) Extract ¶
func (v *ResponseObject) Extract(extractors map[string]string) map[string]interface{}
func (*ResponseObject) Validate ¶
func (v *ResponseObject) Validate(validators []TValidator, variablesMapping map[string]interface{}) (err error)
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) GetSummary ¶
func (r *Runner) GetSummary() *TestCaseSummary
func (*Runner) SetProxyUrl ¶
type TCase ¶
type TCase struct { Config TConfig `json:"config" yaml:"config"` TestSteps []*TStep `json:"teststeps" yaml:"teststeps"` }
used for testcase json loading and dumping
func (*TCase) ToTestCase ¶
type TConfig ¶
type TConfig struct { Name string `json:"name" yaml:"name"` Verify bool `json:"verify,omitempty" yaml:"verify,omitempty"` BaseURL string `json:"base_url,omitempty" yaml:"base_url,omitempty"` Variables map[string]interface{} `json:"variables,omitempty" yaml:"variables,omitempty"` Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` Weight int `json:"weight,omitempty" yaml:"weight,omitempty"` }
type TRequest ¶
type TRequest struct { Method EnumHTTPMethod `json:"method" yaml:"method"` URL string `json:"url" yaml:"url"` Params map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty"` Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"` Cookies map[string]string `json:"cookies,omitempty" yaml:"cookies,omitempty"` Body interface{} `json:"body,omitempty" yaml:"body,omitempty"` Timeout float32 `json:"timeout,omitempty" yaml:"timeout,omitempty"` AllowRedirects bool `json:"allow_redirects,omitempty" yaml:"allow_redirects,omitempty"` Verify bool `json:"verify,omitempty" yaml:"verify,omitempty"` }
type TStep ¶
type TStep struct { Name string `json:"name" yaml:"name"` Transaction string `json:"transaction,omitempty" yaml:"transaction,omitempty"` Request *TRequest `json:"request,omitempty" yaml:"request,omitempty"` TestCase *TestCase `json:"testcase,omitempty" yaml:"testcase,omitempty"` Variables map[string]interface{} `json:"variables,omitempty" yaml:"variables,omitempty"` SetupHooks []string `json:"setup_hooks,omitempty" yaml:"setup_hooks,omitempty"` TeardownHooks []string `json:"teardown_hooks,omitempty" yaml:"teardown_hooks,omitempty"` Extract map[string]string `json:"extract,omitempty" yaml:"extract,omitempty"` Validators []TValidator `json:"validate,omitempty" yaml:"validate,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` }
type TValidator ¶
type TValidator struct { Check string `json:"check,omitempty" yaml:"check,omitempty"` // get value with jmespath Assert string `json:"assert,omitempty" yaml:"assert,omitempty"` Expect interface{} `json:"expect,omitempty" yaml:"expect,omitempty"` Message string `json:"msg,omitempty" yaml:"msg,omitempty"` }
type TestCasePath ¶
type TestCasePath struct {
Path string
}
func (*TestCasePath) ToTCase ¶
func (path *TestCasePath) ToTCase() (*TCase, error)
func (*TestCasePath) ToTestCase ¶
func (path *TestCasePath) ToTestCase() (*TestCase, error)
type TestCaseSummary ¶
type TestCaseSummary struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.