I have a number of subfolders in my collection of tests, that logically groups a sequence of test cases in a scenario. These subfolders help organise the UI within Postman when your test suite consists of 100s of tests. I would be great if from the command line you could target the subfolder within a collection.
e.g. newman -c apitests.json -b '02 new basket' -e environment.json -o output.json
There's the -f flag that allows you run run a folder in a collection.
-f, --folder [folderName] Specify a single folder to run from a collection. To be used with -c or -u.
How one can target a deep nested subfolder ?
I got the followinf hierarchy:
Main
|-- Sub 1
| |-- test
|-- Sub 2
| |-- test
How can I target Main/Sub 1/test ?
Just test execute one of the two test folder randomly.
Came here with a Google search, the answer to the question of @BancarelValentin can be found on https://github.com/postmanlabs/postman-collection/issues/230#issuecomment-329689317
Came here with a Google search, the answer to the question of @BancarelValentin can be found on postmanlabs/postman-collection#230 (comment)
It doesn't help if you have folder structure like below and want to run some particular subfolder:
|- LB
|- Internal endpoints
Service2
|- LB
|- Internal endpoints
Currently it will run only first match.
Looks like you should be able to workaround this limitation by naming your sub-folders with a scheme like [parent]-[child]. Maybe not very convenient at the one time of folder creation but very convenient that the several times of executing the tests.
Most helpful comment
How one can target a deep nested subfolder ?
I got the followinf hierarchy:
Main
|-- Sub 1
| |-- test
|-- Sub 2
| |-- test
How can I target Main/Sub 1/test ?
Just test execute one of the two test folder randomly.