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

How can I filter failed requests in my custom report? #435

Closed
1 task done
ragnarok66 opened this issue Apr 25, 2024 · 2 comments
Closed
1 task done

How can I filter failed requests in my custom report? #435

ragnarok66 opened this issue Apr 25, 2024 · 2 comments
Labels
state: needs-triage This issue needs to be triaged state: triaged This issue has been triaged

Comments

@ragnarok66
Copy link

ragnarok66 commented Apr 25, 2024

Is There An Existing Issue

What Are You Seeing

Hi,

I am using custom report and I am trying to filter and show only failed requests. In my case, the tests are the requests, because in the structure each folder is a test case.

In the screenshot bellow is visible that in the nav bar the "Total Tests" and "Failed Tests" shows correct number.
image
image

My problem is that I have no idea how to filter only the failed requests in "Failed Tests".

I am using this code to show the failed tests (requests):
{{#each aggregations}} {{#if parent.name}} <div class="alert alert-dark text-uppercase text-center iteration-{{parent.iteration}}"> <a data-toggle="collapse" href="#" data-target="#folder-collapse-{{parent.id}}-iteration-{{parent.iteration}}" aria-expanded="false" aria-controls="collapse" id="folder-{{parent.id}}-iteration-{{parent.iteration}}" class="collapsed text-dark z-block"> <i class="fas fa-info-circle float-left resultsInfoPass" {{#each executions}}{{#if cumulativeTests.failed}} style="color: var(--failure2); padding-top: 4px;"{{/if}}{{/each}}></i> {{parent.name}} - {{executions.length}} {{#gt executions.length 1}}Requests{{else}}Request{{/gt}} in the folder <i class="float-lg-right fa fa-chevron-down" style="padding-top: 4px;"></i> </a> </div> <div id="folder-collapse-{{parent.id}}-iteration-{{parent.iteration}}" class="collapse" aria-labelledby="folder-{{parent.id}}"> {{> aggregations}} </div> {{else}} {{> aggregations}} {{/if}} {{/each}}

Any help and advice is more then welcome.

Note: This is not a bug in the original report.

Steps To Reproduce The Issue

It can be generated with the command from "Full Newman Command Or Node Script" section.

Full Newman Command Or Node Script

npx newman run sweet/collections/Sweet.postman_collection.json --folder "Verify the sweets" --delay-request 1000 --environment sweet/environments/QAB.postman_environment.json --insecure -r cli,htmlextra --reporter-htmlextra-template sweet/template/batman.hbs --reporter-htmlextra-export testArtifacts/sweet.html --reporter-htmlextra-title "Regression-Tests-sweets" --reporter-htmlextra-browserTitle "Sweet" --reporter-htmlextra-logs --reporter-htmlextra-noSyntaxHighlighting --reporter-htmlextra-showGlobalData

HTMLEXTRA Version

1.23.0

Newman Version

6.1.0

Additional Context

I cannot find any information about how to iterate between aggregations.
What aggregation contains and how to filter information from it ?

@ragnarok66 ragnarok66 added state: needs-triage This issue needs to be triaged type: bug Something isn't working labels Apr 25, 2024
Copy link

Hey @ragnarok66: 👋 - Thanks for helping to make the reporter better by raising this ticket. I will take a look as soon as I can and get back to you. Cheers, Danny.

@DannyDainton DannyDainton removed the type: bug Something isn't working label Apr 25, 2024
@DannyDainton DannyDainton changed the title Cannot filter failed requests How can I filter failed requests in my custom report? Apr 25, 2024
@DannyDainton DannyDainton added the state: triaged This issue has been triaged label Apr 25, 2024
@DannyDainton
Copy link
Owner

Hey @ragnarok66

As your custom template is different, you need to share the full file rather than a some section from it.

This is not steps to reproduce the behaviour:

npx newman run sweet/collections/Sweet.postman_collection.json --folder "Verify the sweets" --delay-request 1000 --environment sweet/environments/QAB.postman_environment.json --insecure -r cli,htmlextra --reporter-htmlextra-template sweet/template/batman.hbs --reporter-htmlextra-export testArtifacts/sweet.html --reporter-htmlextra-title "Regression-Tests-sweets" --reporter-htmlextra-browserTitle "Sweet" --reporter-htmlextra-logs --reporter-htmlextra-noSyntaxHighlighting --reporter-htmlextra-showGlobalData

I don't have access to any of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs-triage This issue needs to be triaged state: triaged This issue has been triaged
Projects
None yet
Development

No branches or pull requests

2 participants