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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ describe('Archived channels', () => {
|
||||
cy.visit(`/admin_console/user_management/channels/${testChannel.id}`);
|
||||
|
||||
// * Verify the Unarchive Channel button is visible
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.ONE_MIN}).findByText('Unarchive Channel').should('be.visible');
|
||||
cy.get('button.btn-secondary', {timeout: TIMEOUTS.TWO_SEC}).should('have.text', 'Unarchive Channel').should('be.visible').should('be.enabled');
|
||||
|
||||
// * Verify that only one widget is visible
|
||||
cy.get('div.AdminPanel').should('be.visible').and('have.length', 1);
|
||||
@@ -72,10 +72,10 @@ describe('Archived channels', () => {
|
||||
cy.visit(`/admin_console/user_management/channels/${testChannel.id}`);
|
||||
|
||||
// # Click Unarchive Channel button
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.ONE_MIN}).findAllByText('Unarchive Channel').click();
|
||||
cy.get('button.btn-secondary', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Unarchive Channel').click();
|
||||
|
||||
// * Verify the Archive Channel button is visible
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Archive Channel').should('be.visible');
|
||||
cy.get('button.btn-secondary.btn-danger', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Archive Channel').should('be.visible');
|
||||
|
||||
// * Verify that the other widget appears
|
||||
cy.get('div.AdminPanel').should('be.visible').should('have.length', 5);
|
||||
|
||||
@@ -148,7 +148,7 @@ describe('Compliance Export', () => {
|
||||
cy.findByTestId('enableComplianceExportfalse').click();
|
||||
|
||||
// * Verify that exported button is disabled
|
||||
cy.findByRole('button', {name: /run compliance export job now/i}).should('be.enabled');
|
||||
cy.findByRole('button', {name: /run compliance export job now/i}).should('be.not.enabled');
|
||||
});
|
||||
|
||||
it('MM-T1167 - Compliance Export job can be canceled', () => {
|
||||
|
||||
@@ -78,7 +78,7 @@ describe('System Console > Site Statistics', () => {
|
||||
cy.get('.admin-console__content .row').should('have.length', 4);
|
||||
|
||||
// * Check that the title content for the stats is as expected.
|
||||
cy.findByTestId('totalActiveUsersTitle').should('contain', 'Total Active Users');
|
||||
cy.findByTestId('totalActiveUsersTitle').should('have.text', 'Total Activated Users');
|
||||
|
||||
// cy.findByTestId('seatPurchasedTitle').should('contain', 'Total paid users');
|
||||
cy.findByTestId('totalTeamsTitle').should('contain', 'Total Teams');
|
||||
|
||||
Ссылка в новой задаче
Block a user