* fix: e2e tests

* add more fix

* fixed_custom_categories

---------

Co-authored-by: Furqan Malik <furqan.malik@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Saturnino Abril
2023-04-05 06:50:49 +08:00
коммит произвёл GitHub
родитель 8afb6a6b39
Коммит f6cae9ab42
39 изменённых файлов: 107 добавлений и 111 удалений

Просмотреть файл

@@ -16,6 +16,9 @@ describe('Profile > Profile Settings > Position', () => {
cy.apiInitSetup({loginAfter: true}).then(({offTopicUrl}) => {
// # Visit off-topic channel
cy.visit(offTopicUrl);
// # Post message in the main channel
cy.postMessage('hello from master hacker');
});
});
@@ -23,20 +26,21 @@ describe('Profile > Profile Settings > Position', () => {
const position = 'Master hacker';
// # Open 'Profile' modal and view the default 'Profile Settings'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
// # Open 'Position' setting
cy.findByRole('heading', {name: 'Position'}).should('be.visible').click();
// # Enter new 'Position'
cy.findByRole('textbox', {name: 'Position'}).should('be.visible').type(position);
cy.findByRole('textbox', {name: 'Position'}).
should('be.visible').
and('be.focused').
type(position).
should('have.value', position);
// # Save and close the modal
cy.uiSaveAndClose();
});
// # Post message in the main channel
cy.postMessage('hello from master hacker');
// # Click on the profile image
cy.get('.profile-icon > img').as('profileIconForPopover').click();
@@ -48,7 +52,7 @@ describe('Profile > Profile Settings > Position', () => {
const longPosition = 'Master Hacker II'.repeat(8);
// # Open 'Profile' modal and view the default 'Profile Settings'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
const minPositionHeader = () => cy.findByRole('heading', {name: 'Position'});
const maxPositionInput = () => cy.findByRole('textbox', {name: 'Position'});

Просмотреть файл

@@ -53,7 +53,7 @@ describe('Profile > Profile Settings > Email', () => {
beforeEach(() => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
});
afterEach(() => {
@@ -174,7 +174,7 @@ describe('Profile > Profile Settings > Email', () => {
expect(subject).to.equal(`[${siteName}] Your email address has changed`);
});
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// * Verify new email address
cy.get('#emailDesc').should('be.visible').should('have.text', email);

Просмотреть файл

@@ -23,7 +23,7 @@ describe('Profile > Profile Settings > Full Name', () => {
it('MM-T2043 Enter first name', () => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Click "Edit" to the right of "Full Name"
cy.get('#nameEdit').should('be.visible').click();
@@ -46,7 +46,7 @@ describe('Profile > Profile Settings > Full Name', () => {
it('MM-T2042 Full Name starting blank stays blank', () => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Click "Edit" to the right of "Full Name"
cy.get('#nameEdit').should('be.visible').click();

Просмотреть файл

@@ -33,7 +33,7 @@ describe('Profile > Profile Settings> Full Name', () => {
it('MM-T2046 Full Name - Truncated in popover', () => {
// # Go to Profile -> Profile Settings -> Full Name -> Edit
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Open Full Name section
cy.get('#nameDesc').click();
@@ -50,7 +50,7 @@ describe('Profile > Profile Settings> Full Name', () => {
// * Full name field shows first and last name.
cy.contains('#nameDesc', `${firstName} ${lastName}`);
// # Close account settings modal
// # Close profile settings modal
cy.uiClose();
});

Просмотреть файл

@@ -20,7 +20,7 @@ describe('Account Settings', () => {
it('MM-T2045 Full Name - Link in help text', () => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// * Ensure that the Profile tab is loaded
cy.get('#generalSettingsTitle').should('be.visible').should('contain', 'Profile');

Просмотреть файл

@@ -27,7 +27,7 @@ describe('Settings > Sidebar > General', () => {
it('MM-T3848 No nickname is present', () => {
// # Open 'Profile' modal and view the default 'Profile'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
// # Open 'Nickname' setting
cy.uiGetHeading('Nickname').click();
@@ -56,7 +56,7 @@ describe('Settings > Sidebar > General', () => {
const newNickname = 'victor_nick';
// # Open 'Profile' modal and view the default 'Profile Settings'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
// # Open 'Nickname' setting
cy.uiGetHeading('Nickname').click();
@@ -133,7 +133,7 @@ describe('Settings > Sidebar > General', () => {
it('MM-T2061 Nickname should reset on cancel of edit', () => {
// # Open 'Profile' modal and view the default 'Profile Settings'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
// # Open 'Nickname' setting
cy.uiGetHeading('Nickname').click();
@@ -156,7 +156,7 @@ describe('Settings > Sidebar > General', () => {
it('MM-T2062 Clear nickname and save', () => {
// # Open 'Profile' modal and view the default 'Profile Settings'
cy.uiOpenProfileModal().within(() => {
cy.uiOpenProfileModal('Profile Settings').within(() => {
// # Open 'Nickname' setting
cy.uiGetHeading('Nickname').click();

Просмотреть файл

@@ -6,7 +6,7 @@
import * as TIMEOUTS from '../../../../fixtures/timeouts';
describe('Account Settings', () => {
describe('Profile Settings', () => {
beforeEach(() => {
cy.apiAdminLogin().apiInitSetup({loginAfter: true}).its('user').as('user');
});
@@ -21,7 +21,7 @@ describe('Account Settings', () => {
getProfilePictureId().as('idOld');
// # Open Profile > Profile Settings > Profile Picture > Edit
cy.uiOpenProfileModal().findByRole('button', {name: /picture edit/i}).click();
cy.uiOpenProfileModal('Profile Settings').findByRole('button', {name: /picture edit/i}).click();
// # Click the X to remove the old profile picture but do not click save
cy.findByRole('button', {name: /remove profile picture/i}).click();
@@ -74,7 +74,7 @@ function verifyProfilePictureDoesNotUpdateAfterCancel() {
});
// # Open Profile > Profile Settings > Profile Picture > Edit
cy.uiOpenProfileModal().findByRole('button', {name: /picture edit/i}).click();
cy.uiOpenProfileModal('Profile Settings').findByRole('button', {name: /picture edit/i}).click();
// # Select a new profile picture
cy.findByTestId('uploadPicture').attachFile('png-image-file.png');

Просмотреть файл

@@ -32,7 +32,7 @@ describe('Profile > Profile Settings > Profile Picture', () => {
and('not.include', customImageMatch);
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Click "Edit" to the right of "Profile Picture"
cy.get('#pictureEdit').should('be.visible').click();
@@ -51,7 +51,7 @@ describe('Profile > Profile Settings > Profile Picture', () => {
and('include', customImageMatch);
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Click "Edit" to the right of "Profile Picture"
cy.get('#pictureEdit').should('be.visible').click();
@@ -75,7 +75,7 @@ describe('Profile > Profile Settings > Profile Picture', () => {
it('MM-T2077 Profile picture: non image file shows error', () => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Click "Edit" to the right of "Profile Picture"
cy.get('#pictureEdit').should('be.visible').click();

Просмотреть файл

@@ -41,7 +41,7 @@ describe('Settings > Sidebar > General > Edit', () => {
beforeEach(() => {
// # Go to Profile
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
});
it('MM-T2050 Username cannot be blank', () => {
@@ -101,7 +101,7 @@ describe('Settings > Sidebar > General > Edit', () => {
// # Login the temporary user
cy.apiLogin(tempUser);
cy.visit(offTopicUrl);
cy.uiOpenProfileModal();
cy.uiOpenProfileModal('Profile Settings');
// # Step 1
// # Edit the username field
@@ -214,8 +214,8 @@ describe('Settings > Sidebar > General > Edit', () => {
cy.apiLogin(testUser);
cy.visit(offTopicUrl);
// # Open account settings modal
cy.uiOpenProfileModal();
// # Open profile settings modal
cy.uiOpenProfileModal('Profile Settings');
// # Open Full Name section
cy.get('#usernameDesc').click();