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â