Skip to content

Commit

Permalink
pkp#8700 Give Cypress a chance to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Mar 23, 2023
1 parent 8980323 commit 6768b79
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,12 @@ Cypress.Commands.add('createUser', user => {
});
cy.server();
cy.route('POST', '**/grid/settings/user/user-grid/update-user-roles*').as('rolesSaved');
cy.get('form[id=userRoleForm] button[id^=submitFormButton]').click();
cy.wait('@rolesSaved').its('status').should('eq', 200);
cy.get('div[id^=component-grid-settings-user-usergrid]').as('userGrid').then(staleUserGrid => {
cy.get('form[id=userRoleForm] button[id^=submitFormButton]').click();
cy.wait('@rolesSaved').its('status').should('eq', 200);
// Wait for the interface to refresh, the "User Grid" will be recreated and get a new ID.
cy.get('@userGrid').should('not.have.attr', 'id', staleUserGrid.attr('id'));
});
});

Cypress.Commands.add('flushNotifications', function() {
Expand Down

0 comments on commit 6768b79

Please sign in to comment.