Newman: Add support for providing custom cookie jar

Created on 17 Feb 2017  路  6Comments  路  Source: postmanlabs/newman

  1. Newman Version = 3.4.3
  2. OS details (type, version, and architecture): = Windows 10 x64.
  3. Are you using Newman as a library, or via the CLI? = CLI
  4. Did you encounter this recently, or has this bug always been there: probably always there
  5. Expected behaviour: = work as Postman does
  6. Command / script used to run Newman: =
    newman run ".\dirname\dirname\PostmanFiles\Proj.postman_collection.json" --environment ".\dirname\dirname\PostmanFiles\Proj%%20localhost.postman_environment.json" --folder apiFunctions

  7. Sample collection, and auxilliary files (minus the sensitive details): = none relevant

  8. Screenshots (if applicable): = N/A

Steps to reproduce the problem:

  1. Run above CLI command.
cookie-support feature request runtime

All 6 comments

@codenirvana Is there anything stopping this?

For the library API, we can directly support https://github.com/salesforce/tough-cookie CookieJar or through postman-request if the option of changing the base library is required sometime in the future.

For the CLI a json file can be used, tough-cookie has fromJSON/toJSON methods (https://github.com/salesforce/tough-cookie#cookiejarfromjsonstring).

If this looks okay then I can open a PR for the same.

@rohit-gohri Yes, the underlying postman-runtime library accepts a tough-cookie jar instance.
Refer: https://github.com/postmanlabs/newman/blob/develop/lib/run/index.js#L176

Please feel free to raise PR for this feature request. 馃檪

@codenirvana Could you take a look at the PR? It would be really great if it got merged before the next release.

@codenirvana Sorry for pinging again, but this would be really helpful for my use-case. If you could have a look, it'd be great

Hey @rohit-gohri, sorry for getting back to you so late. I will definitely review this PR today.

Newman v5.2.0 adds support for providing custom Cookie Jar using the new --cookie-jar option.

Thanks @rohit-gohri for your contribution! 馃檶

Was this page helpful?
0 / 5 - 0 ratings