Open NivLipetz opened 5 years ago
How do you define failed request? By status code? Capture? Assert?
Good point. I suggest we use artillery-plugin-expect
documented here: https://artillery.io/docs/plugin-expectations-assertions/
Our challenge is to decide whether to PR to artillery or to wrap the before flow
and implement this functionality in this project
Sounds good or we can use asserts which are supported out of the box in artillery I will add it to 1.2.0
It can be also implemented using the processors feature:
For example:
function throwErrorOnError(requestParams, response, context, ee, next) { if (response.statusCode !== 200 || response.statusCode !== 201 || response.statusCode !== 204){ throw new Error('Stopping test'); } }
We will need to catch this errors and notify predator that test was aborted. Adding it to 1.3.0
I suggest aborting the test if a capture fails in the 'before' section Change need to be done in predator-runner
Describe the solution you'd like If a request in the
Before
flow fails, I would like the test to fail. This can be done by adding for each request in the before flow an optional parameter such asallow_failure: false
while the default value would betrue
. If a request with theallow_failure: false
fails, then fail the test; otherwise proceed.