From 2c2ffadf43dae07c127171c30a47c7c2d6713c14 Mon Sep 17 00:00:00 2001 From: buyuxiang <347586493@qq.com> Date: Thu, 24 Feb 2022 22:30:53 +0800 Subject: [PATCH] fix: append jmespath info when assertion failed Change-Id: I576aa651086bb2c22343aa69f862955448e1b209 --- response.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/response.go b/response.go index 2861b119..d1780523 100644 --- a/response.go +++ b/response.go @@ -160,6 +160,7 @@ func (v *responseObject) Validate(validators []Validator, variablesMapping map[s } v.validationResults = append(v.validationResults, validResult) log.Info(). + Str("jmespath", validator.Check). Str("assertMethod", assertMethod). Interface("expectValue", expectValue). Interface("checkValue", checkValue). @@ -168,7 +169,8 @@ func (v *responseObject) Validate(validators []Validator, variablesMapping map[s if !result { v.t.Fail() return errors.New(fmt.Sprintf( - "do assertion failed, assertMethod: %v, checkValue: %v, expectValue: %v", + "do assertion failed, jmespath: %v, assertMethod: %v, checkValue: %v, expectValue: %v", + validator.Check, assertMethod, checkValue, expectValue,