When running my Postman collection, I receive 0 errors throughout the whole suite, but in Newman the tests in two requests fail.
No pre-request Scripts present in requests.
These are my PM tests + relevant body of the failed requests.:
testsuite = "T5 - FeederConfigurator - Unit - Calculate - "
var jsonData = JSON.parse(responseBody);
pm.test(testsuite + “Status code is 200”, function () {pm.response.to.have.status(200);});
pm.test(testsuite + “Succes (true)”, function() {pm.expect(jsonData.success).to.eql(true); });
pm.test(testsuite + “No Errors”, function() {pm.expect(jsonData.error).to.eql(null); });
pm.test(testsuite + “FishPerHa”, function() {pm.expect(jsonData.result.ufsrFishPerHa).to.eql(0)});
pm.test(testsuite + “FeederCountRecommended”, function() {pm.expect(jsonData.result.ufsrFeederCountRecommended).to.eql(1)});
pm.test(testsuite + “TimeRangeStart_1”, function() {pm.expect(jsonData.result.ufsrTimeRangeResults[0].utrStartTime).to.eql(‘00:00’)});
Relevant body
{
“result”: {
“ufsrTotalNumberOfFish”: 25000,
“ufsrSurvivalPercentage”: 100.0,
“ufsrFishPerHa”: 0,
“ufsrBiomass”: 1.25659535973556,
“ufsrBiomassPercentageFed”: 0.0045201895240963965,
“ufsrFeedAmount”: 5.68004918110482,
“ufsrFeederCount”: 11,
“ufsrFeederCountRecommended”: 1,
“ufsrFeederTimeGap”: 11,
“ufsrTimeRangeResults”: [
{
“utrTimeRangeNr”: 1,
“utrStartTime”: “00:00”,
“utrStopTime”: “00:00”,
testsuite = "T5 - FeederConfigurator - Unit - Calculate by Id - "
var jsonData = JSON.parse(responseBody);
pm.test(testsuite + “Status code is 200”, function () {pm.response.to.have.status(200);});
pm.test(testsuite + “Succes (true)”, function() {pm.expect(jsonData.success).to.eql(true); });
pm.test(testsuite + “No Errors”, function() {pm.expect(jsonData.error).to.eql(null); });
pm.test(testsuite + “FishPerHa”, function() {pm.expect(jsonData.result.ufsrFishPerHa).to.eql(0)});
pm.test(testsuite + “FeederCountRecommended”, function() {pm.expect(jsonData.result.ufsrFeederCountRecommended).to.eql(1)});
pm.test(testsuite + “TimeRangeStart_1”, function() {pm.expect(jsonData.result.ufsrTimeRangeResults[0].utrStartTime).to.eql(‘00:00’)});
Relevant body
{
“result”: {
“ufsrTotalNumberOfFish”: 25000,
“ufsrSurvivalPercentage”: 100.0,
“ufsrFishPerHa”: 0,
“ufsrBiomass”: 1.25659535973556,
“ufsrBiomassPercentageFed”: 0.0045201895240963965,
“ufsrFeedAmount”: 5.68004918110482,
“ufsrFeederCount”: 11,
“ufsrFeederCountRecommended”: 1,
“ufsrFeederTimeGap”: 11,
“ufsrTimeRangeResults”: [
{
“utrTimeRangeNr”: 1,
“utrStartTime”: “00:00”,
“utrStopTime”: “00:00”,
When running it via Newman, I get the following errors:
-
AssertionError T5 - FeederConfigurator - Unit - Calculate - Succes (true)
expected false to deeply equal true
at assertion:1 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Calculate” -
AssertionError T5 - FeederConfigurator - Unit - Calculate - No Errors
expected { Object (code, message, …) } to deeply equal null
at assertion:2 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate - FishPerHa
Cannot read properties of null (reading ‘ufsrFishPerHa’)
at assertion:3 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate - FeederCountRecommended
Cannot read properties of null (reading ‘ufsrFeederCountRecommended’)
at assertion:4 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate - TimeRangeStart_1
Cannot read properties of null (reading ‘ufsrTimeRangeResults’)
at assertion:5 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Calculate” -
AssertionError T5 - FeederConfigurator - Unit - Calculate by Id - Succes (true)
expected false to deeply equal true
at assertion:1 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Id/Calculate” -
AssertionError T5 - FeederConfigurator - Unit - Calculate by Id - No Errors
expected { Object (code, message, …) } to deeply equal null
at assertion:2 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Id/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate by Id - FishPerHa
Cannot read properties of null (reading ‘ufsrFishPerHa’)
at assertion:3 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Id/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate by Id - FeederCountRecommended
Cannot read properties of null (reading ‘ufsrFeederCountRecommended’)
at assertion:4 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Id/Calculate” -
TypeError T5 - FeederConfigurator - Unit - Calculate by Id - TimeRangeStart_1
Cannot read properties of null (reading ‘ufsrTimeRangeResults’)
at assertion:5 in test-script
inside “T5 - FeederConfigurator / Unit / Unit/Id/Calculate”