In this thread, I described how I have a test collection that includes pre-request scripts that may call pm.execution.skipRequest() if certain required variables are not set.
In these circumstances, I want my collection to continue to run, but ideally, there would be some programmatic output that would make it easy for me to identify if requests that were skipped. In the referenced thread, I asked if there was a way to add a param to the pm.execution.skipRequest() call to have it trigger the logic that would increment the skipped test count in newman or runner.
Danny helpfully explained that skipping a request is different than skipping a test, which makes sense. Iβm curious if anyone has any advice on how I could programmatically detect skipped tests.
One idea I had was to write some console.error output in these circumstances and redirect newmanβs stderr output to a file, but it seems that newman is intercepting this (it adds some red to the console.error output).
In an ideal world Iβd love to see a column βSkippedβ added to the newman output, ie:
βββββββββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββββββββββββββββββ
β β executed β failed β skipped β
βββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββ€βββββββββββββ€
β iterations β 1 β 0 β 0 β
βββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββ€βββββββββββββ€
β requests β 47 β 0 β 3 β
βββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββ€βββββββββββββ€
β test-scripts β 47 β 0 β 12 β
βββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββ€βββββββββββββ€
β prerequest-scripts β 17 β 0 β 0 β
βββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββ€βββββββββββββ€
β assertions β 357 β 0 β 0 β
βββββββββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββ€βββββββββββββ€
I realize this doesnβt lend itself to programmatic inspection, but it would make it easy to realize that tests were skipped at a glance. I havenβt played much with newmanβs built-in reporters, so if anyone has had luck with this using a different reporter Iβd love to hear about that!
Thanks in advance for any suggestions!