I am running postman tests in travis-ci with newman. Every time I modify my tests from the postman client, I export the JSON and the tests are ran from travis when pushed.
The problem is I want to test my file upload route but when I export the Collection, a Absolute path is exported for the file in form data !
I like to export the collection so it can be source controlled with git, so we avoid having problems when multiple PRs are running in CI and they try to run a request on a route that isn’t on this PR. Unless you have another solution ?
For the working directory, I set it in Postman’s desktop client. The problem is still that the collection looks for an absolute path (in my case /Users/seluj78/Postman/files/logo.png) on my macbook which obviously isn’t an existing directory in travis and alike CI runners. How can I work around that and pass files that are inside the repository so that the collections will work when exported and when on the desktop client ?
@vdespa I have seen the replacement of path with an env variable in several places in forums. But I do not understand how to do that without the need of editing the exported json file manually and enter like {{pathVariable}} anyway every time you want to push your json to be used by for ex Jenkins. Because in Postman application, in the body of the POST request, you specify a file using a select file button, not with a path or env variable in written text. Or there is something I do not know about.
Last time I have checked the only way is to do this by exporting the collection, editing it and re-importing it. But once you have this running, you don’t need to worry about this anymore.
Hi, please is it possible to use this approach for different folders? I mean if sufficient when the higher level is used only.
On the screen, I have more folders where the data are stored. Let´ say that level above is called “data”. Would it be possible to use path e. g. …/…/data at the necessary data will be uploaded during requests or I need to specify more in variable like …/…/data/Sprint4.