So, in the reports, I errors reported as following:
regex.notExists didn’t match: unexpectedly found [ ]
jsonPath.is didn’t match: (3) didn’t match: found 2
jsonPath.is didn’t match: (10) didn’t match: found 5
jsonPath.is didn’t match: (10) didn’t match: found 6
jsonPath.is didn’t match: (10) didn’t match: found 4
It’d be a lot more useful if the errors were reported with the failing expression, e.g.
regex(".+").notExists didn’t match: unexpectedly found foo
jsonPath("$[*]").is didn’t match: (3) didn’t match: found 2
This would be especially useful where I have long chains of checks on content - then I’d know exactly where my check chain is failing.
I’ve nosed around the code already to see if that would be an easy obvious fix.
Looks like the message is generated at gatling-core/src/main/scala/io/gatling/core/check/Check.scala, line 65
Which would make extractor.name the culprit
So, the JsonPathExtractor has a name, which is assigned just “jsonPath”
I see that all the subclasses of JsonPathExtractor are passed a criterion which is an Expression[String]
At first, I thought I could just place that in the parent class and then use it as part of the name, but that didn’t seem to work.
I think it probably has something to do with criterion being an Expression[String], which I know is typed to be (Session) => String - but I’m not really sure what to do with that at construction time so that I can set the name the way I’d like.
name = “jsonPath(” + criterion + “)”
just resulted in “jsonPath().is” being printed for the reported error.
So, any pointers where I’m going wrong here?