mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
26 lines
567 B
Go
26 lines
567 B
Go
package httpboomer
|
|
|
|
// implements IStep interface
|
|
type StepRequestValidation struct {
|
|
*TStep
|
|
}
|
|
|
|
func (req *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation {
|
|
validator := TValidator{
|
|
Check: jmesPath,
|
|
Comparator: "equals",
|
|
Expect: expected,
|
|
Message: msg,
|
|
}
|
|
req.TStep.Validators = append(req.TStep.Validators, validator)
|
|
return req
|
|
}
|
|
|
|
func (req *StepRequestValidation) ToStruct() *TStep {
|
|
return req.TStep
|
|
}
|
|
|
|
func (req *StepRequestValidation) Run() error {
|
|
return req.TStep.Run()
|
|
}
|