Open rafkhan opened 5 years ago
Can you double check your collection that tests are not added in collection or folder level scripts?
@codenirvana can we add hints to indicate that the tests are from folder or collection scripts?
@shamasis You called it! That was exactly my problem, thanks so much.
I forked this collection and hadn't noticed that they setup those specific cases in a collection-level test. But yes! That would be a great idea, probably would have been more clear to know where the test was originating from.
@kunagpal what would something like this look like? Would you want the runtime to report the source location of any test run? I'd definitely be open to make this contribution with a little design help.
@codenirvana Can I work on this? If the file is local, just report the location of the collection and if its a link, report the link address right?
@codenirvana I am able to show the location of the test as shown below: I had to add a function in https://github.com/postmanlabs/newman/blob/develop/lib/util.js to get the test location, given (PostmanItem, script-id) and reference it from https://github.com/postmanlabs/newman/blob/develop/lib/reporters/cli/index.js. Let me know if the feature is as required and if it is okay to modify the util.js file.
@shamasis Is this what you were expecting? Can i proceed with a pull request?
The output is in right direction. This is fantastic. I’m worried that we made things look very busy in CLI output and that in most cases this is not the most important information to always display in brackets.
Ideas? Perhaps only show an indicator to only indicate that this test was run from an inherited script and not show expanded details until --debug
is set?
The premise is that this info would not be needed for majority of scenarios and we shouldn’t consume valuable character real estate and add cognitive load while reading test info for everyone.
@shamasis Yes, the detailed CLI output is not needed in most of the cases. It would be better if these details are provided to the user on demand i.e. on setting -debug
or some other relevant new tag.
@shamasis I agree. So I added just a symbol adhering to their meaning in the context ie.
symbols.root
for a collection-based testsymbols.folder
for a folder-based testIt looks like this now:
Does this work?
And for the debug option, I am ready to work on it. Let me know if adding an option to the command is feasible.
We can use --verbose
. It already exists. 😊
I have completed both of the tasks. But the test-library is failing after adding my code for decreasing the branch coverage below the threshold. This is because my function is defensive to argument errors(just like the other functions) and there is no way to cover those branches in any situation in an integration test. I had decided to add unit tests after you check my code. But now, I am stuck at this point. Can you please help me out @shamasis?
@narayanpai1 is this issue still up? I would like to work on this.
Hi @Abhirup-99, my PR already adds the feature and I have been told it will be reviewed shortly.
Thank you for the clarification.
Is this issue fixed or should I be working on this issue?
I started by writing the failing test case, checking if my endpoint 401s at the right time. Despite not adding a 200 check, newman seems to be automatically inserting that into every test.
Is there a feature on the horizon for writing tests to ensure endpoints fail correctly?
newman -v
):