Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#57 #71

Merged
merged 4 commits into from
Jun 3, 2021
Merged

Issue#57 #71

merged 4 commits into from
Jun 3, 2021

Conversation

msharma-tw
Copy link
Contributor

@msharma-tw msharma-tw commented Jun 2, 2021

Feature: Sending Cookies and Asserting Cookies from Response

Library Added: lightweight

Files Changed:

  1. Spec.d.ts.......................added declaration for withCookies(), expectCookies() and expectStrictCookies()
  2. Spec.js...........................added implementation for withCookies(), expectCookies() and expectStrictCookies()
  3. expect.js........................added _validateCookies() and _validateStrictCookies for cookies assertion
  4. cookies.spec.js.............added tests related to cookies

NOTE: Changes in below also required

  • cookie implementation within mock server
  • documentation

@ASaiAnudeep ASaiAnudeep linked an issue Jun 3, 2021 that may be closed by this pull request
@ASaiAnudeep ASaiAnudeep merged commit cb6bdb7 into pactumjs:master Jun 3, 2021
@chrisrichard
Copy link

chrisrichard commented Apr 3, 2022

For user-facing APIs it's typical to keep authentication tokens hidden inside the application and issue an "opaque" cookie to represent the session to the user agent upon successful sign-in. In this case we'd like to verify that the Set-Cookie is as expected, which we can do with this PR, but also have a built-in way to store the cookie(s) and automatically send the right ones on subsequent requests, as a cookie-supporting HTTP user agent would do.

Would be willing to work on a PR for this if you can provide a bit of guidance on how to integrate.

EDIT: Just found #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sending and asserting cookies
3 participants