newman icon indicating copy to clipboard operation
newman copied to clipboard

newman CLI should support fully qualified path for running scripts in a subfolder

Open niranjankhare opened this issue 6 years ago • 9 comments

Issue: I'm unable to specify a specific folder for execution with newman CLI, when the leaf level folder name is repeated somewhere else in the folder heirarchy for a Postman Collection. Its quite possible that I'm making a silly mistake, but researching online didn't give me specific answers, maybe documentation needs to include an example if the ability exists.

  1. Newman Version 4.3.1

  2. OS details Linux nkcell460 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

  3. Using as CLI

  4. Just started using newman. Could not find the answer looking up blogs or online resources, particularly: https://stackoverflow.com/questions/49769010/newman-run-subdirectory-of-a-collection and https://github.com/postmanlabs/newman/pull/1654

  5. Expected behaviour: --folder option should support the subfolder specification by fully qualified path under the Collection

  6. Command / script used to run Newman: Tried: a. newman run <collection>.json --folder "sample/_identifier" --environment <env>.json -n 1 newman run <collection>.json --folder "final/_identifier" --environment <env>.json -n 1 (i.e. unique parent and the subfoder) Result : Nothing selected for run and b. newman run <collection>.json --folder "fully/qualified/path/final/_identifier" --environment <env>.json -n Result : Nothing selected for run c. newman run <collection>.json --folder "_identifier" --environment <env>.json -n Result : runs hd7 / final / _identifier

Steps to reproduce the problem:

  1. Create a collection with a folder structure.
  2. Ensure a folder name is repeated under a different heirarchy
  3. Try to use different expressions for --folder option for newman cli to execute the folder '_identifer' under sample

If I have a subfolder with the same name somewhere else in the folder structure, how do I select a specific one? --folder "<parentFolder1>/theName" doesn't seem to work. newman version 4.3.1

niranjankhare avatar Jan 08 '19 05:01 niranjankhare

@niranjankhare This is not supported yet. For now, you can specify a unique name to your _identifier and pass that to --folder option.

codenirvana avatar Jan 08 '19 05:01 codenirvana

:+1: for this too 🙂

bhreinb avatar Feb 16 '19 09:02 bhreinb

Any estimate as to when this will be implemented? For now I have to split out subfolders into separate collections in order to run them individually.

deelawn avatar Nov 12 '19 18:11 deelawn

I need this feature too guys :-)

aurelienlair avatar Nov 17 '20 17:11 aurelienlair

To anyone requesting this, why not submit a PR?

jawn avatar Nov 18 '20 08:11 jawn

@aurelienlair @jawn @shamasis @codenirvana I've made a PR for this. Are we looking forward to this feature request?

adityaofficial10 avatar Apr 09 '21 09:04 adityaofficial10

@adityaofficial10 can you give us the link of the PR please?

aurelienlair avatar Apr 09 '21 09:04 aurelienlair

@aurelienlair I've linked it here.😀

adityaofficial10 avatar Apr 09 '21 10:04 adityaofficial10

How about running a subfolder within a folder? I've got a deeply nested postman collection comprised of different kinds of tests split by major category and further broken into API versions.

So: postmansuite:

  • SuiteA
    • v1
      • test1
      • test2
    • v2
      • test1
      • test2
  • SuiteB
    • v1
      • test1
      • test2
    • v2
      • test1
      • test2

I'd expect to be able to do something like --folder "SuiteB/v1" to run that nested subfolder?

mattisking avatar Jan 13 '23 21:01 mattisking