Replies: 2 comments 4 replies
-
Hi Lynn, I'm not entirely how Pact is meant to fit in with the above example. As Pact is intended to mock the other side of the interaction (be it the consumer or provider), you shouldn't need to login though you may require that a authorization header be set. For example, you might have a Pact which, in English, would look like:
|
Beta Was this translation helpful? Give feedback.
-
This is a common misunderstanding about how Pact and more generally, contract testing, is supposed to work. In Pact, each test should be isolated and independent from other requests. So you should not have to sequence calls this way - this is really a functional test. From our docs:
As @JP-Ellis mentioned, you can use provider states to specify the pre-condition for the test, and use https://docs.pact.io/provider/handling_auth to work out the best strategy to manage the provider verification side of things. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to use pact to do contract testing. My case is as below.
Step1 : Use Login to get related token
Step2: Call get API using above token to generate Pact json file
Could you please have a look about this and give me one example for above Case?
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions