-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to fix Cypress flakes #5353
Conversation
bcffd87
to
3e3b983
Compare
For some reason, we are making two requests on the TXO pages: one with page, per page, and order, and then a second request with the same params, but this time with sort added to the mix. Because we were using a glob to match all requests to the TXO endpoints, calling cy.wait will stop at the first match, and will not also wait for the second request. I added a second named route to match the second request, and we are now waiting for that one as well.
3e3b983
to
71a145e
Compare
@@ -42,7 +45,7 @@ describe('TIO user', () => { | |||
const paymentRequestId = 'ea945ab7-099a-4819-82de-6968efe131dc'; | |||
|
|||
// TIO Payment Requests queue | |||
cy.wait(['@getGHCClient', '@getPaymentRequests']); | |||
cy.wait(['@getGHCClient', '@getPaymentRequests', '@getSortedPaymentRequests']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding another route works in this case. There's another way to wait for a number of the same requests instead of creating a new route.
Something like this:
cy.wait(['@getPaymentRequests', '@getPaymentRequests']);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, interesting! I prefer that waitTimes custom command. Maybe we can try that next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
For some reason, we are making two requests on the TXO pages: one with
page, per page, and order, and then a second request with the same
params, but this time with sort added to the mix.
Because we were using a glob to match all requests to the TXO
endpoints, calling cy.wait will stop at the first match, and will not
also wait for the second request. I added a second named route to
match the second request, and we are now waiting for that one as well.
Examples of recent failed tests:
https://app.circleci.com/pipelines/github/transcom/mymove/23944/workflows/3f4e6f60-9ae3-4bb4-bf00-521ec34183dc/jobs/370649
https://app.circleci.com/pipelines/github/transcom/mymove/23954/workflows/f872e2a7-6a40-466a-9918-d7003174fb0e/jobs/370793
Resources and other potential things we can try if this doesn't work:
https://www.cypress.io/blog/2020/11/17/when-can-the-test-submit-a-form/
cypress-io/cypress#5743 (comment)
cypress-io/cypress#7306