39

I am using POSTMAN collections to test my API before opening it up. I work with a team of developers and we would like to share/add/edit our collections amongst each other.

Doing this in source control is proving slightly tricky as can be seen in this comment on the GitHUB page:

This issue still persists in Version 2.1.1 (packaged)

The order of requests might be deterministic now, but the diff of an exported collection from two different machines and users includes data that are not related to the collections exported. The diff is full of owner and other id conflicts if there are several people working on the tests at the same time.

What is the best way that we have of putting this data in some sort of version control system? Any suggestions otherwise?

Community
  • 1
  • 1
tensai
  • 1,628
  • 3
  • 17
  • 22

4 Answers4

13

Putting it in a VCS undoubtly will give you some headaches as you mentioned. Your best bet is to use Postmans functionality to share collections. Here is from the documentation found at https://www.getpostman.com/docs/sharing

Starting with Postman v0.9.3 you have the ability to share and manage your collections more effectively. The first thing you will have to do is create a Postman account. You can create one using your email ID or a Google account. Once you are signed in after creating an account, the collections you upload on Postman are linked to your account. You can delete them later through the "Shared collections" item in the navigation bar dropdown.

Magnus Karlsson
  • 3,549
  • 3
  • 31
  • 57
  • 13
    This does add problems however, since we do some automated testing. If a user modifies API functionality, updates their postman collection, the continuous integration and automated testing will end up failing until the changes being worked on are checked in. – tensai Jul 13 '15 at 14:31
  • If you are mac have a look at the syncing options in Paw for Teams. We support branching and user reviewed merges. https://paw.cloud/teams Suppot for autmated testing is comming in our next major release. – Matthaus Woolard Oct 18 '16 at 05:07
10

Collection v2 format removes most, if not all, problems with portability.

http://blog.getpostman.com/2015/06/05/travelogue-of-postman-collection-format-v2/

  • The format must be highly portable so that it can be easily transported between various systems without loosing functionality.
everis
  • 316
  • 4
  • 11
  • 1
    `loosing` :facepalm: – Jonesopolis Mar 29 '20 at 19:10
  • @Jonesopolis hehe, I didn't noticed. But it's direct quote, so yea. – everis Mar 31 '20 at 09:26
  • 3
    Yeah, man, you just want functionality that's tight, it shouldn't be loose. But on a more serious note, we use v2.1 and it's still a nightmare to collaborate since test run results, random ids, etc. are saved to the collection file. We've already accidentally overwritten each other's changes several times. I think the Postman shared collections are the way to go. But I do wish that instead of implementing their own version control they'd have just created a more version-control-friendly format and let us pick our own VCS... – Frans Feb 01 '21 at 15:57
3

Source Control in Postman

The question about sharing collections so that you can collaborate with your teammates has been answered a few different ways, as described in other answers of this question such as by sharing the collection or by syncing to a team account.

Version Control in Postman

The other part of the question was about putting the Postman data into a version control system. Postman introduced some version control features for the paid team accounts, like being able to restore collections to a certain point in the activity feed.

The paid team accounts also get integrations to sync their collections to their own version control systems like GitHub for example. If you're on a free account, you can use the Postman API to build your own similar integration to update the collections.

This blog post talks about some of the version control features in Postman.

UPDATE: Postman released forking and merging in Postman app v6.7.1 so you can manage version control in the app.

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
J.Lin
  • 1,120
  • 9
  • 11
1

To automatically share your existing postman collection you can use Postman Pro. It is a paid service provided using which a team lead can purchase the complete pro- scheme for his team and work as an admin. Postman pro enables the following and many more:

  1. Any changes in the API are automatically reflected in Postman for all member
  2. Members subscribe to the collections from the Team library and get notifications of any changes.

For more information you can refer: https://app.getpostman.com/dashboard/team-upgrades

This is what I use with my team of automation testers.

DimaSan
  • 12,264
  • 11
  • 65
  • 75
SSabharwal
  • 159
  • 12
  • It does not seem to work with a privately hosted git, though – Suzana Sep 20 '17 at 13:17
  • No not with locally hosted Git but Postman Pro itself will work as source control, if you have an account in it and you have downloaded Postman in the machine, you are good to go. – SSabharwal Sep 21 '17 at 06:40