It will be nice to have the option to set generic assertion for all the API request in the project , or to select some of the APEs should have the same assertion . meaning of generic assert...
Generic assertion.
MFagerlind
8 years agoStaff
Hi Mishka,
Just to be clear, the script below won't work like an assertion, in that it won't add an assertion result in the GUI, etc, but it will allow you to fail a test case and will log the reason in the script log. This may not be enough for you, and it's clearly not a substitute for the full feature - thanks again for the suggestion!
def testStep = testStepResult.testStep
def responseContent = testStep.testRequest.assertableContent
if (responseContent.length() < 100000) {
def failureMessage = "Response content to short - test step: $testStep.name"
log.error(failureMessage)
testRunner.fail(failureMessage)
}
Regards,
Manne
Related Content
- 2 years ago
- 2 years ago
- 10 months ago