Chore(cypress): Review and Fix tests failing on master (#26954)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a1ed780a86
Коммит
03c930daa0
@@ -39,14 +39,8 @@ describe('Environment', () => {
|
||||
|
||||
// * Check that the 'Team Settings' modal was opened
|
||||
cy.get('#teamSettingsModal').should('exist').within(() => {
|
||||
// clicking on edit button
|
||||
cy.get('#team_iconEdit').should('be.visible').click();
|
||||
|
||||
// verify the settings picture button is visible to click
|
||||
cy.findByTestId('inputSettingPictureButton').should('be.visible').click();
|
||||
|
||||
// * Before uploading the picture the save button must be disabled
|
||||
cy.uiSaveButton().should('be.disabled');
|
||||
// # Verify upload icon button is visible
|
||||
cy.get('i[title="Edit Icon"]').should('be.visible');
|
||||
|
||||
// # Upload a file on center view
|
||||
cy.findByTestId('uploadPicture').attachFile(mattermostIcon);
|
||||
@@ -89,14 +83,8 @@ describe('Environment', () => {
|
||||
|
||||
// * Check that the 'Team Settings' modal was opened
|
||||
cy.get('#teamSettingsModal').should('exist').within(() => {
|
||||
// clicking on edit button
|
||||
cy.get('#team_iconEdit').should('be.visible').click();
|
||||
|
||||
// verify the settings picture button is visible to click
|
||||
cy.findByTestId('inputSettingPictureButton').should('be.visible').click();
|
||||
|
||||
// * Before uploading the picture the save button must be disabled
|
||||
cy.uiSaveButton().should('be.disabled');
|
||||
// # Verify upload icon button is visible
|
||||
cy.get('i[title="Edit Icon"]').should('be.visible');
|
||||
|
||||
// # Upload a file on center view
|
||||
cy.findByTestId('uploadPicture').attachFile(mattermostIcon);
|
||||
@@ -139,14 +127,8 @@ describe('Environment', () => {
|
||||
|
||||
// * Check that the 'Team Settings' modal was opened
|
||||
cy.get('#teamSettingsModal').should('exist').within(() => {
|
||||
// clicking on edit button
|
||||
cy.get('#team_iconEdit').should('be.visible').click();
|
||||
|
||||
// verify the settings picture button is visible to click
|
||||
cy.findByTestId('inputSettingPictureButton').should('be.visible').click();
|
||||
|
||||
// * Before uploading the picture the save button must be disabled
|
||||
cy.uiSaveButton().should('be.disabled');
|
||||
// # Verify upload icon button is visible
|
||||
cy.get('i[title="Edit Icon"]').should('be.visible');
|
||||
|
||||
// # Upload a file on center view
|
||||
cy.findByTestId('uploadPicture').attachFile(mattermostIcon);
|
||||
|
||||
@@ -23,8 +23,10 @@ describe('System Console', () => {
|
||||
// # Go to users management page
|
||||
cy.visit('/admin_console/user_management/users');
|
||||
|
||||
// # Select inactive users
|
||||
cy.get('#selectUserStatus').select('Inactive');
|
||||
// # Select Deactivated users
|
||||
cy.get('div.systemUsersFilterContainer button').click();
|
||||
cy.get('#DropdownInput_filterStatus').click();
|
||||
cy.get('#react-select-5-option-2').click();
|
||||
|
||||
cy.apiGetAnalytics().then(({analytics}) => {
|
||||
const inactiveUsers = analytics.filter((d) => {
|
||||
|
||||
@@ -19,11 +19,16 @@ describe('Main menu', () => {
|
||||
});
|
||||
|
||||
const verifyLink = (text, link) => {
|
||||
cy.get('li.MenuItem').
|
||||
contains(text).
|
||||
scrollIntoView().
|
||||
|
||||
// * Verify link opens in new tab
|
||||
cy.get('a[href="' + link + '"]').scrollIntoView().should('have.attr', 'target', '_blank');
|
||||
should('have.attr', 'target', '_blank').
|
||||
|
||||
// * Verify link text matches correct href value
|
||||
cy.get('a[href="' + link + '"]').contains(text);
|
||||
should('have.attr', 'href').
|
||||
and('contain', link);
|
||||
};
|
||||
|
||||
it('MM-T909 Can switch to team', () => {
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('System Console > Team Statistics', () => {
|
||||
cy.get('.grid-statistics__card').should('have.length', 4);
|
||||
|
||||
// * Check that the title content for the stats is as expected.
|
||||
cy.get('.admin-console__content').eq(0).find('.title').eq(0).should('contain', 'Total Active Users');
|
||||
cy.get('.admin-console__content').eq(0).find('.title').eq(0).should('contain', 'Total Activated Users');
|
||||
cy.get('.admin-console__content').eq(0).find('.title').eq(1).should('contain', 'Public Channels');
|
||||
cy.get('.admin-console__content').eq(0).find('.title').eq(2).should('contain', 'Private Channels');
|
||||
cy.get('.admin-console__content').eq(0).find('.title').eq(3).should('contain', 'Total Posts');
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('Announcement Banner', () => {
|
||||
cy.findByTestId('AnnouncementSettings.EnableBanner').
|
||||
should('be.visible').
|
||||
within(() => {
|
||||
cy.findByText('true').
|
||||
cy.findByTestId('AnnouncementSettings.EnableBannertrue').
|
||||
should('be.visible').
|
||||
click({force: true});
|
||||
});
|
||||
@@ -75,7 +75,7 @@ describe('Announcement Banner', () => {
|
||||
cy.findByTestId('AnnouncementSettings.AllowBannerDismissal').
|
||||
should('be.visible').
|
||||
within(() => {
|
||||
cy.findByText('true').
|
||||
cy.findByTestId('AnnouncementSettings.AllowBannerDismissaltrue').
|
||||
should('be.visible').
|
||||
click({force: true});
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
// Group: @channels @system_console
|
||||
|
||||
import * as TIMEOUTS from '../../../../fixtures/timeouts';
|
||||
import {getRandomId} from '../../../../utils';
|
||||
|
||||
describe('Customization', () => {
|
||||
beforeEach(() => {
|
||||
@@ -46,8 +47,8 @@ describe('Customization', () => {
|
||||
cy.url().should('include', '/login');
|
||||
|
||||
// * Ensure Site Name and Description are shown the updated values in the login screen
|
||||
cy.findByRole('link', {name: siteName}).should('be.visible');
|
||||
cy.get('.login-body-card-title').should('have.text', siteDescription);
|
||||
cy.get('div.header-main a').should('be.visible').should('have.text', siteName);
|
||||
cy.get('p.login-body-card-title').should('have.text', siteDescription);
|
||||
});
|
||||
|
||||
it('MM-T1025 - Site Name - Product Menu ➜ About and About Modal show custom name', () => {
|
||||
@@ -156,6 +157,8 @@ describe('Customization', () => {
|
||||
});
|
||||
|
||||
it('MM-T1029 - Custom branding text can render markdown text', () => {
|
||||
const emojiText = getRandomId(3);
|
||||
|
||||
// # Visit emoji system console page
|
||||
cy.visit('/admin_console/site_config/emoji');
|
||||
cy.get('.admin-console__header').should('be.visible').and('have.text', 'Emoji');
|
||||
@@ -173,7 +176,7 @@ describe('Customization', () => {
|
||||
// * Ensure the form is visible
|
||||
cy.get('.backstage-form').should('be.visible').within(() => {
|
||||
// # Fill the emoji data
|
||||
cy.get('input#name').clear().type('yay');
|
||||
cy.get('input#name').clear().type(emojiText);
|
||||
cy.get('input#select-emoji').attachFile('mattermost-icon.png');
|
||||
|
||||
// # Save emoji
|
||||
@@ -189,7 +192,7 @@ describe('Customization', () => {
|
||||
cy.get('.admin-console__header').should('be.visible').and('have.text', 'Customization');
|
||||
|
||||
// eslint-disable-next-line no-irregular-whitespace
|
||||
const customBrandText = `:yay:
|
||||
const customBrandText = `:${emojiText}:
|
||||
:smile:
|
||||
|
||||
- This is a bullet point
|
||||
@@ -214,12 +217,8 @@ describe('Customization', () => {
|
||||
cy.url().should('include', '/login');
|
||||
|
||||
cy.get('.login-body-custom-branding-markdown').first().scrollIntoView().should('be.visible').within(() => {
|
||||
// * Ensure custom emoji has been rendered
|
||||
// ToDo: uncomment after fixing MM-12657
|
||||
//cy.get('span.emoticon').should('have.attr', 'title', ':yay:');
|
||||
|
||||
// * Ensure default emoji has been rendered
|
||||
cy.get('span.emoticon').should('have.attr', 'title', ':smile:');
|
||||
cy.get('span.emoticon').should('have.attr', 'alt', ':smile:');
|
||||
|
||||
// * Ensure the list and two bullets have been rendered
|
||||
cy.get('ul.markdown__list').should('be.visible').within(() => {
|
||||
@@ -306,7 +305,7 @@ describe('Customization', () => {
|
||||
cy.url().should('include', '/login');
|
||||
|
||||
// * Ensure that the custom Site Name is shown
|
||||
cy.findByRole('link', {name: siteName}).should('be.visible');
|
||||
cy.get('div.header-main a').should('be.visible').should('have.text', siteName);
|
||||
|
||||
// # Log back in as an administrator
|
||||
cy.apiAdminLogin();
|
||||
|
||||
@@ -28,14 +28,15 @@ describe('SupportSettings', () => {
|
||||
// * Verify links changed
|
||||
[
|
||||
{text: 'Ask the community', link: SupportSettings.ASK_COMMUNITY_LINK},
|
||||
{text: 'Help resources', link: SupportSettings.HELP_LINK},
|
||||
{text: 'Mattermost user guide', link: SupportSettings.MATTERMOST_USER_GUIDE},
|
||||
{text: 'Report a problem', link: SupportSettings.REPORT_A_PROBLEM_LINK},
|
||||
{text: 'Keyboard shortcuts'},
|
||||
].forEach(({text, link}) => {
|
||||
if (link) {
|
||||
cy.findByText(text).
|
||||
parent().
|
||||
should('have.attr', 'href', link);
|
||||
should('have.attr', 'href').
|
||||
and('contain', link);
|
||||
} else {
|
||||
cy.findByText(text);
|
||||
}
|
||||
@@ -58,7 +59,8 @@ describe('SupportSettings', () => {
|
||||
// * Verify that links are correct at login page
|
||||
guides.forEach((guide) => {
|
||||
cy.findByText(guide.text).
|
||||
should('have.attr', 'href', guide.link);
|
||||
should('have.attr', 'href').
|
||||
and('contain', guide.link);
|
||||
});
|
||||
|
||||
// # Visit signup page
|
||||
@@ -68,7 +70,8 @@ describe('SupportSettings', () => {
|
||||
// * Verify that links are correct at signup page
|
||||
guides.forEach((guide) => {
|
||||
cy.findByText(guide.text).
|
||||
should('have.attr', 'href', guide.link);
|
||||
should('have.attr', 'href').
|
||||
and('contain', guide.link);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,31 +35,28 @@ describe('System Console > User Management > Deactivation', () => {
|
||||
cy.findByPlaceholderText('Search users').should('be.visible').clear().type(testUser.email).wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// * Verify that user is listed
|
||||
cy.findByText(`@${testUser.username}`).should('be.visible');
|
||||
cy.findByText(`${testUser.username}`).should('be.visible');
|
||||
|
||||
// # Scan on the first item's row in the list
|
||||
cy.findByTestId('userListRow').should('be.visible').within(() => {
|
||||
// * Verify before deactivation email is visible
|
||||
cy.findByText(testUser.email).should('be.visible');
|
||||
// * Verify before deactivation email is visible
|
||||
cy.get('#systemUsersTable-cell-0_emailColumn').should('be.visible').should('have.text', testUser.email);
|
||||
|
||||
// # Open the actions menu.
|
||||
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
|
||||
// # Open the actions menu.
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('have.text', 'Member').click().wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// # Click on deactivate menu button
|
||||
cy.findByLabelText('User Actions Menu').findByText('Deactivate').click();
|
||||
});
|
||||
// # Click on deactivate menu button
|
||||
cy.get('#actionMenuItem-systemUsersTable-0-deactivate').should('have.text', 'Deactivate').click();
|
||||
|
||||
// # Click confirm deactivate in the modal
|
||||
cy.get('.a11y__modal').should('exist').and('be.visible').within(() => {
|
||||
cy.findByText('Deactivate').should('be.visible').click();
|
||||
});
|
||||
|
||||
cy.findByTestId('userListRow').should('be.visible').within(() => {
|
||||
// * Verify that the user is now inactive
|
||||
cy.findByText('Inactive').should('be.visible');
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('have.text', 'Deactivated').should('be.visible');
|
||||
|
||||
// * Verify once again if email is visible
|
||||
cy.findByText(testUser.email).should('be.visible');
|
||||
});
|
||||
// * Verify once again if email is visible
|
||||
cy.findByText(testUser.email).should('be.visible');
|
||||
|
||||
// * Verify once again if email is visible
|
||||
cy.get('#systemUsersTable-cell-0_emailColumn').should('be.visible').should('have.text', testUser.email);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -155,21 +155,17 @@ describe('User Management', () => {
|
||||
cy.visit('/admin_console/user_management/users');
|
||||
|
||||
// # Search for the user.
|
||||
cy.get('#searchUsers').clear().type(user.email, {delay: TIMEOUTS.ONE_HUNDRED_MILLIS}).wait(TIMEOUTS.HALF_SEC);
|
||||
cy.get('#input_searchTerm').clear().type(user.email, {delay: TIMEOUTS.ONE_HUNDRED_MILLIS}).wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
cy.findByTestId('userListRow').within(() => {
|
||||
if (activate) {
|
||||
cy.findByText('Inactive').click().wait(TIMEOUTS.HALF_SEC);
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click().wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// # Click on the "Activate" button.
|
||||
cy.findByLabelText('User Actions Menu').findByText('Activate').click();
|
||||
} else {
|
||||
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// # Click on the "Deactivate" button.
|
||||
cy.findByLabelText('User Actions Menu').findByText('Deactivate').click();
|
||||
}
|
||||
});
|
||||
if (activate) {
|
||||
// # Click on the "Activate" button.
|
||||
cy.get('#actionMenuItem-systemUsersTable-0-active').click().wait(TIMEOUTS.HALF_SEC);
|
||||
} else {
|
||||
// # Click on the "Deactivate" button.
|
||||
cy.get('#actionMenuItem-systemUsersTable-0-deactivate').click().wait(TIMEOUTS.HALF_SEC);
|
||||
}
|
||||
|
||||
if (!activate) {
|
||||
// # Verify the modal opened and then confirm.
|
||||
|
||||
@@ -187,7 +187,7 @@ describe('User Management', () => {
|
||||
cy.get('#input_searchTerm').clear().type(gitlabUser.email).wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// # Open actions menu.
|
||||
cy.get('#systemUsersTable-cell-0_actionsColumn').click();
|
||||
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
// * Verify Switch to Email/Password is visible.
|
||||
cy.findByText('Switch to Email/Password').should('be.visible').click().wait(TIMEOUTS.HALF_SEC);
|
||||
|
||||
Ссылка в новой задаче
Block a user