Documentation ¶
Index ¶
- Variables
- func Run(testcases ...ITestCase) error
- type HRPBoomer
- type HRPRunner
- type IStep
- type ITestCase
- type Iterator
- type Rendezvous
- type Request
- type StepRendezvous
- func (s *StepRendezvous) Name() string
- func (s *StepRendezvous) ToStruct() *TStep
- func (s *StepRendezvous) Type() string
- func (s *StepRendezvous) WithTimeout(timeout int64) *StepRendezvous
- func (s *StepRendezvous) WithUserNumber(number int64) *StepRendezvous
- func (s *StepRendezvous) WithUserPercent(percent float32) *StepRendezvous
- type StepRequest
- func (s *StepRequest) CallRefCase(tc *TestCase) *StepTestCaseWithOptionalArgs
- func (s *StepRequest) DELETE(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) EndTransaction(name string) *StepTransaction
- func (s *StepRequest) GET(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) HEAD(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) OPTIONS(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) PATCH(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) POST(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) PUT(url string) *StepRequestWithOptionalArgs
- func (s *StepRequest) Rendezvous(name string) *StepRendezvous
- func (s *StepRequest) SetupHook(hook string) *StepRequest
- func (s *StepRequest) StartTransaction(name string) *StepTransaction
- func (s *StepRequest) WithVariables(variables map[string]interface{}) *StepRequest
- type StepRequestExtraction
- func (s *StepRequestExtraction) Name() string
- func (s *StepRequestExtraction) ToStruct() *TStep
- func (s *StepRequestExtraction) Type() string
- func (s *StepRequestExtraction) Validate() *StepRequestValidation
- func (s *StepRequestExtraction) WithJmesPath(jmesPath string, varName string) *StepRequestExtraction
- type StepRequestValidation
- func (s *StepRequestValidation) AssertContainedBy(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertContains(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertEndsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertGreater(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertGreaterOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLengthEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLengthGreaterOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLengthGreaterThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLengthLessOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLengthLessThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLess(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertLessOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertNotEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertRegexp(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertStartsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertStringEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) AssertTypeMatch(jmesPath string, expected interface{}, msg string) *StepRequestValidation
- func (s *StepRequestValidation) Name() string
- func (s *StepRequestValidation) ToStruct() *TStep
- func (s *StepRequestValidation) Type() string
- type StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) Extract() *StepRequestExtraction
- func (s *StepRequestWithOptionalArgs) Name() string
- func (s *StepRequestWithOptionalArgs) SetAllowRedirects(allowRedirects bool) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) SetAuth(auth map[string]string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) SetProxies(proxies map[string]string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) SetTimeout(timeout float32) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) SetVerify(verify bool) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) TeardownHook(hook string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) ToStruct() *TStep
- func (s *StepRequestWithOptionalArgs) Type() string
- func (s *StepRequestWithOptionalArgs) Validate() *StepRequestValidation
- func (s *StepRequestWithOptionalArgs) WithBody(body interface{}) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) WithCookies(cookies map[string]string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) WithHeaders(headers map[string]string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) WithParams(params map[string]interface{}) *StepRequestWithOptionalArgs
- type StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) Export(names ...string) *StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) Name() string
- func (s *StepTestCaseWithOptionalArgs) TeardownHook(hook string) *StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) ToStruct() *TStep
- func (s *StepTestCaseWithOptionalArgs) Type() string
- type StepTransaction
- type TCase
- type TConfig
- func (c *TConfig) ExportVars(vars ...string) *TConfig
- func (c *TConfig) SetBaseURL(baseURL string) *TConfig
- func (c *TConfig) SetVerifySSL(verify bool) *TConfig
- func (c *TConfig) SetWeight(weight int) *TConfig
- func (c *TConfig) WithParameters(parameters map[string]interface{}) *TConfig
- func (c *TConfig) WithVariables(variables map[string]interface{}) *TConfig
- type TParamsConfig
- type TStep
- type TestCase
- type TestCasePath
- type Transaction
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedFileExt = fmt.Errorf("unsupported testcase file extension")
Functions ¶
Types ¶
type HRPBoomer ¶ added in v0.4.0
type HRPRunner ¶ added in v0.4.0
type HRPRunner struct {
// contains filtered or unexported fields
}
func (*HRPRunner) SetDebug ¶ added in v0.4.0
SetDebug configures whether to log HTTP request and response content.
func (*HRPRunner) SetFailfast ¶ added in v0.4.0
SetFailfast configures whether to stop running when one step fails.
func (*HRPRunner) SetProxyUrl ¶ added in v0.4.0
SetProxyUrl configures the proxy URL, which is usually used to capture HTTP packets for debugging.
type IStep ¶
IStep represents interface for all types for teststeps, includes: StepRequest, StepRequestWithOptionalArgs, StepRequestValidation, StepRequestExtraction, StepTestCaseWithOptionalArgs, StepTransaction, StepRendezvous.
type Rendezvous ¶ added in v0.3.0
type Rendezvous struct { Name string `json:"name" yaml:"name"` // required Percent float32 `json:"percent,omitempty" yaml:"percent,omitempty"` // default to 1(100%) Number int64 `json:"number,omitempty" yaml:"number,omitempty"` Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` // milliseconds // contains filtered or unexported fields }
type Request ¶ added in v0.2.2
type Request struct { Method string `json:"method" yaml:"method"` // required URL string `json:"url" yaml:"url"` // required 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"` }
Request represents HTTP request data structure. This is used for teststep.
type StepRendezvous ¶ added in v0.3.0
type StepRendezvous struct {
// contains filtered or unexported fields
}
StepRendezvous implements IStep interface.
func (*StepRendezvous) Name ¶ added in v0.3.0
func (s *StepRendezvous) Name() string
func (*StepRendezvous) ToStruct ¶ added in v0.3.0
func (s *StepRendezvous) ToStruct() *TStep
func (*StepRendezvous) Type ¶ added in v0.3.0
func (s *StepRendezvous) Type() string
func (*StepRendezvous) WithTimeout ¶ added in v0.5.4
func (s *StepRendezvous) WithTimeout(timeout int64) *StepRendezvous
WithTimeout sets the timeout of duration between each user arriving at the current rendezvous
func (*StepRendezvous) WithUserNumber ¶ added in v0.5.4
func (s *StepRendezvous) WithUserNumber(number int64) *StepRendezvous
WithUserNumber sets the user number needed to release the current rendezvous
func (*StepRendezvous) WithUserPercent ¶ added in v0.5.4
func (s *StepRendezvous) WithUserPercent(percent float32) *StepRendezvous
WithUserPercent sets the user percent needed to release the current rendezvous
type StepRequest ¶ added in v0.3.0
type StepRequest struct {
// contains filtered or unexported fields
}
func NewStep ¶ added in v0.2.2
func NewStep(name string) *StepRequest
NewStep returns a new constructed teststep with specified step name.
func (*StepRequest) CallRefCase ¶ added in v0.3.0
func (s *StepRequest) CallRefCase(tc *TestCase) *StepTestCaseWithOptionalArgs
CallRefCase calls a referenced testcase.
func (*StepRequest) DELETE ¶ added in v0.3.0
func (s *StepRequest) DELETE(url string) *StepRequestWithOptionalArgs
DELETE makes a HTTP DELETE request.
func (*StepRequest) EndTransaction ¶ added in v0.3.0
func (s *StepRequest) EndTransaction(name string) *StepTransaction
EndTransaction ends a transaction.
func (*StepRequest) GET ¶ added in v0.3.0
func (s *StepRequest) GET(url string) *StepRequestWithOptionalArgs
GET makes a HTTP GET request.
func (*StepRequest) HEAD ¶ added in v0.3.0
func (s *StepRequest) HEAD(url string) *StepRequestWithOptionalArgs
HEAD makes a HTTP HEAD request.
func (*StepRequest) OPTIONS ¶ added in v0.3.0
func (s *StepRequest) OPTIONS(url string) *StepRequestWithOptionalArgs
OPTIONS makes a HTTP OPTIONS request.
func (*StepRequest) PATCH ¶ added in v0.3.0
func (s *StepRequest) PATCH(url string) *StepRequestWithOptionalArgs
PATCH makes a HTTP PATCH request.
func (*StepRequest) POST ¶ added in v0.3.0
func (s *StepRequest) POST(url string) *StepRequestWithOptionalArgs
POST makes a HTTP POST request.
func (*StepRequest) PUT ¶ added in v0.3.0
func (s *StepRequest) PUT(url string) *StepRequestWithOptionalArgs
PUT makes a HTTP PUT request.
func (*StepRequest) Rendezvous ¶ added in v0.5.4
func (s *StepRequest) Rendezvous(name string) *StepRendezvous
Rendezvous creates a new rendezvous
func (*StepRequest) SetupHook ¶ added in v0.3.0
func (s *StepRequest) SetupHook(hook string) *StepRequest
SetupHook adds a setup hook for current teststep.
func (*StepRequest) StartTransaction ¶ added in v0.3.0
func (s *StepRequest) StartTransaction(name string) *StepTransaction
StartTransaction starts a transaction.
func (*StepRequest) WithVariables ¶ added in v0.3.0
func (s *StepRequest) WithVariables(variables map[string]interface{}) *StepRequest
WithVariables sets variables for current teststep.
type StepRequestExtraction ¶ added in v0.3.0
type StepRequestExtraction struct {
// contains filtered or unexported fields
}
StepRequestExtraction implements IStep interface.
func (*StepRequestExtraction) Name ¶ added in v0.3.0
func (s *StepRequestExtraction) Name() string
func (*StepRequestExtraction) ToStruct ¶ added in v0.3.0
func (s *StepRequestExtraction) ToStruct() *TStep
func (*StepRequestExtraction) Type ¶ added in v0.3.0
func (s *StepRequestExtraction) Type() string
func (*StepRequestExtraction) Validate ¶ added in v0.3.0
func (s *StepRequestExtraction) Validate() *StepRequestValidation
Validate switches to step validation.
func (*StepRequestExtraction) WithJmesPath ¶ added in v0.3.0
func (s *StepRequestExtraction) WithJmesPath(jmesPath string, varName string) *StepRequestExtraction
WithJmesPath sets the JMESPath expression to extract from the response.
type StepRequestValidation ¶ added in v0.3.0
type StepRequestValidation struct {
// contains filtered or unexported fields
}
StepRequestValidation implements IStep interface.
func (*StepRequestValidation) AssertContainedBy ¶ added in v0.4.0
func (s *StepRequestValidation) AssertContainedBy(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertContains ¶ added in v0.4.0
func (s *StepRequestValidation) AssertContains(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertEndsWith ¶ added in v0.3.0
func (s *StepRequestValidation) AssertEndsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertEqual ¶ added in v0.3.0
func (s *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertGreater ¶ added in v0.4.0
func (s *StepRequestValidation) AssertGreater(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertGreaterOrEqual ¶ added in v0.4.0
func (s *StepRequestValidation) AssertGreaterOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthEqual ¶ added in v0.3.0
func (s *StepRequestValidation) AssertLengthEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthGreaterOrEquals ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLengthGreaterOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthGreaterThan ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLengthGreaterThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthLessOrEquals ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLengthLessOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthLessThan ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLengthLessThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLess ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLess(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLessOrEqual ¶ added in v0.4.0
func (s *StepRequestValidation) AssertLessOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertNotEqual ¶ added in v0.4.0
func (s *StepRequestValidation) AssertNotEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertRegexp ¶ added in v0.4.0
func (s *StepRequestValidation) AssertRegexp(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertStartsWith ¶ added in v0.3.0
func (s *StepRequestValidation) AssertStartsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertStringEqual ¶ added in v0.4.0
func (s *StepRequestValidation) AssertStringEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertTypeMatch ¶ added in v0.4.0
func (s *StepRequestValidation) AssertTypeMatch(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) Name ¶ added in v0.3.0
func (s *StepRequestValidation) Name() string
func (*StepRequestValidation) ToStruct ¶ added in v0.3.0
func (s *StepRequestValidation) ToStruct() *TStep
func (*StepRequestValidation) Type ¶ added in v0.3.0
func (s *StepRequestValidation) Type() string
type StepRequestWithOptionalArgs ¶ added in v0.3.0
type StepRequestWithOptionalArgs struct {
// contains filtered or unexported fields
}
StepRequestWithOptionalArgs implements IStep interface.
func (*StepRequestWithOptionalArgs) Extract ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) Extract() *StepRequestExtraction
Extract switches to step extraction.
func (*StepRequestWithOptionalArgs) Name ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) Name() string
func (*StepRequestWithOptionalArgs) SetAllowRedirects ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) SetAllowRedirects(allowRedirects bool) *StepRequestWithOptionalArgs
SetAllowRedirects sets whether to allow redirects for current HTTP request.
func (*StepRequestWithOptionalArgs) SetAuth ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) SetAuth(auth map[string]string) *StepRequestWithOptionalArgs
SetAuth sets auth for current HTTP request.
func (*StepRequestWithOptionalArgs) SetProxies ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) SetProxies(proxies map[string]string) *StepRequestWithOptionalArgs
SetProxies sets proxies for current HTTP request.
func (*StepRequestWithOptionalArgs) SetTimeout ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) SetTimeout(timeout float32) *StepRequestWithOptionalArgs
SetTimeout sets timeout for current HTTP request.
func (*StepRequestWithOptionalArgs) SetVerify ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) SetVerify(verify bool) *StepRequestWithOptionalArgs
SetVerify sets whether to verify SSL for current HTTP request.
func (*StepRequestWithOptionalArgs) TeardownHook ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) TeardownHook(hook string) *StepRequestWithOptionalArgs
TeardownHook adds a teardown hook for current teststep.
func (*StepRequestWithOptionalArgs) ToStruct ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) ToStruct() *TStep
func (*StepRequestWithOptionalArgs) Type ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) Type() string
func (*StepRequestWithOptionalArgs) Validate ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) Validate() *StepRequestValidation
Validate switches to step validation.
func (*StepRequestWithOptionalArgs) WithBody ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) WithBody(body interface{}) *StepRequestWithOptionalArgs
WithBody sets HTTP request body for current step.
func (*StepRequestWithOptionalArgs) WithCookies ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) WithCookies(cookies map[string]string) *StepRequestWithOptionalArgs
WithCookies sets HTTP request cookies for current step.
func (*StepRequestWithOptionalArgs) WithHeaders ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) WithHeaders(headers map[string]string) *StepRequestWithOptionalArgs
WithHeaders sets HTTP request headers for current step.
func (*StepRequestWithOptionalArgs) WithParams ¶ added in v0.3.0
func (s *StepRequestWithOptionalArgs) WithParams(params map[string]interface{}) *StepRequestWithOptionalArgs
WithParams sets HTTP request params for current step.
type StepTestCaseWithOptionalArgs ¶ added in v0.3.0
type StepTestCaseWithOptionalArgs struct {
// contains filtered or unexported fields
}
StepTestCaseWithOptionalArgs implements IStep interface.
func (*StepTestCaseWithOptionalArgs) Export ¶ added in v0.3.0
func (s *StepTestCaseWithOptionalArgs) Export(names ...string) *StepTestCaseWithOptionalArgs
Export specifies variable names to export from referenced testcase for current step.
func (*StepTestCaseWithOptionalArgs) Name ¶ added in v0.3.0
func (s *StepTestCaseWithOptionalArgs) Name() string
func (*StepTestCaseWithOptionalArgs) TeardownHook ¶ added in v0.3.0
func (s *StepTestCaseWithOptionalArgs) TeardownHook(hook string) *StepTestCaseWithOptionalArgs
TeardownHook adds a teardown hook for current teststep.
func (*StepTestCaseWithOptionalArgs) ToStruct ¶ added in v0.3.0
func (s *StepTestCaseWithOptionalArgs) ToStruct() *TStep
func (*StepTestCaseWithOptionalArgs) Type ¶ added in v0.3.0
func (s *StepTestCaseWithOptionalArgs) Type() string
type StepTransaction ¶ added in v0.3.0
type StepTransaction struct {
// contains filtered or unexported fields
}
StepTransaction implements IStep interface.
func (*StepTransaction) Name ¶ added in v0.3.0
func (s *StepTransaction) Name() string
func (*StepTransaction) ToStruct ¶ added in v0.3.0
func (s *StepTransaction) ToStruct() *TStep
func (*StepTransaction) Type ¶ added in v0.3.0
func (s *StepTransaction) Type() string
type TCase ¶
type TCase struct { Config *TConfig `json:"config" yaml:"config"` TestSteps []*TStep `json:"teststeps" yaml:"teststeps"` }
TCase represents testcase data structure. Each testcase includes one public config and several sequential teststeps.
func (*TCase) ToTestCase ¶
type TConfig ¶
type TConfig struct { Name string `json:"name" yaml:"name"` // required 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"` ParametersSetting *TParamsConfig `json:"parameters_setting,omitempty" yaml:"parameters_setting,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` Weight int `json:"weight,omitempty" yaml:"weight,omitempty"` Path string `json:"path,omitempty" yaml:"path,omitempty"` // testcase file path }
TConfig represents config data structure for testcase. Each testcase should contain one config part.
func NewConfig ¶ added in v0.2.2
NewConfig returns a new constructed testcase config with specified testcase name.
func (*TConfig) ExportVars ¶ added in v0.2.2
ExportVars specifies variable names to export for current testcase.
func (*TConfig) SetBaseURL ¶ added in v0.2.2
SetBaseURL sets base URL for current testcase.
func (*TConfig) SetVerifySSL ¶ added in v0.2.2
SetVerifySSL sets whether to verify SSL for current testcase.
func (*TConfig) SetWeight ¶ added in v0.2.2
SetWeight sets weight for current testcase, which is used in load testing.
func (*TConfig) WithParameters ¶ added in v0.2.2
WithParameters sets parameters for current testcase.
func (*TConfig) WithVariables ¶ added in v0.2.2
WithVariables sets variables for current testcase.
type TParamsConfig ¶ added in v0.4.0
type TStep ¶
type TStep struct { Name string `json:"name" yaml:"name"` // required Request *Request `json:"request,omitempty" yaml:"request,omitempty"` TestCase *TestCase `json:"testcase,omitempty" yaml:"testcase,omitempty"` Transaction *Transaction `json:"transaction,omitempty" yaml:"transaction,omitempty"` Rendezvous *Rendezvous `json:"rendezvous,omitempty" yaml:"rendezvous,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 []Validator `json:"validate,omitempty" yaml:"validate,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` }
TStep represents teststep data structure. Each step maybe two different type: make one HTTP request or reference another testcase.
type TestCase ¶
TestCase is a container for one testcase, which is used for testcase runner. TestCase implements ITestCase interface.
func (*TestCase) ToTestCase ¶
type TestCasePath ¶
type TestCasePath struct {
Path string
}
TestCasePath implements ITestCase interface.
func (*TestCasePath) ToTCase ¶
func (path *TestCasePath) ToTCase() (*TCase, error)
func (*TestCasePath) ToTestCase ¶
func (path *TestCasePath) ToTestCase() (*TestCase, error)
type Transaction ¶ added in v0.3.0
type Transaction struct { Name string `json:"name" yaml:"name"` Type transactionType `json:"type" yaml:"type"` }
type Validator ¶ added in v0.2.2
type Validator struct { Check string `json:"check" yaml:"check"` // get value with jmespath Assert string `json:"assert" yaml:"assert"` Expect interface{} `json:"expect" yaml:"expect"` Message string `json:"msg,omitempty" yaml:"msg,omitempty"` // optional }
Validator represents validator for one HTTP response.