My question:
Is there a Newman reporter I can use with Azure DevOps that displays request headers, body, status code, and error message? I more or less need the failed test to display all the required information to reproduce it.
I am familiar with HTML extra, but sadly my CTO will only allow a reporter which can be used with “Publish Test Results” and as far as I know for HTML extra the “Upload Postman HTML Report” extension is required.
Details (like screenshots):
I’ve already tried:
(I use the basic -junit reporter)
This is my current solution since as far as I can tell the basic junit reporter only displays the test status failed/passed and test name, I have actually put all the information I need into the test name:
But this solution simply looks bad and is awful for writing tests in postman since a large portion of the code is the test name.
var jsonData=JSON.parse(responseBody);
var ReqBody = JSON.stringify(request.data).replaceAll(‘\’,‘’);
ReqBody = ReqBody.substring(1,ReqBody.length-1);
var ReqHeaders = JSON.stringify(request.headers);
var ReqUrl = pm.variables.replaceIn(pm.request.url.toString());pm.test(‘\nGet minimal ticket payin.’ + ‘\n\nRequest url:\n’ + request.method + ’ ’ + ReqUrl + ‘\n\nRequest headers:\n’ + ReqHeaders + ‘\n\nRequest body:\n’ + ReqBody + ‘\n\nCode and status:\n’ + JSON.stringify(pm.response.code) + ’ ’ + JSON.stringify(pm.response.status) + ‘\n\n’, function () {
pm.response.to.have.status(200);const responseJson = pm.response.json(); pm.collectionVariables.set("MinPayIn",responseJson.MinPayIn);
});