https://cypress.io logo
I don't really see why the order is important. As ...
# e2e-testing
f
I don't really see why the order is important. As long as you can assert that the call completes and the two messages are presented, that should be enough? If it's the
wait()
that is holding you up here because the call resolves too quickly you could instead spy on the intercept and then assert there's been a successful call
Copy code
cy.intercept('/some/endpoint', cy.spy().as('someEndpoint'))
...

cy.click()
cy.contains('#message', 'Request sent')
cy.contains('#message', 'Request received')
 cy.get("@fruitEndpoint")
    .should('have.been.calledOnce')