Skip to content
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

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cypress/integration/office/txo/tioFlows.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ describe('TIO user', () => {
cy.server();
cy.route('GET', '/ghc/v1/swagger.yaml').as('getGHCClient');
cy.route('GET', '/ghc/v1/queues/payment-requests?**').as('getPaymentRequests');
cy.route('GET', '/ghc/v1/queues/payment-requests?sort=age&order=desc&page=1&perPage=20').as(
'getSortedPaymentRequests',
);
cy.route('GET', '/ghc/v1/payment-requests/**').as('getPaymentRequest');
cy.route('GET', '/ghc/v1/move_task_orders/**/mto_shipments').as('getMTOShipments');
cy.route('GET', '/ghc/v1/move_task_orders/**/mto_service_items').as('getMTOServiceItems');
Expand All @@ -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']);
Copy link
Contributor

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.

cypress-io/cypress#4389

Something like this:

cy.wait(['@getPaymentRequests', '@getPaymentRequests']);

Copy link
Contributor Author

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.

cy.get('[data-uuid="' + paymentRequestId + '"]').click();

// Payment Request detail page
Expand Down
3 changes: 3 additions & 0 deletions cypress/integration/office/txo/tooFlows.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('TOO user', () => {
cy.server();
cy.route('GET', '/ghc/v1/swagger.yaml').as('getGHCClient');
cy.route('GET', '/ghc/v1/queues/moves?**').as('getMoveOrders');
cy.route('GET', '/ghc/v1/queues/moves?page=1&perPage=20&sort=status&order=asc').as('getSortedMoveOrders');
cy.route('GET', '/ghc/v1/move-orders/**/move-task-orders').as('getMoveTaskOrders');
cy.route('GET', '/ghc/v1/move_task_orders/**/mto_shipments').as('getMTOShipments');
cy.route('GET', '/ghc/v1/move_task_orders/**/mto_service_items').as('getMTOServiceItems');
Expand All @@ -28,6 +29,7 @@ describe('TOO user', () => {
const moveLocator = 'TEST12';

// TOO Moves queue
cy.wait(['@getSortedMoveOrders']);
cy.contains(moveLocator).click();
cy.url().should('include', `/moves/${moveOrderId}/details`);

Expand Down Expand Up @@ -83,6 +85,7 @@ describe('TOO user', () => {
const moveLocator = 'TEST12';

// TOO Moves queue
cy.wait(['@getSortedMoveOrders']);
cy.contains(moveLocator).click();
cy.url().should('include', `/moves/${moveOrderId}/details`);
cy.get('[data-testid="MoveTaskOrder-Tab"]').click();
Expand Down