Chore(cypress): Review and Fix tests failing on master (#26954)

Этот коммит содержится в:
yasserfaraazkhan
2024-05-06 15:48:19 +05:30
коммит произвёл GitHub
родитель a1ed780a86
Коммит 03c930daa0
42 изменённых файлов: 120 добавлений и 134 удалений

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

@@ -57,7 +57,7 @@ describe('Messaging', () => {
cy.get('.channel-intro__text').
should('be.visible').
and('contain', `This is the start of your direct message history with ${secondUser.username}.`).
and('contain', 'Direct messages and files shared here are not shown to people outside this area.');
and('contain', 'Messages and files shared here are not shown to anyone else.');
});
// # Verify that the focus is on the message box

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

@@ -15,7 +15,7 @@ function emojiVerification(postId) {
const postMessageTextId = `#postMessageText_${postId}`;
// * Check for the emoji attr of :) is exists
cy.get(`${postMessageTextId} p span span.emoticon`).should('have.attr', 'title', ':slightly_smiling_face:');
cy.get(`${postMessageTextId} p span span.emoticon`).should('have.attr', 'alt', ':slightly_smiling_face:');
// * Check for the punctuation('=') is exists without space
cy.get(`${postMessageTextId} p`).should('same.text', ':slightly_smiling_face:=');

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

@@ -36,6 +36,6 @@ describe('Messaging', () => {
cy.uiGetPostTextBox().type('{enter}');
// * The emoji should be displayed in the post at the position inserted.
cy.getLastPost().find('p').should('have.html', `Hello <span data-emoticon="grinning"><span alt=":grinning:" class="emoticon" title=":grinning:" style="background-image: url(&quot;${Cypress.config('baseUrl')}/static/emoji/1f600.png&quot;);">:grinning:</span></span> World!`);
cy.getLastPost().find('p').should('have.html', `Hello <span data-emoticon="grinning"><span alt=":grinning:" class="emoticon" data-testid="postEmoji.:grinning:" style="background-image: url(&quot;${Cypress.config('baseUrl')}/static/emoji/1f600.png&quot;);">:grinning:</span></span> World!`);
});
});

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

@@ -99,7 +99,7 @@ describe('MM-T154 Use keyboard navigation in emoji picker', () => {
cy.uiGetPostTextBox().type('{enter}');
// * Compare selected emoji with last post
cy.getLastPost().find('.emoticon').should('have.attr', 'title', selectedEmoji);
cy.getLastPost().find('.emoticon').should('have.attr', 'alt', selectedEmoji);
});
});
});

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

@@ -42,13 +42,15 @@ describe('Messaging', () => {
cy.postMessage(gesture + skinTone);
// * Check if gesture with skin tone is visible
cy.findByTitle(gesture + skinTone).should('be.visible');
cy.getLastPost().within(() => {
cy.get('span[data-emoticon] span').should('be.visible').should('have.attr', 'alt', gesture + skinTone);
});
// # Set viewport to mobile
cy.viewport('iphone-se2');
// * Check if gesture with skin tone is visible
cy.findByTitle(gesture + skinTone).should('be.visible');
cy.get('span[data-emoticon] span').should('be.visible');
});
});
});

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

@@ -69,7 +69,8 @@ function createAndVerifyMessage(message, isCode) {
cy.get('@' + alias).
children().should('have.class', 'all-emoji').
children().find('span').last().should('have.class', 'emoticon').
and('have.attr', 'title', message.trim() === ':D' ? ':smile:' : ':taco:');
and('have.attr', 'alt', message.trim() === ':D' ? ':smile:' : ':taco:').
and('have.text', message.trim() === ':D' ? ':smile:' : ':taco:');
});
}
}

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

@@ -157,7 +157,7 @@ function verifyFocusInAddChannelMemberModal() {
cy.get('#selectItems input').should('have.value', 'A');
// # Click anywhere in the modal that is not on a field that can take focus
cy.get('.channel-invite__header').click();
cy.get('#deletePostModalLabel > span').click();
// * Note the focus has been removed from the search box
cy.get('#selectItems input').should('not.be.focused');

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

@@ -43,7 +43,7 @@ describe('Messaging', () => {
function verifyPostedMessage(postId, text) {
cy.get(`#postMessageText_${postId}`).should('be.visible').within((el) => {
cy.wrap(el).should('have.text', text);
cy.get('.emoticon').should('be.visible').and('have.attr', 'title', ':confused:');
cy.get('.emoticon').should('be.visible').and('have.attr', 'alt', ':confused:').and('have.text', ':confused:');
});
}
});

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

@@ -79,7 +79,7 @@ describe('Emoji reactions to posts/messages in GM channels', () => {
cy.viewport('iphone-6');
// * Verify that the Add Reaction button is once again visible
cy.findByLabelText('Add a reaction').should('be.visible');
cy.findByLabelText('Add a reaction').scrollIntoView().should('be.visible');
});
});
});

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

@@ -72,7 +72,7 @@ describe('Messaging', () => {
cy.wait(TIMEOUTS.FIVE_SEC).url().should('include', `/${testTeam.name}/channels/${testPrivateChannel.name}`).and('not.include', `/${permalinkPostId}`);
// * Check if the matching channel intro title is visible
cy.get('#channelIntro').contains('.channel-intro__title', `Beginning of ${testPrivateChannel.display_name}`).scrollIntoView().should('be.visible');
cy.get('#channelIntro').contains('p.channel-intro__text', `This is the start of ${testPrivateChannel.display_name}`).scrollIntoView().should('be.visible');
});
// # Get last post id from open channel

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

@@ -114,7 +114,8 @@ describe('Messaging', () => {
it('MM-T2195 Emoji reaction - not available on system message Save - not available on system message Pin - not available on system message Can delete your own system message', () => {
// # Click add a channel header
cy.findByRoleExtended('button', {name: 'Add a channel header'}).should('be.visible').click();
cy.get('button.header-placeholder').invoke('show').trigger('mouseover');
cy.findByRoleExtended('button', {name: 'Add a channel header'}).trigger('mouseover').should('be.visible').click();
// # Add or update a channel header
cy.get('#editChannelHeaderModalLabel').should('be.visible');