You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe('test some UI', () => {
before(() => cy.setupPact('consumer-ui', 'provider-api');
it('User is able to do a process that causes two requests I want to record', () => {
cy.intercept('POST', '/api/thing-one').as('thing-one');
cy.intercept('POST', '/api/thing-two').as('thing-two');
// ... interact with UI
cy.usePactWait('thing-one').then((xhr) => {
expect(xhr.response.statusCode).to.eq(200);
// ... UI is in a new state, interact with it again to get the second request
cy.usePactWait('thing-two').then((xhr) => {
expect(xhr.response.statusCode).to.eq(200);
});
});
});
});
At this point, I have a pact file that only includes the last interaction for thing-two and not the interaction for thing-one. I believe this is because constructPactFile is excluding "duplicate" interactions based on the test title, which in this case, the test has two interactions under the same test title, so the first one gets excluded/overwritten.
Am I using the Cypress adapter correctly? If so, is there a reason I can only write one interaction per test? Or is this a bug in the adapter?
Thanks!
The text was updated successfully, but these errors were encountered:
Hello! I have a test that's something like this:
At this point, I have a pact file that only includes the last interaction for
thing-two
and not the interaction forthing-one
. I believe this is becauseconstructPactFile
is excluding "duplicate" interactions based on the test title, which in this case, the test has two interactions under the same test title, so the first one gets excluded/overwritten.Am I using the Cypress adapter correctly? If so, is there a reason I can only write one interaction per test? Or is this a bug in the adapter?
Thanks!
The text was updated successfully, but these errors were encountered: