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

[Bug] Wrong request tests count when using pm.sendRequest #241

Open
Kriz1881 opened this issue Jun 29, 2020 · 4 comments
Open

[Bug] Wrong request tests count when using pm.sendRequest #241

Kriz1881 opened this issue Jun 29, 2020 · 4 comments
Labels
area: newman-related This issue relates to the Newman project type: bug Something isn't working

Comments

@Kriz1881
Copy link

Kriz1881 commented Jun 29, 2020

Describe The Problem
When using pm.sendRequest, the test count in "Total Requests">request>"TEST INFORMATION" is doubled (same test is displayed with count 2).

The "TOTAL ASSERTIONS" and the "TOTAL FAILED TESTS" on the Summary page are displayed as expected, but the "Prerequest Scripts" and the "Test Scripts" have the wrong count.

Steps To Reproduce

  1. Add additional request to the (for example) Test tab like:
pm.sendRequest("https://postman-echo.com/get", function (err, response) {
    console.log(response.json());
});
  1. Run the collection
  2. Open the generated report
  3. Verify the "Prerequest Scripts" and the "Test Scripts" count
  4. Navigate to "Total Requests">someRequest>"TEST INFORMATION" and verify the number of test displayed

The command that you're using to run the collection, would be a real help or the newman script, if you're using one.

newman run C:\someFolder\someCollectionName.postman_collection.json --reporters cli,html,junit,htmlextra --reporter-htmlextra-export C:\someFolder\Report.html --reporter-htmlextra-logs --timeout-script 90000 --color off

Screenshots and Gifs
image

image

Collection and Environment Files

Version and Platform Information:

  • newman Version 4.5.5
  • newman-reporter-htmlextra Package Version 1.17.1
  • Node Version 12.13.0
  • OS Windows 10

Additional Context
Add any other context about the problem not mentioned, the more information that can be provided the better.

  • Are you using the reporter from the command line or with a script?
    A: Using the reporter from the command line

  • Are you using the default template or a custom version?
    A: Using the default template

  • If you are using a custom .hbs file, please include this on the report.
    A: No

  • Have you made any local changes to the index.js file?
    A: No

@Kriz1881 Kriz1881 added the type: bug Something isn't working label Jun 29, 2020
@DannyDainton
Copy link
Owner

Hey @Kriz1881

Thank you for the detailed bug report. Unfortunately, this is an open issue with Newman rather than the downstream reporters.

It's been raised on this report a few times now:

There's not really anything that I can do here as all the data, not just the sendRequest() data comes from Newman.

@DannyDainton DannyDainton added the area: newman-related This issue relates to the Newman project label Jun 29, 2020
@DannyDainton DannyDainton changed the title Wrong request tests count when using pm.sendRequest [Bug] Wrong request tests count when using pm.sendRequest Jun 29, 2020
@Kriz1881
Copy link
Author

Kriz1881 commented Jun 29, 2020

Thank you @DannyDainton :)

@DannyDainton
Copy link
Owner

I'm trying to see what I can do with the data that's coming through already but it would be a hack and I don't feel good about it 😬

@deepakaggarwal7
Copy link

deepakaggarwal7 commented May 30, 2022

Looks like requests and prerequest-scripts variables are interchanged in Newman. I ran a collection with 5 requests where 1 request had 3 sendRequest inside pre-requests. newman summary shows pre-request=5 and request=8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: newman-related This issue relates to the Newman project type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants