https://cypress.io logo
#e2e-testing
Title
# e2e-testing
t

thankful-lunch-80439

10/02/2021, 5:53 AM
I think the first line may be consuming 1st request, and the cy.get the 2nd. So maybe it should be
Copy code
js
cy.wait("@rating", { timeout: 60000 }).then((xhr: any) => {
  expect(xhr.statusCode).to.eq(200);
  const quotestatus = xhr.response.body.isReferred;
  cy.wrap(xhr.response.body.isReferred).as("quoteisrefBool");
});
a 60 second timeout is quite generous too 😅 Also, I could be wrong, though i think this may be clear for you too
Copy code
js
cy.wait("@rating", { timeout: 60000 }).then({ response}) => {
  expect(response.statusCode).to.eq(200);
  cy.wrap(response.body.isReferred).as("quoteisrefBool");
});
@User I wanted to make sure you saw this and made this thread so we don't bog down the main channel
4 Views