fix: e2e tests (#22807)
* 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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8afb6a6b39
Коммит
f6cae9ab42
@@ -21,17 +21,16 @@ describe('Account Settings', () => {
|
||||
offTopic = offTopicUrl;
|
||||
testUser = user;
|
||||
testTeam = team;
|
||||
|
||||
cy.postMessage('hello');
|
||||
});
|
||||
});
|
||||
|
||||
it('MM-T2049 Account Settings link in own popover', () => {
|
||||
// # Click avatar to open profile popover
|
||||
cy.get('div.status-wrapper').should('be.visible').click();
|
||||
cy.uiOpenProfileModal('Profile Settings');
|
||||
|
||||
// # Click account settings link
|
||||
cy.get('#accountSettings').should('be.visible').click();
|
||||
|
||||
// # Check if account settings modal is open
|
||||
// # Check if profile settings modal is open
|
||||
cy.get('#accountSettingsModal').should('be.visible');
|
||||
|
||||
cy.uiClose();
|
||||
@@ -62,33 +61,22 @@ describe('Account Settings', () => {
|
||||
|
||||
it('MM-T2074 New email not visible to other users until it has been confirmed', () => {
|
||||
// # Login as admin
|
||||
cy.apiLogout();
|
||||
cy.apiAdminLogin();
|
||||
|
||||
// * Set require email verification to true
|
||||
cy.visit('/admin_console/authentication/email');
|
||||
cy.get('[id="EmailSettings.EnableSignInWithEmailtrue"]').should('be.visible').click();
|
||||
cy.get('#saveSetting').invoke('attr', 'disabled').
|
||||
then((disabled) => {
|
||||
disabled ? '' : cy.uiSave();
|
||||
});
|
||||
cy.visit(offTopic);
|
||||
|
||||
// # Create user
|
||||
cy.apiCreateUser({prefix: 'test'}).then(({user: newUser}) => {
|
||||
// # Add user to team
|
||||
cy.apiAddUserToTeam(testTeam.id, newUser.id).then(() => {
|
||||
// # Create DM channel
|
||||
cy.apiCreateDirectChannel([testUser.id, newUser.id]).then(({channel}) => {
|
||||
// # Login to first user
|
||||
cy.uiLogout();
|
||||
cy.uiLogin(testUser);
|
||||
cy.apiLogin(testUser);
|
||||
cy.visit(offTopic);
|
||||
cy.postMessage('hello');
|
||||
|
||||
// * Update email
|
||||
const oldEMail = testUser.email;
|
||||
const newEMail = 'test@example.com';
|
||||
cy.uiOpenProfileModal();
|
||||
cy.uiOpenProfileModal('Profile Settings');
|
||||
cy.get('#emailEdit').should('be.visible').click();
|
||||
cy.get('#primaryEmail').should('be.visible').type(newEMail);
|
||||
cy.get('#confirmEmail').should('be.visible').type(newEMail);
|
||||
@@ -99,8 +87,7 @@ describe('Account Settings', () => {
|
||||
cy.postMessageAs({sender: testUser, message: `@${newUser.username}`, channelId: channel.id});
|
||||
|
||||
// # Login to 2nd user
|
||||
cy.uiLogout();
|
||||
cy.uiLogin(newUser);
|
||||
cy.apiLogin(newUser);
|
||||
|
||||
// * Check if email updated
|
||||
cy.visit(`/${testTeam.name}/messages/@${testUser.username}`);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Ссылка в новой задаче
Block a user