Open markb-trustifi opened 7 years ago
I would like to have some Jasmine/Chai style response validations:
expect(response.statusCode, response.statusMessage).to.be.within(200, 201); expect(response.body).to.be.not.null; expect(response.body.message).to.be.eq('some error');
and, when expect fails the flow should stop with custom error message. Right now it can be achieved only by the javascript functions:
function afterResponseHandler(requestParams, response, context, event, next) { if(response.statusCode !== 200 && response.statusCode !== 201) { if(response.statusMessage) console.error(response.request.method +":"+ response.request.uri.path, response.statusCode+": "+response.statusMessage); let err = new Error(); err.code = response.statusCode; return next(err); } return next(); }
Is there solution out-of-the-box?
Expectations are on the roadmap.
For anyone who came here recently, this can be done with the artillery expect plugin.
The link ends up with a 404
I would like to have some Jasmine/Chai style response validations:
and, when expect fails the flow should stop with custom error message. Right now it can be achieved only by the javascript functions:
Is there solution out-of-the-box?