awesome-newman-html-template icon indicating copy to clipboard operation
awesome-newman-html-template copied to clipboard

Capturing error message

Open PratikThorve opened this issue 11 months ago • 0 comments

Hey the report generated captures the results very well on what failed and what not. My test have a corresponding error message associated with them , is there a way to capture that as well ? like we do in newman-htmlextra-reported.

Sample test :

pm.test("Validate paymentAttributes is not null", function () {
    const cardNumber = requestData.cardNumber;
    pm.expect(responseData.paymentAttributes.lastFourDigits).to.eql(cardNumber.substring(cardNumber.length-4, cardNumber.length),"Failed validitng lastFourDigits in response");
    pm.expect(responseData.paymentAttributes.binDigits).to.eql(cardNumber.substring(0, 6),"Failed validitng paymentAttributes.binDigits in response");
    pm.expect(responseData.paymentAttributes.binDigits).to.eql(cardNumber.substring(0, 6),"Failed validitng paymentAttributes.binDigits in response");

}

LIke the above test has 3 assertions if anyone of them fails ,it fails the test but its difficult to figure out in the report which assertion failed. If we capture the error message then that can help.

Same done in newman-htmlextra-reporter image

PratikThorve avatar Mar 27 '24 10:03 PratikThorve