Sarunas Kavaliauskas
08/16/2022, 7:33 PMTimothy Jones
08/17/2022, 2:32 AMSarunas Kavaliauskas
08/17/2022, 9:54 AMTimothy Jones
08/17/2022, 12:31 PMwhat is best way to start stub api server from contract files and ask for specific state before each testThe best way is to use the DSL that surrounds the mock server. The stub server (alone) doesn’t have many use cases
Sarunas Kavaliauskas
08/18/2022, 8:02 AMSarunas Kavaliauskas
08/18/2022, 8:03 AMTimothy Jones
08/18/2022, 8:57 AMTimothy Jones
08/18/2022, 9:07 AMto provide HTTP stubs for tests that cover all layers of your consumer.This means that if you absolutely must have an API available at the time of your UI tests, you can use the stubs, which will be generated from the pact contract file that you got from your pact tests. This has the advantage that you will be using the same responses that will later be verified against the real server. The second quote just says that you can totally use the contract for stubs, but it's not the right tool for mocking complex behaviour over several requests.
is to use shared fixtures, or the generated pact itselfFor what it's worth, I don't use the stubs - I use shared fixtures - I talked about this somewhere around the 40 minute mark here:
Timothy Jones
08/18/2022, 9:08 AMSarunas Kavaliauskas
08/20/2022, 3:37 AM