Fix Cypress tests on master (#26500)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6ea363e260
Коммит
9e5d486a5b
@@ -59,7 +59,7 @@ describe('Guest Accounts', () => {
|
||||
});
|
||||
|
||||
// * Guest users are shown as "Inactive".
|
||||
checkUserListStatus(guestUser, 'Inactive');
|
||||
checkUserListStatus(guestUser, 'Deactivated');
|
||||
|
||||
// # Navigate to Guest Access page.
|
||||
cy.visit('/admin_console/authentication/guest_access');
|
||||
@@ -70,22 +70,16 @@ describe('Guest Accounts', () => {
|
||||
// # Click "Save".
|
||||
cy.get('#saveSetting').scrollIntoView().click();
|
||||
|
||||
// * Guest users are shown as "Inactive".
|
||||
checkUserListStatus(guestUser, 'Inactive');
|
||||
// * Guest users are shown as "Deactivated".
|
||||
checkUserListStatus(guestUser, 'Deactivated');
|
||||
});
|
||||
|
||||
function getInnerText(el) {
|
||||
return el[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
|
||||
}
|
||||
|
||||
function checkUserListStatus(user, status) {
|
||||
// # Go to System Console ➜ Users.
|
||||
cy.visit('/admin_console/user_management/users');
|
||||
|
||||
cy.get('#searchUsers').should('be.visible').type(user.username);
|
||||
cy.get('#selectUserStatus').select(status);
|
||||
cy.get('.more-modal__details > .more-modal__name').should('be.visible').then((el) => {
|
||||
expect(getInnerText(el)).contains(`@${user.username}`);
|
||||
});
|
||||
cy.get('#input_searchTerm').should('be.visible').type(user.username);
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('have.text', status);
|
||||
cy.get('#systemUsersTable-cell-0_emailColumn').should('have.text', user.email);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -86,8 +86,8 @@ export function verifyInvitationSuccess(user: string, team: Cypress.Team, succes
|
||||
cy.get('.InvitationModal').should('not.exist');
|
||||
}
|
||||
|
||||
export function verifyGuest(userStatus = 'Guest ') {
|
||||
export function verifyGuest(userStatus = 'Guest') {
|
||||
// * Verify if Guest User is displayed
|
||||
cy.findAllByTestId('userListRow').should('have.length', 1);
|
||||
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').and('have.text', userStatus);
|
||||
cy.get('#systemUsersTable-cell-0_usernameColumn').parent().should('have.length', 1);
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('be.visible').and('have.text', userStatus);
|
||||
}
|
||||
|
||||
@@ -55,18 +55,18 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
cy.reload();
|
||||
|
||||
// # Search for Guest User by username
|
||||
cy.get('#searchUsers', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(guestUser.username);
|
||||
cy.get('#input_searchTerm', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(guestUser.username).wait(TIMEOUTS.TWO_SEC);
|
||||
});
|
||||
|
||||
it('MM-18048 Deactivate Guest User and Verify', () => {
|
||||
// # Click on the Deactivate option
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Deactivate').click();
|
||||
|
||||
// * Verify the confirmation message displayed
|
||||
cy.get('#confirmModal').should('be.visible').within(() => {
|
||||
cy.get('#confirmModalLabel').should('be.visible').and('have.text', `Deactivate ${guestUser.username}`);
|
||||
cy.get('.modal-body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system. Are you sure you want to deactivate ${guestUser.username}?`);
|
||||
cy.get('.modal-body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system.\nAre you sure you want to deactivate ${guestUser.username}?`);
|
||||
});
|
||||
|
||||
// * Verify the behavior when Cancel button in the confirmation message is clicked
|
||||
@@ -75,21 +75,21 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
verifyGuest();
|
||||
|
||||
// * Verify the behavior when Deactivate button in the confirmation message is clicked
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Deactivate').click();
|
||||
cy.get('#confirmModalButton').click();
|
||||
cy.get('#confirmModal').should('not.exist');
|
||||
verifyGuest('Inactive ');
|
||||
verifyGuest('Deactivated');
|
||||
|
||||
// # Reload and verify if behavior is same
|
||||
cy.reload();
|
||||
cy.get('#searchUsers').should('be.visible').type(guestUser.username);
|
||||
verifyGuest('Inactive ');
|
||||
cy.get('#input_searchTerm').should('be.visible').type(guestUser.username);
|
||||
verifyGuest('Deactivated');
|
||||
});
|
||||
|
||||
it('MM-18048 Activate Guest User and Verify', () => {
|
||||
// # Click on the Activate option
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Activate').click();
|
||||
|
||||
// * Verify if User's status is activated again
|
||||
@@ -97,7 +97,7 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
|
||||
// # Reload and verify if behavior is same
|
||||
cy.reload();
|
||||
cy.get('#searchUsers').should('be.visible').type(guestUser.username);
|
||||
cy.get('#input_searchTerm').should('be.visible').type(guestUser.username);
|
||||
verifyGuest();
|
||||
});
|
||||
});
|
||||
|
||||
Ссылка в новой задаче
Block a user