The main disadvantage of this, however, is that we are now managing these tests separately from the main code repository. We can now much more easily version control our Postman collection(s). Here we can look over any conflicts our branch may have, assign team members to review our PR and merge it once approved. You’ll then be taken to the page for your pull request. From here we can update our branch with any new updates to the master version and create a pull request that will take us to the web dashboard where you can provide your request with a title and description. This will create another version of the collection below the original. If we go to the collection and hit the ‘…’ button, we can choose to fork from the current version within Postman. Version controlīut what about when we want to start making changes to the current tests and write new ones? You can’t convert the default workspace you start off with (‘My Workspace’) into a team workspace so we need to make a new workspace first and invite our team to it, defining the level of access to give each member as either admin or collaboratorįrom here, everyone on our team can view and contribute to all collections and environments of our postman API tests without having to export and import various files. Here though, we will just stick to the free team workspace. The team workspace is free but is limited to only 25 active API requests, after which the oldest will be archived as historical requests, more info on Team Workspaces here.Īlternatively we could open a team account which has much higher limits on the number of requests and calls but does involve a monthly subscription so it is really down to what works best for your project and how much you’re willing to spend. To work effectively with our team we should either set up a team workspace or a team account in Postman. They may not be comfortable with any data being out of their direct control and ultimately having to trust that nothing is saved externally that could compromise their security. It’s worthwhile considering this aspect carefully as organisations may be averse to storing information externally with a third party. One main disadvantage from this though is that we now have a copy of our tests stored with a third party so should be careful not to store any sensitive information in our collections or environments. Thanks to this, whenever we save changes to our collection, these will sync automatically through the API and the rest of the team can view these by simply hitting the refresh button. With an account, however, we can start to utilise the Postman API which backs up our workspaces, collections and environments in the cloud. Running the Postman app without having an account allows us to make and manage collections locally. So, can we build on this to make the process easier for teams to develop and test? Let’s start by having a look at the Postman API. This means that any change involves completely replacing our test file(s) so understanding and reviewing those changes on typical version control systems e.g. Using Stephen’s approach leaves us with files that aren’t easily readable and any changes to them involve importing them to postman if not already there, exporting once the changes are saved and replacing the older files in the repo with these completely new ones. Don’t worry, we’ll be here when you get back. If you haven’t read it yet, now would be a good time to go and give it a look. Primarily how we can export collections and environments as well as using Newman to run them from the command line. To that end, let’s see how we can automate our API tests with Postman, a tool I’m sure many of us have come across at one point or another.įor this, we will be using Stephen Mangan’s post A Beginner’s Guide to Automated API Testing (Postman/Newman) as a jumping off point so will be assuming a lot of the knowledge from there. Having well written tests that we can easily modify and automate in our CI/CD pipeline will contribute greatly to this. As microservices become the norm, ensuring our systems can communicate properly is now more important than ever.
0 Comments
Leave a Reply. |