I created this npm library tools that enhances or merges postman collections:
I have also created a CLI tool that uses above library:
And also a GUI tool (work in progress):
Currently these are the features that the library supports:
- mv => Merges all variables from all source folder collections in the collection variables of the output collection
- mev => Merges all collection variables from all source folder collections to an output environment file. If no source environment is specified, a blank one will be used as starting point
- mr => Merges all requests from all source folder collections into the output collection, collection variables are not transferred, only requests
- mc => Merges each collection requests from all collections (from the source folder) in a separate folder in the output collection. Collection variables with this command are setup in the PreRequest script of each requests folder
- ts => Adds response validation asserts to all requests of the source collection and saves to the output collection. Smart tests are generated by using the existing saved responses as examples in the collection. This command analyses the saved responses and creates tests to match those values. Currently this command supports only JSON response testing. With this command, the -f and -c flags are not used
- t200 => Adds test asserts (to check if response HTTP code is 200) to all requests of the source collection and saves to the output collection. With this command, the -f flag is not used.
- clr => All repeating occurrences of absolutely the same requests (including name) will be removed, only one will remain. The remaining instance is the first occurrence that the cleanup algorithm encounters while analyzing. Scope of comparing duplicates is the whole collection with all folders and subfolders. With this command, the -f and -c flags are not used
- clv =>Removes all unused collection variables from the collection. It goes through the whole collection and looks for used variables. Then removes all collection variables that are not referenced anywhere in the collection. With this command, the -f and -c flags are not used
- amcv => Appends missing collection variables that are referenced in all requests but are not present in the collection. With this command, the -f and -c flags are not used
I would appreciate your constructive suggestions for adding new features (add them on the github repo as issues) and also if anyone wants to collaborate is welcome.