Documentation ¶
Index ¶
- Constants
- Variables
- func BuildPlugin(path string, output string) (err error)
- func GetProjectRootDirPath(path string) (rootDir string, err error)
- func Run(t *testing.T, testcases ...ITestCase) error
- type API
- type APIGetMasterRequestBody
- type APIGetMasterResponseBody
- type APIGetWorkersRequestBody
- type APIGetWorkersResponseBody
- type APIPath
- type ActionType
- type Address
- type CaseRunner
- type CommonResponseBody
- type HRPBoomer
- func (b *HRPBoomer) BytesToTCases(testCasesBytes []byte) []*TCase
- func (b *HRPBoomer) ConvertTestCasesToBoomerTasks(testcases ...ITestCase) (taskSlice []*boomer.Task)
- func (b *HRPBoomer) InitBoomer()
- func (b *HRPBoomer) NewAPIHandler() *apiHandler
- func (b *HRPBoomer) ParseTestCases(testCases []*TestCase) []*TCase
- func (b *HRPBoomer) PollTasks(ctx context.Context)
- func (b *HRPBoomer) PollTestCases(ctx context.Context)
- func (b *HRPBoomer) Quit()
- func (b *HRPBoomer) Run(testcases ...ITestCase)
- func (b *HRPBoomer) SetClientTransport() *HRPBoomer
- func (b *HRPBoomer) SetPython3Venv(venv string) *HRPBoomer
- func (b *HRPBoomer) StartServer(ctx context.Context, addr string)
- func (b *HRPBoomer) TestCasesToBytes(testcases ...ITestCase) []byte
- type HRPRunner
- func (r *HRPRunner) GenHTMLReport() *HRPRunner
- func (r *HRPRunner) NewCaseRunner(testcase *TestCase) (*CaseRunner, error)
- func (r *HRPRunner) Run(testcases ...ITestCase) (err error)
- func (r *HRPRunner) SetCaseTimeout(seconds float32) *HRPRunner
- func (r *HRPRunner) SetClientTransport(maxConns int, disableKeepAlive bool, disableCompression bool) *HRPRunner
- func (r *HRPRunner) SetFailfast(failfast bool) *HRPRunner
- func (r *HRPRunner) SetHTTPStatOn() *HRPRunner
- func (r *HRPRunner) SetPluginLogOn() *HRPRunner
- func (r *HRPRunner) SetProxyUrl(proxyUrl string) *HRPRunner
- func (r *HRPRunner) SetPython3Venv(venv string) *HRPRunner
- func (r *HRPRunner) SetRequestTimeout(seconds float32) *HRPRunner
- func (r *HRPRunner) SetRequestsLogOn() *HRPRunner
- func (r *HRPRunner) SetSaveTests(saveTests bool) *HRPRunner
- type HTTPMethod
- type IAPI
- type IStep
- type ITestCase
- type MessageType
- type MobileStep
- type Parameters
- type ParametersIterator
- type Parser
- func (p *Parser) Parse(raw interface{}, variablesMapping map[string]interface{}) (interface{}, error)
- func (p *Parser) ParseHeaders(rawHeaders map[string]string, variablesMapping map[string]interface{}) (map[string]string, error)
- func (p *Parser) ParseString(raw string, variablesMapping map[string]interface{}) (interface{}, error)
- func (p *Parser) ParseVariables(variables map[string]interface{}) (map[string]interface{}, error)
- type Platform
- type PluginConfig
- type QuitRequestBody
- type RebalanceRequestBody
- type Rendezvous
- type ReqResps
- type Request
- type ServerCode
- type ServerStatus
- type SessionData
- type SessionRunner
- func (r *SessionRunner) GetSummary() (*TestCaseSummary, error)
- func (r *SessionRunner) InitWithParameters(parameters map[string]interface{})
- func (r *SessionRunner) ParseStepValidators(iValidators []interface{}, stepVariables map[string]interface{}) ([]interface{}, error)
- func (r *SessionRunner) ParseStepVariables(stepVariables map[string]interface{}) (map[string]interface{}, error)
- func (r *SessionRunner) Start(givenVars map[string]interface{}) error
- type StartRequestBody
- type Stat
- type StepAPIWithOptionalArgs
- func (s *StepAPIWithOptionalArgs) Export(names ...string) *StepAPIWithOptionalArgs
- func (s *StepAPIWithOptionalArgs) Name() string
- func (s *StepAPIWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepResult, err error)
- func (s *StepAPIWithOptionalArgs) Struct() *TStep
- func (s *StepAPIWithOptionalArgs) TeardownHook(hook string) *StepAPIWithOptionalArgs
- func (s *StepAPIWithOptionalArgs) Type() StepType
- type StepMobile
- func (s *StepMobile) AppLaunch(bundleId string) *StepMobile
- func (s *StepMobile) AppTerminate(bundleId string) *StepMobile
- func (s *StepMobile) Back(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) ClosePopups(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) DoubleTap(params string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) DoubleTapXY(x, y float64, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) Home() *StepMobile
- func (s *StepMobile) Input(text string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) InstallApp(path string) *StepMobile
- func (s *StepMobile) Name() string
- func (s *StepMobile) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepMobile) ScreenShot(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) Serial(serial string) *StepMobile
- func (s *StepMobile) Sleep(n float64) *StepMobile
- func (s *StepMobile) SleepRandom(params ...float64) *StepMobile
- func (s *StepMobile) StartCamera() *StepMobile
- func (s *StepMobile) StopCamera() *StepMobile
- func (s *StepMobile) Struct() *TStep
- func (s *StepMobile) Swipe(sx, sy, ex, ey float64, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeDown(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeLeft(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeRight(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeToTapApp(appName string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeToTapText(text string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeToTapTexts(texts interface{}, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) SwipeUp(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) Tap(params string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) TapAbsXY(x, y float64, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) TapByCV(imagePath string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) TapByOCR(ocrText string, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) TapByUITypes(options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) TapXY(x, y float64, options ...uixt.ActionOption) *StepMobile
- func (s *StepMobile) Type() StepType
- func (s *StepMobile) Validate() *StepMobileUIValidation
- func (s *StepMobile) VideoCrawler(params map[string]interface{}) *StepMobile
- type StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertAppInForeground(packageName string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertAppNotInForeground(packageName string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertImageExists(expectedImagePath string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertImageNotExists(expectedImagePath string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertLabelExists(expectedLabel string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertLabelNotExists(expectedLabel string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertNameExists(expectedName string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertNameNotExists(expectedName string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertOCRExists(expectedText string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) AssertOCRNotExists(expectedText string, msg ...string) *StepMobileUIValidation
- func (s *StepMobileUIValidation) Name() string
- func (s *StepMobileUIValidation) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepMobileUIValidation) Struct() *TStep
- func (s *StepMobileUIValidation) Type() StepType
- type StepRendezvous
- func (s *StepRendezvous) Name() string
- func (s *StepRendezvous) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepRendezvous) Struct() *TStep
- func (s *StepRendezvous) Type() StepType
- 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) Android() *StepMobile
- func (s *StepRequest) CallRefAPI(api IAPI) *StepAPIWithOptionalArgs
- func (s *StepRequest) CallRefCase(tc ITestCase) *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) HTTP2() *StepRequest
- func (s *StepRequest) IOS() *StepMobile
- func (s *StepRequest) Loop(times int) *StepRequest
- 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) SetRendezvous(name string) *StepRendezvous
- func (s *StepRequest) SetThinkTime(time float64) *StepThinkTime
- func (s *StepRequest) SetupHook(hook string) *StepRequest
- func (s *StepRequest) StartTransaction(name string) *StepTransaction
- func (s *StepRequest) WebSocket() *StepWebSocket
- func (s *StepRequest) WithVariables(variables map[string]interface{}) *StepRequest
- type StepRequestExtraction
- func (s *StepRequestExtraction) Name() string
- func (s *StepRequestExtraction) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepRequestExtraction) Struct() *TStep
- func (s *StepRequestExtraction) Type() StepType
- 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) AssertEqualFold(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) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepRequestValidation) Struct() *TStep
- func (s *StepRequestValidation) Type() StepType
- type StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) Extract() *StepRequestExtraction
- func (s *StepRequestWithOptionalArgs) Name() string
- func (s *StepRequestWithOptionalArgs) Run(r *SessionRunner) (*StepResult, error)
- 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 time.Duration) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) SetVerify(verify bool) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) Struct() *TStep
- func (s *StepRequestWithOptionalArgs) TeardownHook(hook string) *StepRequestWithOptionalArgs
- func (s *StepRequestWithOptionalArgs) Type() StepType
- 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
- func (s *StepRequestWithOptionalArgs) WithUpload(upload map[string]interface{}) *StepRequestWithOptionalArgs
- type StepResult
- type StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) Export(names ...string) *StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) Name() string
- func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepResult, err error)
- func (s *StepTestCaseWithOptionalArgs) Struct() *TStep
- func (s *StepTestCaseWithOptionalArgs) TeardownHook(hook string) *StepTestCaseWithOptionalArgs
- func (s *StepTestCaseWithOptionalArgs) Type() StepType
- type StepThinkTime
- type StepTransaction
- type StepType
- type StepWebSocket
- func (s *StepWebSocket) CloseConnection(url ...string) *StepWebSocket
- func (s *StepWebSocket) Extract() *StepRequestExtraction
- func (s *StepWebSocket) Name() string
- func (s *StepWebSocket) NewConnection() *StepWebSocket
- func (s *StepWebSocket) OpenConnection(url ...string) *StepWebSocket
- func (s *StepWebSocket) PingPong(url ...string) *StepWebSocket
- func (s *StepWebSocket) Read(url ...string) *StepWebSocket
- func (s *StepWebSocket) Run(r *SessionRunner) (*StepResult, error)
- func (s *StepWebSocket) Struct() *TStep
- func (s *StepWebSocket) Type() StepType
- func (s *StepWebSocket) Validate() *StepRequestValidation
- func (s *StepWebSocket) WithBinaryMessage(message interface{}) *StepWebSocket
- func (s *StepWebSocket) WithCloseStatus(closeStatus int64) *StepWebSocket
- func (s *StepWebSocket) WithHeaders(headers map[string]string) *StepWebSocket
- func (s *StepWebSocket) WithParams(params map[string]interface{}) *StepWebSocket
- func (s *StepWebSocket) WithTextMessage(message interface{}) *StepWebSocket
- func (s *StepWebSocket) WithTimeout(timeout int64) *StepWebSocket
- func (s *StepWebSocket) Write(url ...string) *StepWebSocket
- func (s *StepWebSocket) WriteAndRead(url ...string) *StepWebSocket
- type StopRequestBody
- type Summary
- type TCase
- type TConfig
- func (c *TConfig) ExportVars(vars ...string) *TConfig
- func (c *TConfig) SetAndroid(options ...uixt.AndroidDeviceOption) *TConfig
- func (c *TConfig) SetBaseURL(baseURL string) *TConfig
- func (c *TConfig) SetCaseTimeout(seconds float32) *TConfig
- func (c *TConfig) SetHeaders(headers map[string]string) *TConfig
- func (c *TConfig) SetIOS(options ...uixt.IOSDeviceOption) *TConfig
- func (c *TConfig) SetRequestTimeout(seconds float32) *TConfig
- func (c *TConfig) SetThinkTime(strategy thinkTimeStrategy, cfg interface{}, limit float64) *TConfig
- func (c *TConfig) SetVerifySSL(verify bool) *TConfig
- func (c *TConfig) SetWebSocket(times, interval, timeout, size int64) *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 TestCaseInOut
- type TestCasePath
- type TestCaseStat
- type TestCaseSummary
- type TestCaseTime
- type TestStepStat
- type ThinkTime
- type ThinkTimeConfig
- type Transaction
- type ValidationResult
- type Validator
- type WebSocketAction
- type WebSocketConfig
Constants ¶
const ( PluginGoBuiltFile = "debugtalk.so" // built from go official plugin PluginHashicorpGoBuiltFile = "debugtalk.bin" // built from hashicorp go plugin PluginGoSourceFile = "debugtalk.go" // golang function plugin source file PluginGoSourceGenFile = "debugtalk_gen.go" // generated for hashicorp go plugin PluginPySourceFile = "debugtalk.py" // python function plugin source file PluginPySourceGenFile = ".debugtalk_gen.py" // generated for hashicorp python plugin )
Variables ¶
var EnumAPIResponseSuccess = ServerStatus{ Code: Success, Message: "success", }
Functions ¶
func BuildPlugin ¶
func GetProjectRootDirPath ¶
Types ¶
type API ¶
type API struct { Name string `json:"name" yaml:"name"` // required Request *Request `json:"request,omitempty" yaml:"request,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 []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` Path string }
type APIGetMasterRequestBody ¶ added in v4.2.0
type APIGetMasterRequestBody struct{}
type APIGetMasterResponseBody ¶ added in v4.2.0
type APIGetMasterResponseBody struct { ServerStatus Data map[string]interface{} `json:"data"` }
type APIGetWorkersRequestBody ¶ added in v4.2.0
type APIGetWorkersRequestBody struct{}
type APIGetWorkersResponseBody ¶ added in v4.2.0
type APIGetWorkersResponseBody struct { ServerStatus Data []boomer.WorkerNode `json:"data"` }
type ActionType ¶
type ActionType string
type Address ¶
type Address struct { ClientIP string `json:"client_ip,omitempty" yaml:"client_ip,omitempty"` ClientPort string `json:"client_port,omitempty" yaml:"client_port,omitempty"` ServerIP string `json:"server_ip,omitempty" yaml:"server_ip,omitempty"` ServerPort string `json:"server_port,omitempty" yaml:"server_port,omitempty"` }
type CaseRunner ¶ added in v4.3.0
type CaseRunner struct {
// contains filtered or unexported fields
}
func (*CaseRunner) NewSession ¶ added in v4.3.0
func (r *CaseRunner) NewSession() *SessionRunner
each boomer task initiates a new session in order to avoid data racing
type CommonResponseBody ¶ added in v4.2.0
type CommonResponseBody struct {
ServerStatus
}
type HRPBoomer ¶
func NewMasterBoomer ¶ added in v4.2.0
func NewStandaloneBoomer ¶ added in v4.2.0
func NewWorkerBoomer ¶ added in v4.2.0
func (*HRPBoomer) BytesToTCases ¶ added in v4.2.0
func (*HRPBoomer) ConvertTestCasesToBoomerTasks ¶ added in v4.2.0
func (*HRPBoomer) InitBoomer ¶ added in v4.2.0
func (b *HRPBoomer) InitBoomer()
func (*HRPBoomer) NewAPIHandler ¶ added in v4.2.0
func (b *HRPBoomer) NewAPIHandler() *apiHandler
func (*HRPBoomer) ParseTestCases ¶ added in v4.2.0
func (*HRPBoomer) PollTestCases ¶ added in v4.2.0
func (*HRPBoomer) SetClientTransport ¶
func (*HRPBoomer) SetPython3Venv ¶ added in v4.1.3
SetPython3Venv specifies python3 venv.
func (*HRPBoomer) StartServer ¶ added in v4.2.0
func (*HRPBoomer) TestCasesToBytes ¶ added in v4.2.0
type HRPRunner ¶
type HRPRunner struct {
// contains filtered or unexported fields
}
func (*HRPRunner) GenHTMLReport ¶
GenHTMLReport configures whether to gen html report of api tests.
func (*HRPRunner) NewCaseRunner ¶ added in v4.3.0
func (r *HRPRunner) NewCaseRunner(testcase *TestCase) (*CaseRunner, error)
NewCaseRunner creates a new case runner for testcase. each testcase has its own case runner
func (*HRPRunner) SetCaseTimeout ¶ added in v4.3.4
SetCaseTimeout configures global testcase timeout in seconds.
func (*HRPRunner) SetClientTransport ¶
func (r *HRPRunner) SetClientTransport(maxConns int, disableKeepAlive bool, disableCompression bool) *HRPRunner
SetClientTransport configures transport of http client for high concurrency load testing
func (*HRPRunner) SetFailfast ¶
SetFailfast configures whether to stop running when one step fails.
func (*HRPRunner) SetHTTPStatOn ¶
SetHTTPStatOn turns on HTTP latency stat.
func (*HRPRunner) SetPluginLogOn ¶
SetPluginLogOn turns on plugin logging.
func (*HRPRunner) SetProxyUrl ¶
SetProxyUrl configures the proxy URL, which is usually used to capture HTTP packets for debugging.
func (*HRPRunner) SetPython3Venv ¶ added in v4.1.3
SetPython3Venv specifies python3 venv.
func (*HRPRunner) SetRequestTimeout ¶ added in v4.3.4
SetRequestTimeout configures global request timeout in seconds.
func (*HRPRunner) SetRequestsLogOn ¶
SetRequestsLogOn turns on request & response details logging.
func (*HRPRunner) SetSaveTests ¶
SetSaveTests configures whether to save summary of tests.
type HTTPMethod ¶
type HTTPMethod string
type IStep ¶
type IStep interface { Name() string Type() StepType Struct() *TStep Run(*SessionRunner) (*StepResult, error) }
IStep represents interface for all types for teststeps, includes: StepRequest, StepRequestWithOptionalArgs, StepRequestValidation, StepRequestExtraction, StepTestCaseWithOptionalArgs, StepTransaction, StepRendezvous, StepWebSocket.
type MessageType ¶
type MessageType int
type MobileStep ¶ added in v4.3.0
type MobileStep struct { Serial string `json:"serial,omitempty" yaml:"serial,omitempty"` // android serial or ios udid uixt.MobileAction `yaml:",inline"` Actions []uixt.MobileAction `json:"actions,omitempty" yaml:"actions,omitempty"` }
type Parameters ¶
type Parameters []map[string]interface{}
[
{"username": "test1", "password": "111111"}, {"username": "test2", "password": "222222"},
]
type ParametersIterator ¶
func (*ParametersIterator) HasNext ¶
func (iter *ParametersIterator) HasNext() bool
func (*ParametersIterator) Next ¶
func (iter *ParametersIterator) Next() map[string]interface{}
func (*ParametersIterator) SetUnlimitedMode ¶
func (iter *ParametersIterator) SetUnlimitedMode()
SetUnlimitedMode is used for load testing
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseHeaders ¶
type PluginConfig ¶ added in v4.2.0
type QuitRequestBody ¶ added in v4.2.0
type QuitRequestBody struct {
Worker string `json:"worker"`
}
type RebalanceRequestBody ¶ added in v4.2.0
type Rendezvous ¶
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 ReqResps ¶
type ReqResps struct { Request interface{} `json:"request" yaml:"request"` Response interface{} `json:"response" yaml:"response"` }
type Request ¶
type Request struct { Method HTTPMethod `json:"method" yaml:"method"` // required URL string `json:"url" yaml:"url"` // required HTTP2 bool `json:"http2,omitempty" yaml:"http2,omitempty"` 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"` Json interface{} `json:"json,omitempty" yaml:"json,omitempty"` Data interface{} `json:"data,omitempty" yaml:"data,omitempty"` Timeout float64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` // timeout in seconds AllowRedirects bool `json:"allow_redirects,omitempty" yaml:"allow_redirects,omitempty"` Verify bool `json:"verify,omitempty" yaml:"verify,omitempty"` Upload map[string]interface{} `json:"upload,omitempty" yaml:"upload,omitempty"` }
Request represents HTTP request data structure. This is used for teststep.
type ServerCode ¶ added in v4.2.0
type ServerCode int
const ( Success ServerCode = iota ParamsError ServerError StopError )
server response code
type ServerStatus ¶ added in v4.2.0
type ServerStatus struct { Code ServerCode `json:"code"` Message string `json:"message"` }
ServerStatus stores http response code and message
func CustomAPIResponse ¶ added in v4.2.0
func CustomAPIResponse(errCode ServerCode, errMsg string) ServerStatus
func EnumAPIResponseParamError ¶ added in v4.2.0
func EnumAPIResponseParamError(errMsg string) ServerStatus
func EnumAPIResponseServerError ¶ added in v4.2.0
func EnumAPIResponseServerError(errMsg string) ServerStatus
func EnumAPIResponseStopError ¶ added in v4.2.0
func EnumAPIResponseStopError(errMsg string) ServerStatus
type SessionData ¶
type SessionData struct { Success bool `json:"success" yaml:"success"` ReqResps *ReqResps `json:"req_resps" yaml:"req_resps"` Address *Address `json:"address,omitempty" yaml:"address,omitempty"` // TODO Validators []*ValidationResult `json:"validators,omitempty" yaml:"validators,omitempty"` }
type SessionRunner ¶
type SessionRunner struct {
// contains filtered or unexported fields
}
SessionRunner is used to run testcase and its steps. each testcase has its own SessionRunner instance and share session variables.
func (*SessionRunner) GetSummary ¶
func (r *SessionRunner) GetSummary() (*TestCaseSummary, error)
func (*SessionRunner) InitWithParameters ¶ added in v4.3.0
func (r *SessionRunner) InitWithParameters(parameters map[string]interface{})
InitWithParameters updates session variables with given parameters. this is used for data driven
func (*SessionRunner) ParseStepValidators ¶ added in v4.3.6
func (r *SessionRunner) ParseStepValidators(iValidators []interface{}, stepVariables map[string]interface{}) ([]interface{}, error)
func (*SessionRunner) ParseStepVariables ¶ added in v4.3.0
func (r *SessionRunner) ParseStepVariables(stepVariables map[string]interface{}) (map[string]interface{}, error)
ParseStepVariables merges step variables with config variables and session variables
func (*SessionRunner) Start ¶
func (r *SessionRunner) Start(givenVars map[string]interface{}) error
Start runs the test steps in sequential order. givenVars is used for data driven
type StartRequestBody ¶ added in v4.2.0
type StartRequestBody struct { boomer.Profile `mapstructure:",squash"` Worker string `json:"worker,omitempty" yaml:"worker,omitempty" mapstructure:"worker"` // all TestCasePath string `json:"testcase-path" yaml:"testcase-path" mapstructure:"testcase-path"` Other map[string]interface{} `mapstructure:",remain"` }
type Stat ¶
type Stat struct { TestCases TestCaseStat `json:"testcases" yaml:"testcases"` TestSteps TestStepStat `json:"teststeps" yaml:"teststeps"` }
type StepAPIWithOptionalArgs ¶
type StepAPIWithOptionalArgs struct {
// contains filtered or unexported fields
}
StepAPIWithOptionalArgs implements IStep interface.
func (*StepAPIWithOptionalArgs) Export ¶
func (s *StepAPIWithOptionalArgs) Export(names ...string) *StepAPIWithOptionalArgs
Export specifies variable names to export from referenced api for current step.
func (*StepAPIWithOptionalArgs) Name ¶
func (s *StepAPIWithOptionalArgs) Name() string
func (*StepAPIWithOptionalArgs) Run ¶
func (s *StepAPIWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepResult, err error)
func (*StepAPIWithOptionalArgs) Struct ¶
func (s *StepAPIWithOptionalArgs) Struct() *TStep
func (*StepAPIWithOptionalArgs) TeardownHook ¶
func (s *StepAPIWithOptionalArgs) TeardownHook(hook string) *StepAPIWithOptionalArgs
TeardownHook adds a teardown hook for current teststep.
func (*StepAPIWithOptionalArgs) Type ¶
func (s *StepAPIWithOptionalArgs) Type() StepType
type StepMobile ¶ added in v4.3.0
type StepMobile struct {
// contains filtered or unexported fields
}
StepMobile implements IStep interface.
func (*StepMobile) AppLaunch ¶ added in v4.3.0
func (s *StepMobile) AppLaunch(bundleId string) *StepMobile
func (*StepMobile) AppTerminate ¶ added in v4.3.0
func (s *StepMobile) AppTerminate(bundleId string) *StepMobile
func (*StepMobile) Back ¶ added in v4.3.1
func (s *StepMobile) Back(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) ClosePopups ¶ added in v4.3.6
func (s *StepMobile) ClosePopups(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) DoubleTap ¶ added in v4.3.0
func (s *StepMobile) DoubleTap(params string, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) DoubleTapXY ¶ added in v4.3.0
func (s *StepMobile) DoubleTapXY(x, y float64, options ...uixt.ActionOption) *StepMobile
DoubleTapXY double taps the point {X,Y}, X & Y is percentage of coordinates
func (*StepMobile) Home ¶ added in v4.3.0
func (s *StepMobile) Home() *StepMobile
func (*StepMobile) Input ¶ added in v4.3.0
func (s *StepMobile) Input(text string, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) InstallApp ¶ added in v4.3.0
func (s *StepMobile) InstallApp(path string) *StepMobile
func (*StepMobile) Name ¶ added in v4.3.0
func (s *StepMobile) Name() string
func (*StepMobile) Run ¶ added in v4.3.0
func (s *StepMobile) Run(r *SessionRunner) (*StepResult, error)
func (*StepMobile) ScreenShot ¶ added in v4.3.0
func (s *StepMobile) ScreenShot(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) Serial ¶ added in v4.3.0
func (s *StepMobile) Serial(serial string) *StepMobile
func (*StepMobile) Sleep ¶ added in v4.3.0
func (s *StepMobile) Sleep(n float64) *StepMobile
Sleep specify sleep seconds after last action
func (*StepMobile) SleepRandom ¶ added in v4.3.3
func (s *StepMobile) SleepRandom(params ...float64) *StepMobile
SleepRandom specify random sleeping seconds after last action params have two different kinds: 1. [min, max] : min and max are float64 time range boudaries 2. [min1, max1, weight1, min2, max2, weight2, ...] : weight is the probability of the time range
func (*StepMobile) StartCamera ¶ added in v4.3.0
func (s *StepMobile) StartCamera() *StepMobile
func (*StepMobile) StopCamera ¶ added in v4.3.0
func (s *StepMobile) StopCamera() *StepMobile
func (*StepMobile) Struct ¶ added in v4.3.0
func (s *StepMobile) Struct() *TStep
func (*StepMobile) Swipe ¶ added in v4.3.0
func (s *StepMobile) Swipe(sx, sy, ex, ey float64, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeDown ¶ added in v4.3.0
func (s *StepMobile) SwipeDown(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeLeft ¶ added in v4.3.0
func (s *StepMobile) SwipeLeft(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeRight ¶ added in v4.3.0
func (s *StepMobile) SwipeRight(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeToTapApp ¶ added in v4.3.0
func (s *StepMobile) SwipeToTapApp(appName string, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeToTapText ¶ added in v4.3.0
func (s *StepMobile) SwipeToTapText(text string, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeToTapTexts ¶ added in v4.3.0
func (s *StepMobile) SwipeToTapTexts(texts interface{}, options ...uixt.ActionOption) *StepMobile
func (*StepMobile) SwipeUp ¶ added in v4.3.0
func (s *StepMobile) SwipeUp(options ...uixt.ActionOption) *StepMobile
func (*StepMobile) Tap ¶ added in v4.3.0
func (s *StepMobile) Tap(params string, options ...uixt.ActionOption) *StepMobile
Tap taps on the target element
func (*StepMobile) TapAbsXY ¶ added in v4.3.0
func (s *StepMobile) TapAbsXY(x, y float64, options ...uixt.ActionOption) *StepMobile
TapAbsXY taps the point {X,Y}, X & Y is absolute coordinates
func (*StepMobile) TapByCV ¶ added in v4.3.0
func (s *StepMobile) TapByCV(imagePath string, options ...uixt.ActionOption) *StepMobile
TapByCV taps on the target element by CV recognition
func (*StepMobile) TapByOCR ¶ added in v4.3.0
func (s *StepMobile) TapByOCR(ocrText string, options ...uixt.ActionOption) *StepMobile
TapByOCR taps on the target element by OCR recognition
func (*StepMobile) TapByUITypes ¶ added in v4.3.6
func (s *StepMobile) TapByUITypes(options ...uixt.ActionOption) *StepMobile
TapByUITypes taps on the target element specified by uiTypes, the higher the uiTypes, the higher the priority
func (*StepMobile) TapXY ¶ added in v4.3.0
func (s *StepMobile) TapXY(x, y float64, options ...uixt.ActionOption) *StepMobile
TapXY taps the point {X,Y}, X & Y is percentage of coordinates
func (*StepMobile) Type ¶ added in v4.3.0
func (s *StepMobile) Type() StepType
func (*StepMobile) Validate ¶ added in v4.3.0
func (s *StepMobile) Validate() *StepMobileUIValidation
Validate switches to step validation.
func (*StepMobile) VideoCrawler ¶ added in v4.3.4
func (s *StepMobile) VideoCrawler(params map[string]interface{}) *StepMobile
type StepMobileUIValidation ¶ added in v4.3.0
type StepMobileUIValidation struct {
// contains filtered or unexported fields
}
StepMobileUIValidation implements IStep interface.
func (*StepMobileUIValidation) AssertAppInForeground ¶ added in v4.3.3
func (s *StepMobileUIValidation) AssertAppInForeground(packageName string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertAppNotInForeground ¶ added in v4.3.3
func (s *StepMobileUIValidation) AssertAppNotInForeground(packageName string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertImageExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertImageExists(expectedImagePath string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertImageNotExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertImageNotExists(expectedImagePath string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertLabelExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertLabelExists(expectedLabel string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertLabelNotExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertLabelNotExists(expectedLabel string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertNameExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertNameExists(expectedName string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertNameNotExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertNameNotExists(expectedName string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertOCRExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertOCRExists(expectedText string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) AssertOCRNotExists ¶ added in v4.3.0
func (s *StepMobileUIValidation) AssertOCRNotExists(expectedText string, msg ...string) *StepMobileUIValidation
func (*StepMobileUIValidation) Name ¶ added in v4.3.0
func (s *StepMobileUIValidation) Name() string
func (*StepMobileUIValidation) Run ¶ added in v4.3.0
func (s *StepMobileUIValidation) Run(r *SessionRunner) (*StepResult, error)
func (*StepMobileUIValidation) Struct ¶ added in v4.3.0
func (s *StepMobileUIValidation) Struct() *TStep
func (*StepMobileUIValidation) Type ¶ added in v4.3.0
func (s *StepMobileUIValidation) Type() StepType
type StepRendezvous ¶
type StepRendezvous struct {
// contains filtered or unexported fields
}
StepRendezvous implements IStep interface.
func (*StepRendezvous) Name ¶
func (s *StepRendezvous) Name() string
func (*StepRendezvous) Run ¶
func (s *StepRendezvous) Run(r *SessionRunner) (*StepResult, error)
func (*StepRendezvous) Struct ¶
func (s *StepRendezvous) Struct() *TStep
func (*StepRendezvous) Type ¶
func (s *StepRendezvous) Type() StepType
func (*StepRendezvous) WithTimeout ¶
func (s *StepRendezvous) WithTimeout(timeout int64) *StepRendezvous
WithTimeout sets the timeout of duration between each user arriving at the current rendezvous
func (*StepRendezvous) WithUserNumber ¶
func (s *StepRendezvous) WithUserNumber(number int64) *StepRendezvous
WithUserNumber sets the user number needed to release the current rendezvous
func (*StepRendezvous) WithUserPercent ¶
func (s *StepRendezvous) WithUserPercent(percent float32) *StepRendezvous
WithUserPercent sets the user percent needed to release the current rendezvous
type StepRequest ¶
type StepRequest struct {
// contains filtered or unexported fields
}
func NewStep ¶
func NewStep(name string) *StepRequest
NewStep returns a new constructed teststep with specified step name.
func (*StepRequest) Android ¶ added in v4.3.0
func (s *StepRequest) Android() *StepMobile
Android creates a new android action
func (*StepRequest) CallRefAPI ¶
func (s *StepRequest) CallRefAPI(api IAPI) *StepAPIWithOptionalArgs
CallRefAPI calls a referenced api.
func (*StepRequest) CallRefCase ¶
func (s *StepRequest) CallRefCase(tc ITestCase) *StepTestCaseWithOptionalArgs
CallRefCase calls a referenced testcase.
func (*StepRequest) DELETE ¶
func (s *StepRequest) DELETE(url string) *StepRequestWithOptionalArgs
DELETE makes a HTTP DELETE request.
func (*StepRequest) EndTransaction ¶
func (s *StepRequest) EndTransaction(name string) *StepTransaction
EndTransaction ends a transaction.
func (*StepRequest) GET ¶
func (s *StepRequest) GET(url string) *StepRequestWithOptionalArgs
GET makes a HTTP GET request.
func (*StepRequest) HEAD ¶
func (s *StepRequest) HEAD(url string) *StepRequestWithOptionalArgs
HEAD makes a HTTP HEAD request.
func (*StepRequest) HTTP2 ¶
func (s *StepRequest) HTTP2() *StepRequest
HTTP2 enables HTTP/2 protocol
func (*StepRequest) IOS ¶ added in v4.3.0
func (s *StepRequest) IOS() *StepMobile
IOS creates a new ios action
func (*StepRequest) Loop ¶ added in v4.3.1
func (s *StepRequest) Loop(times int) *StepRequest
Loop specify running times for the current step
func (*StepRequest) OPTIONS ¶
func (s *StepRequest) OPTIONS(url string) *StepRequestWithOptionalArgs
OPTIONS makes a HTTP OPTIONS request.
func (*StepRequest) PATCH ¶
func (s *StepRequest) PATCH(url string) *StepRequestWithOptionalArgs
PATCH makes a HTTP PATCH request.
func (*StepRequest) POST ¶
func (s *StepRequest) POST(url string) *StepRequestWithOptionalArgs
POST makes a HTTP POST request.
func (*StepRequest) PUT ¶
func (s *StepRequest) PUT(url string) *StepRequestWithOptionalArgs
PUT makes a HTTP PUT request.
func (*StepRequest) SetRendezvous ¶
func (s *StepRequest) SetRendezvous(name string) *StepRendezvous
SetRendezvous creates a new rendezvous
func (*StepRequest) SetThinkTime ¶
func (s *StepRequest) SetThinkTime(time float64) *StepThinkTime
SetThinkTime sets think time.
func (*StepRequest) SetupHook ¶
func (s *StepRequest) SetupHook(hook string) *StepRequest
SetupHook adds a setup hook for current teststep.
func (*StepRequest) StartTransaction ¶
func (s *StepRequest) StartTransaction(name string) *StepTransaction
StartTransaction starts a transaction.
func (*StepRequest) WebSocket ¶
func (s *StepRequest) WebSocket() *StepWebSocket
WebSocket creates a new websocket action
func (*StepRequest) WithVariables ¶
func (s *StepRequest) WithVariables(variables map[string]interface{}) *StepRequest
WithVariables sets variables for current teststep.
type StepRequestExtraction ¶
type StepRequestExtraction struct {
// contains filtered or unexported fields
}
StepRequestExtraction implements IStep interface.
func (*StepRequestExtraction) Name ¶
func (s *StepRequestExtraction) Name() string
func (*StepRequestExtraction) Run ¶
func (s *StepRequestExtraction) Run(r *SessionRunner) (*StepResult, error)
func (*StepRequestExtraction) Struct ¶
func (s *StepRequestExtraction) Struct() *TStep
func (*StepRequestExtraction) Type ¶
func (s *StepRequestExtraction) Type() StepType
func (*StepRequestExtraction) Validate ¶
func (s *StepRequestExtraction) Validate() *StepRequestValidation
Validate switches to step validation.
func (*StepRequestExtraction) WithJmesPath ¶
func (s *StepRequestExtraction) WithJmesPath(jmesPath string, varName string) *StepRequestExtraction
WithJmesPath sets the JMESPath expression to extract from the response.
type StepRequestValidation ¶
type StepRequestValidation struct {
// contains filtered or unexported fields
}
StepRequestValidation implements IStep interface.
func (*StepRequestValidation) AssertContainedBy ¶
func (s *StepRequestValidation) AssertContainedBy(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertContains ¶
func (s *StepRequestValidation) AssertContains(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertEndsWith ¶
func (s *StepRequestValidation) AssertEndsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertEqual ¶
func (s *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertEqualFold ¶ added in v4.1.2
func (s *StepRequestValidation) AssertEqualFold(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertGreater ¶
func (s *StepRequestValidation) AssertGreater(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertGreaterOrEqual ¶
func (s *StepRequestValidation) AssertGreaterOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthEqual ¶
func (s *StepRequestValidation) AssertLengthEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthGreaterOrEquals ¶
func (s *StepRequestValidation) AssertLengthGreaterOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthGreaterThan ¶
func (s *StepRequestValidation) AssertLengthGreaterThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthLessOrEquals ¶
func (s *StepRequestValidation) AssertLengthLessOrEquals(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLengthLessThan ¶
func (s *StepRequestValidation) AssertLengthLessThan(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLess ¶
func (s *StepRequestValidation) AssertLess(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertLessOrEqual ¶
func (s *StepRequestValidation) AssertLessOrEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertNotEqual ¶
func (s *StepRequestValidation) AssertNotEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertRegexp ¶
func (s *StepRequestValidation) AssertRegexp(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertStartsWith ¶
func (s *StepRequestValidation) AssertStartsWith(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertStringEqual ¶
func (s *StepRequestValidation) AssertStringEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) AssertTypeMatch ¶
func (s *StepRequestValidation) AssertTypeMatch(jmesPath string, expected interface{}, msg string) *StepRequestValidation
func (*StepRequestValidation) Name ¶
func (s *StepRequestValidation) Name() string
func (*StepRequestValidation) Run ¶
func (s *StepRequestValidation) Run(r *SessionRunner) (*StepResult, error)
func (*StepRequestValidation) Struct ¶
func (s *StepRequestValidation) Struct() *TStep
func (*StepRequestValidation) Type ¶
func (s *StepRequestValidation) Type() StepType
type StepRequestWithOptionalArgs ¶
type StepRequestWithOptionalArgs struct {
// contains filtered or unexported fields
}
StepRequestWithOptionalArgs implements IStep interface.
func (*StepRequestWithOptionalArgs) Extract ¶
func (s *StepRequestWithOptionalArgs) Extract() *StepRequestExtraction
Extract switches to step extraction.
func (*StepRequestWithOptionalArgs) Name ¶
func (s *StepRequestWithOptionalArgs) Name() string
func (*StepRequestWithOptionalArgs) Run ¶
func (s *StepRequestWithOptionalArgs) Run(r *SessionRunner) (*StepResult, error)
func (*StepRequestWithOptionalArgs) SetAllowRedirects ¶
func (s *StepRequestWithOptionalArgs) SetAllowRedirects(allowRedirects bool) *StepRequestWithOptionalArgs
SetAllowRedirects sets whether to allow redirects for current HTTP request.
func (*StepRequestWithOptionalArgs) SetAuth ¶
func (s *StepRequestWithOptionalArgs) SetAuth(auth map[string]string) *StepRequestWithOptionalArgs
SetAuth sets auth for current HTTP request.
func (*StepRequestWithOptionalArgs) SetProxies ¶
func (s *StepRequestWithOptionalArgs) SetProxies(proxies map[string]string) *StepRequestWithOptionalArgs
SetProxies sets proxies for current HTTP request.
func (*StepRequestWithOptionalArgs) SetTimeout ¶
func (s *StepRequestWithOptionalArgs) SetTimeout(timeout time.Duration) *StepRequestWithOptionalArgs
SetTimeout sets timeout for current HTTP request.
func (*StepRequestWithOptionalArgs) SetVerify ¶
func (s *StepRequestWithOptionalArgs) SetVerify(verify bool) *StepRequestWithOptionalArgs
SetVerify sets whether to verify SSL for current HTTP request.
func (*StepRequestWithOptionalArgs) Struct ¶
func (s *StepRequestWithOptionalArgs) Struct() *TStep
func (*StepRequestWithOptionalArgs) TeardownHook ¶
func (s *StepRequestWithOptionalArgs) TeardownHook(hook string) *StepRequestWithOptionalArgs
TeardownHook adds a teardown hook for current teststep.
func (*StepRequestWithOptionalArgs) Type ¶
func (s *StepRequestWithOptionalArgs) Type() StepType
func (*StepRequestWithOptionalArgs) Validate ¶
func (s *StepRequestWithOptionalArgs) Validate() *StepRequestValidation
Validate switches to step validation.
func (*StepRequestWithOptionalArgs) WithBody ¶
func (s *StepRequestWithOptionalArgs) WithBody(body interface{}) *StepRequestWithOptionalArgs
WithBody sets HTTP request body for current step.
func (*StepRequestWithOptionalArgs) WithCookies ¶
func (s *StepRequestWithOptionalArgs) WithCookies(cookies map[string]string) *StepRequestWithOptionalArgs
WithCookies sets HTTP request cookies for current step.
func (*StepRequestWithOptionalArgs) WithHeaders ¶
func (s *StepRequestWithOptionalArgs) WithHeaders(headers map[string]string) *StepRequestWithOptionalArgs
WithHeaders sets HTTP request headers for current step.
func (*StepRequestWithOptionalArgs) WithParams ¶
func (s *StepRequestWithOptionalArgs) WithParams(params map[string]interface{}) *StepRequestWithOptionalArgs
WithParams sets HTTP request params for current step.
func (*StepRequestWithOptionalArgs) WithUpload ¶ added in v4.1.5
func (s *StepRequestWithOptionalArgs) WithUpload(upload map[string]interface{}) *StepRequestWithOptionalArgs
WithUpload sets HTTP request body for uploading file(s).
type StepResult ¶
type StepResult struct { Name string `json:"name" yaml:"name"` // step name StartTime int64 `json:"start_time" yaml:"time"` // step start time StepType StepType `json:"step_type" yaml:"step_type"` // step type, testcase/request/transaction/rendezvous Success bool `json:"success" yaml:"success"` // step execution result Elapsed int64 `json:"elapsed_ms" yaml:"elapsed_ms"` // step execution time in millisecond(ms) HttpStat map[string]int64 `json:"httpstat,omitempty" yaml:"httpstat,omitempty"` // httpstat in millisecond(ms) Data interface{} `json:"data,omitempty" yaml:"data,omitempty"` // session data or slice of step data ContentSize int64 `json:"content_size" yaml:"content_size"` // response body length ExportVars map[string]interface{} `json:"export_vars,omitempty" yaml:"export_vars,omitempty"` // extract variables Attachments interface{} `json:"attachments,omitempty" yaml:"attachments,omitempty"` // store extra step information, such as error message or screenshots }
type StepTestCaseWithOptionalArgs ¶
type StepTestCaseWithOptionalArgs struct {
// contains filtered or unexported fields
}
StepTestCaseWithOptionalArgs implements IStep interface.
func (*StepTestCaseWithOptionalArgs) Export ¶
func (s *StepTestCaseWithOptionalArgs) Export(names ...string) *StepTestCaseWithOptionalArgs
Export specifies variable names to export from referenced testcase for current step.
func (*StepTestCaseWithOptionalArgs) Name ¶
func (s *StepTestCaseWithOptionalArgs) Name() string
func (*StepTestCaseWithOptionalArgs) Run ¶
func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepResult, err error)
func (*StepTestCaseWithOptionalArgs) Struct ¶
func (s *StepTestCaseWithOptionalArgs) Struct() *TStep
func (*StepTestCaseWithOptionalArgs) TeardownHook ¶
func (s *StepTestCaseWithOptionalArgs) TeardownHook(hook string) *StepTestCaseWithOptionalArgs
TeardownHook adds a teardown hook for current teststep.
func (*StepTestCaseWithOptionalArgs) Type ¶
func (s *StepTestCaseWithOptionalArgs) Type() StepType
type StepThinkTime ¶
type StepThinkTime struct {
// contains filtered or unexported fields
}
StepThinkTime implements IStep interface.
func (*StepThinkTime) Name ¶
func (s *StepThinkTime) Name() string
func (*StepThinkTime) Run ¶
func (s *StepThinkTime) Run(r *SessionRunner) (*StepResult, error)
func (*StepThinkTime) Struct ¶
func (s *StepThinkTime) Struct() *TStep
func (*StepThinkTime) Type ¶
func (s *StepThinkTime) Type() StepType
type StepTransaction ¶
type StepTransaction struct {
// contains filtered or unexported fields
}
StepTransaction implements IStep interface.
func (*StepTransaction) Name ¶
func (s *StepTransaction) Name() string
func (*StepTransaction) Run ¶
func (s *StepTransaction) Run(r *SessionRunner) (*StepResult, error)
func (*StepTransaction) Struct ¶
func (s *StepTransaction) Struct() *TStep
func (*StepTransaction) Type ¶
func (s *StepTransaction) Type() StepType
type StepWebSocket ¶
type StepWebSocket struct {
// contains filtered or unexported fields
}
StepWebSocket implements IStep interface.
func (*StepWebSocket) CloseConnection ¶
func (s *StepWebSocket) CloseConnection(url ...string) *StepWebSocket
func (*StepWebSocket) Extract ¶
func (s *StepWebSocket) Extract() *StepRequestExtraction
Extract switches to step extraction.
func (*StepWebSocket) Name ¶
func (s *StepWebSocket) Name() string
func (*StepWebSocket) NewConnection ¶
func (s *StepWebSocket) NewConnection() *StepWebSocket
func (*StepWebSocket) OpenConnection ¶
func (s *StepWebSocket) OpenConnection(url ...string) *StepWebSocket
func (*StepWebSocket) PingPong ¶
func (s *StepWebSocket) PingPong(url ...string) *StepWebSocket
func (*StepWebSocket) Read ¶
func (s *StepWebSocket) Read(url ...string) *StepWebSocket
func (*StepWebSocket) Run ¶
func (s *StepWebSocket) Run(r *SessionRunner) (*StepResult, error)
func (*StepWebSocket) Struct ¶
func (s *StepWebSocket) Struct() *TStep
func (*StepWebSocket) Type ¶
func (s *StepWebSocket) Type() StepType
func (*StepWebSocket) Validate ¶
func (s *StepWebSocket) Validate() *StepRequestValidation
Validate switches to step validation.
func (*StepWebSocket) WithBinaryMessage ¶
func (s *StepWebSocket) WithBinaryMessage(message interface{}) *StepWebSocket
func (*StepWebSocket) WithCloseStatus ¶
func (s *StepWebSocket) WithCloseStatus(closeStatus int64) *StepWebSocket
func (*StepWebSocket) WithHeaders ¶
func (s *StepWebSocket) WithHeaders(headers map[string]string) *StepWebSocket
func (*StepWebSocket) WithParams ¶
func (s *StepWebSocket) WithParams(params map[string]interface{}) *StepWebSocket
func (*StepWebSocket) WithTextMessage ¶
func (s *StepWebSocket) WithTextMessage(message interface{}) *StepWebSocket
func (*StepWebSocket) WithTimeout ¶
func (s *StepWebSocket) WithTimeout(timeout int64) *StepWebSocket
func (*StepWebSocket) Write ¶
func (s *StepWebSocket) Write(url ...string) *StepWebSocket
func (*StepWebSocket) WriteAndRead ¶
func (s *StepWebSocket) WriteAndRead(url ...string) *StepWebSocket
type StopRequestBody ¶ added in v4.2.0
type StopRequestBody struct {
Worker string `json:"worker"`
}
type Summary ¶
type Summary struct { Success bool `json:"success" yaml:"success"` Stat *Stat `json:"stat" yaml:"stat"` Time *TestCaseTime `json:"time" yaml:"time"` Platform *Platform `json:"platform" yaml:"platform"` Details []*TestCaseSummary `json:"details" yaml:"details"` // contains filtered or unexported fields }
Summary stores tests summary for current task execution, maybe include one or multiple testcases
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) MakeCompat ¶
MakeCompat converts TCase compatible with Golang engine style
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"` // deprecated in v4.1, moved to env Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"` // public request headers Environs map[string]string `json:"environs,omitempty" yaml:"environs,omitempty"` // environment variables Variables map[string]interface{} `json:"variables,omitempty" yaml:"variables,omitempty"` // global variables Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` ParametersSetting *TParamsConfig `json:"parameters_setting,omitempty" yaml:"parameters_setting,omitempty"` ThinkTimeSetting *ThinkTimeConfig `json:"think_time,omitempty" yaml:"think_time,omitempty"` WebSocketSetting *WebSocketConfig `json:"websocket,omitempty" yaml:"websocket,omitempty"` IOS []*uixt.IOSDevice `json:"ios,omitempty" yaml:"ios,omitempty"` Android []*uixt.AndroidDevice `json:"android,omitempty" yaml:"android,omitempty"` RequestTimeout float32 `json:"request_timeout,omitempty" yaml:"request_timeout,omitempty"` // request timeout in seconds CaseTimeout float32 `json:"case_timeout,omitempty" yaml:"case_timeout,omitempty"` // testcase timeout in seconds 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 PluginSetting *PluginConfig `json:"plugin,omitempty" yaml:"plugin,omitempty"` // plugin config }
TConfig represents config data structure for testcase. Each testcase should contain one config part.
func (*TConfig) ExportVars ¶
ExportVars specifies variable names to export for current testcase.
func (*TConfig) SetAndroid ¶ added in v4.3.0
func (c *TConfig) SetAndroid(options ...uixt.AndroidDeviceOption) *TConfig
func (*TConfig) SetBaseURL ¶
SetBaseURL sets base URL for current testcase.
func (*TConfig) SetCaseTimeout ¶ added in v4.3.4
SetCaseTimeout sets testcase timeout in seconds.
func (*TConfig) SetHeaders ¶
SetHeaders sets global headers for current testcase.
func (*TConfig) SetIOS ¶ added in v4.3.0
func (c *TConfig) SetIOS(options ...uixt.IOSDeviceOption) *TConfig
func (*TConfig) SetRequestTimeout ¶ added in v4.3.4
SetRequestTimeout sets request timeout in seconds.
func (*TConfig) SetThinkTime ¶
SetThinkTime sets think time config for current testcase.
func (*TConfig) SetVerifySSL ¶
SetVerifySSL sets whether to verify SSL for current testcase.
func (*TConfig) SetWebSocket ¶
func (*TConfig) SetWeight ¶
SetWeight sets weight for current testcase, which is used in load testing.
func (*TConfig) WithParameters ¶
WithParameters sets parameters for current testcase.
func (*TConfig) WithVariables ¶
WithVariables sets variables for current testcase.
type TParamsConfig ¶
type TParamsConfig struct { PickOrder iteratorPickOrder `json:"pick_order,omitempty" yaml:"pick_order,omitempty"` // overall pick-order strategy Strategies map[string]iteratorStrategy `json:"strategies,omitempty" yaml:"strategies,omitempty"` // individual strategies for each parameters Limit int `json:"limit,omitempty" yaml:"limit,omitempty"` }
type TStep ¶
type TStep struct { Name string `json:"name" yaml:"name"` // required Request *Request `json:"request,omitempty" yaml:"request,omitempty"` API interface{} `json:"api,omitempty" yaml:"api,omitempty"` // *APIPath or *API TestCase interface{} `json:"testcase,omitempty" yaml:"testcase,omitempty"` // *TestCasePath or *TestCase Transaction *Transaction `json:"transaction,omitempty" yaml:"transaction,omitempty"` Rendezvous *Rendezvous `json:"rendezvous,omitempty" yaml:"rendezvous,omitempty"` ThinkTime *ThinkTime `json:"think_time,omitempty" yaml:"think_time,omitempty"` WebSocket *WebSocketAction `json:"websocket,omitempty" yaml:"websocket,omitempty"` Android *MobileStep `json:"android,omitempty" yaml:"android,omitempty"` IOS *MobileStep `json:"ios,omitempty" yaml:"ios,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 []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"` Export []string `json:"export,omitempty" yaml:"export,omitempty"` Loops int `json:"loops,omitempty" yaml:"loops,omitempty"` }
TStep represents teststep data structure. Each step maybe three different types: make one request or reference another api/testcase.
type TestCase ¶
TestCase is a container for one testcase, which is used for testcase runner. TestCase implements ITestCase interface.
func LoadTestCases ¶
func (*TestCase) ToTestCase ¶
type TestCaseInOut ¶
type TestCasePath ¶
type TestCasePath string
TestCasePath implements ITestCase interface.
func (*TestCasePath) GetPath ¶
func (path *TestCasePath) GetPath() string
func (*TestCasePath) ToTestCase ¶
func (path *TestCasePath) ToTestCase() (*TestCase, error)
ToTestCase loads testcase path and convert to *TestCase
type TestCaseStat ¶
type TestCaseSummary ¶
type TestCaseSummary struct { Name string `json:"name" yaml:"name"` Success bool `json:"success" yaml:"success"` CaseId string `json:"case_id,omitempty" yaml:"case_id,omitempty"` // TODO Stat *TestStepStat `json:"stat" yaml:"stat"` Time *TestCaseTime `json:"time" yaml:"time"` InOut *TestCaseInOut `json:"in_out" yaml:"in_out"` Logs []interface{} `json:"logs,omitempty" yaml:"logs,omitempty"` Records []*StepResult `json:"records" yaml:"records"` RootDir string `json:"root_dir" yaml:"root_dir"` }
TestCaseSummary stores tests summary for one testcase
type TestCaseTime ¶
type TestStepStat ¶
type ThinkTimeConfig ¶
type ThinkTimeConfig struct { Strategy thinkTimeStrategy `json:"strategy,omitempty" yaml:"strategy,omitempty"` // default、random、multiply、ignore Setting interface{} `json:"setting,omitempty" yaml:"setting,omitempty"` // random(map): {"min_percentage": 0.5, "max_percentage": 1.5}; 10、multiply(float64): 1.5 Limit float64 `json:"limit,omitempty" yaml:"limit,omitempty"` // limit think time no more than specific time, ignore if value <= 0 }
type Transaction ¶
type Transaction struct { Name string `json:"name" yaml:"name"` Type transactionType `json:"type" yaml:"type"` }
type ValidationResult ¶
type Validator ¶
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.
type WebSocketAction ¶
type WebSocketAction struct { Type ActionType `json:"type" yaml:"type"` 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"` NewConnection bool `json:"new_connection,omitempty" yaml:"new_connection,omitempty"` // TODO support TextMessage interface{} `json:"text,omitempty" yaml:"text,omitempty"` BinaryMessage interface{} `json:"binary,omitempty" yaml:"binary,omitempty"` CloseStatusCode int64 `json:"close_status,omitempty" yaml:"close_status,omitempty"` Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` }
func (*WebSocketAction) GetCloseStatusCode ¶ added in v4.3.0
func (w *WebSocketAction) GetCloseStatusCode() int64
func (*WebSocketAction) GetTimeout ¶ added in v4.3.0
func (w *WebSocketAction) GetTimeout() int64
type WebSocketConfig ¶
type WebSocketConfig struct { ReconnectionTimes int64 `json:"reconnection_times,omitempty" yaml:"reconnection_times,omitempty"` // maximum reconnection times when the connection closed by remote server ReconnectionInterval int64 `json:"reconnection_interval,omitempty" yaml:"reconnection_interval,omitempty"` // interval between each reconnection in milliseconds MaxMessageSize int64 `json:"max_message_size,omitempty" yaml:"max_message_size,omitempty"` // maximum message size during writing/reading }
WebSocketConfig TODO: support reconnection ability
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
scaffold/templates/plugin
NOTE: Generated By hrp v4.3.6, DO NOT EDIT!
|
NOTE: Generated By hrp v4.3.6, DO NOT EDIT! |
pkg
|
|
httpstat
Package httpstat traces HTTP latency infomation (DNSLookup, TCP Connection and so on) on any golang HTTP request.
|
Package httpstat traces HTTP latency infomation (DNSLookup, TCP Connection and so on) on any golang HTTP request. |