[15 min fix] Flakey "change password" spec (#13979)

* wait for all sign in network requests to resolve

* tweaks

* add chat request
This commit is contained in:
Suzanne Aitchison 2021-06-14 14:23:21 +01:00 committed by GitHub
parent cbb385bf6d
commit 420e47675d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,11 +41,26 @@ describe('User Change Password', () => {
.type(newPassword);
});
// We intercept these requests to make sure all async sign-in requests have completed before finishing the test.
// This ensures async responses do not intefere with subsequent test setup
cy.intercept('/notifications?i=i').as('notificationsRequest');
cy.intercept('/notifications/counts').as('countsRequest');
cy.intercept('/async_info/base_data').as('baseDataRequest');
cy.intercept('/chat_channels**').as('chatRequest');
// Submit the form
cy.get('@loginForm').findByText('Continue').click();
cy.wait([
'@notificationsRequest',
'@countsRequest',
'@baseDataRequest',
'@chatRequest',
]);
const { baseUrl } = Cypress.config();
cy.url().should('equal', `${baseUrl}settings/account?signin=true`);
cy.findByRole('heading', { name: 'Set new password' });
});
it('should give an error if the new password/confirm new password fields do not match when changing the password of a user', () => {