-
If a test references another test (via Say, I have It would be really cool if I could do something like this: {{
exports.$cancel = (createTest.__response.status != 200);
}} Or maybe : {{
exports.$cancel = (__responses["createTest"].status != 200);
}} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I already create a variable for that. after executing a named httpregion, httpyac creates two variables. Variable |
Beta Was this translation helpful? Give feedback.
-
I just have two words: wow. And wow! That is so awesome. Thank you. |
Beta Was this translation helpful? Give feedback.
-
@AnWeber RE: "But I actually already set skipped when the @ref has a test error. In other words, your cancel should not actually be necessary." Unfortunately, it does not seem to be the case. I was just smoke testing a production deployment and in my CRUD test sequence, I have a PATCH call, followed by GET to make sure PATCH actually made an update. So, in the GET call I reference the PATCH test and even though PATCH failed (it expected response HTTP code 200, but 403 was returned), the GET test was still executed. Here is abbreviated sequence (with some info redacted): ### UPDATE xxx (multiple changes)
# @name updateXxx
# @ref createXxx
PATCH /xxx
Authorization: oauth2 client_credentials clientCredentials
Content-Type: application/json
{
...
}
?? status == 200
### GET xxx after UPDATE (multiple changes)
# @name getXxxAfterUpdate
# @ref updateXxx
GET /xxx/{{createXxx.id}}
Authorization: oauth2 client_credentials clientCredentials
?? status == 200
?? ... My understanding is that any failed assertion of the referenced test should cancel test execution, but it does not seem to be the case. Or did I miss something? |
Beta Was this translation helpful? Give feedback.
I already create a variable for that. after executing a named httpregion, httpyac creates two variables. Variable
{{name}}
(= response body) and{{nameResponse}}
(= response'). For@ref foo
you can usefooResponse
.But I actually already set skipped when the @ref has a test error. In other words, your cancel should not actually be necessary