mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-24 01:40:02 +08:00
feat: add ActionResult
This commit is contained in:
14
hrp/step.go
14
hrp/step.go
@@ -18,17 +18,27 @@ const (
|
|||||||
stepTypeSuffixValidation StepType = "_validation"
|
stepTypeSuffixValidation StepType = "_validation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// one step contains one or multiple actions
|
||||||
|
type ActionResult struct {
|
||||||
|
Name string `json:"name"` // action name
|
||||||
|
StartTime int64 `json:"start_time"` // action start time
|
||||||
|
Elapsed int64 `json:"elapsed_ms"` // action elapsed time(ms)
|
||||||
|
Error error `json:"error"` // action execution result
|
||||||
|
}
|
||||||
|
|
||||||
|
// one testcase contains one or multiple steps
|
||||||
type StepResult struct {
|
type StepResult struct {
|
||||||
Name string `json:"name" yaml:"name"` // step name
|
Name string `json:"name" yaml:"name"` // step name
|
||||||
Identifier string `json:"identifier" yaml:"identifier"` // step identifier
|
Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"` // step identifier
|
||||||
StartTime int64 `json:"start_time" yaml:"time"` // step start time
|
StartTime int64 `json:"start_time" yaml:"time"` // step start time
|
||||||
StepType StepType `json:"step_type" yaml:"step_type"` // step type, testcase/request/transaction/rendezvous
|
StepType StepType `json:"step_type" yaml:"step_type"` // step type, testcase/request/transaction/rendezvous
|
||||||
Success bool `json:"success" yaml:"success"` // step execution result
|
Success bool `json:"success" yaml:"success"` // step execution result
|
||||||
Elapsed int64 `json:"elapsed_ms" yaml:"elapsed_ms"` // step execution time in millisecond(ms)
|
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)
|
HttpStat map[string]int64 `json:"httpstat,omitempty" yaml:"httpstat,omitempty"` // httpstat in millisecond(ms)
|
||||||
Data interface{} `json:"data,omitempty" yaml:"data,omitempty"` // step data, *StepResult or []*StepResult
|
Data interface{} `json:"data,omitempty" yaml:"data,omitempty"` // step data
|
||||||
ContentSize int64 `json:"content_size" yaml:"content_size"` // response body length
|
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
|
ExportVars map[string]interface{} `json:"export_vars,omitempty" yaml:"export_vars,omitempty"` // extract variables
|
||||||
|
Actions []*ActionResult `json:"actions,omitempty" yaml:"actions,omitempty"` // store action execution info
|
||||||
Attachments interface{} `json:"attachments,omitempty" yaml:"attachments,omitempty"` // store extra step information, such as error message or screenshots
|
Attachments interface{} `json:"attachments,omitempty" yaml:"attachments,omitempty"` // store extra step information, such as error message or screenshots
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user