mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 08:59:44 +08:00
27 lines
586 B
Go
27 lines
586 B
Go
package httpboomer
|
|
|
|
// implements IStep interface
|
|
type stepRequestValidation struct {
|
|
runner *Runner
|
|
TStep *TStep
|
|
}
|
|
|
|
func (s *stepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *stepRequestValidation {
|
|
validator := TValidator{
|
|
Check: jmesPath,
|
|
Comparator: "equals",
|
|
Expect: expected,
|
|
Message: msg,
|
|
}
|
|
s.TStep.Validators = append(s.TStep.Validators, validator)
|
|
return s
|
|
}
|
|
|
|
func (s *stepRequestValidation) ToStruct() *TStep {
|
|
return s.TStep
|
|
}
|
|
|
|
func (s *stepRequestValidation) Run() error {
|
|
return s.runner.runStep(s.TStep)
|
|
}
|