Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit reporter not including request when using extra request to get testdata in test #1881

Closed
aberx1 opened this issue Feb 4, 2019 · 6 comments

Comments

@aberx1
Copy link

aberx1 commented Feb 4, 2019

  1. Newman Version (can be found via newman -v): 4.3.1
  2. OS details (type, version, and architecture): Linux 3.10.0-514.21.1.el7.x86_64
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: tried on version 4.1.0 & 4.3.1, both didn't work.
  5. Expected behaviour: JUnit reporter outputs the file with the testSuite containing the multiple assertions executed with the function.
  6. Command / script used to run Newman: newman run junit_reporter_issue.postman_collection.json -r cli,junit
  7. Sample collection, and auxiliary files (minus the sensitive details):

junit_reporter_issue.postman_collection.zip

Steps to reproduce the problem:

  1. open the collection and edit the URL to go to a server that responds with whatever body you post to it and edit the pm.sendrequest to get the testData object linked to "testCaseId": "56913"
  2. save and export the collection
  3. run the collection using newman run junit_reporter_issue.postman_collection.json -r cli,junit
  4. see that the assertions happened
  5. check the reporter file to confirm that it has not

extra information. The problem appears to be the pm.sendRequest that I use to gather my testdata from a server. If i do this with the data coming directly from pm.response.json() there is no problem. However this is not possible for me because in reality these are two different servers.

I have tried this both on windows as well as on a jenkins running on Linux. Both returning the same problem.

@aberx1
Copy link
Author

aberx1 commented Feb 8, 2019

I've read through the already open issues. I believe this to be duplicate to #1631 where there was no more user response regarding the issue.

@aberx1
Copy link
Author

aberx1 commented Feb 12, 2019

It appears that as soon as a "pm.sendRequest" is inside the test script the junit reporter does not work anymore, even if the response is not used at all. adding sample with a //donothing in pm.sendRequest.
You can run the added files against a server that returns your request as the response for an example and the difference, i will also add screenshots
cmd capture
image

junit reporter issue.zip

@ghost
Copy link

ghost commented Mar 10, 2019

@aberx1, could you please check it with 4.4.0? Per changelog: Fixed JUnit report generation for nested requests/tests.

I even see the test similar to yours: nested-requests-report-test.json

@aberx1
Copy link
Author

aberx1 commented Mar 11, 2019

@Donotello
The issue is fixed in 4.4.0
Thank you!

@ghost
Copy link

ghost commented Mar 11, 2019

@aberx1, could you please close this issue in this case? You should have a button for this.

@codenirvana
Copy link
Member

@Donotello @aberx1 Thanks! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants