From 4db05125803b6a02dffdf6bb4f510e2acf90b7cc Mon Sep 17 00:00:00 2001 From: Rohitesh Gupta <1429138+srkgupta@users.noreply.github.com> Date: Fri, 5 May 2023 17:15:54 +0530 Subject: [PATCH] MM-52428: Fix few E2E integration tests (#23311) * Fixed E2E Integration tests * Fixed step to close emoji picker --- .../tests/integration/channels/bot_accounts/tags_spec.js | 5 +++-- .../incoming_webhook/edit_incoming_webhook_spec.js | 6 ++++++ .../ctrl_cmd_shift_slash/react_to_center_spec.js | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/bot_accounts/tags_spec.js b/e2e-tests/cypress/tests/integration/channels/bot_accounts/tags_spec.js index efc7b5d2d4..691f359e28 100644 --- a/e2e-tests/cypress/tests/integration/channels/bot_accounts/tags_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/bot_accounts/tags_spec.js @@ -11,6 +11,7 @@ // Group: @channels @bot_accounts import {createBotPatch} from '../../../support/api/bots'; +import * as TIMEOUTS from '../../../fixtures/timeouts'; describe('Bot tags', () => { let me; @@ -48,8 +49,8 @@ describe('Bot tags', () => { await client.pinPost(postId); cy.visit(`/${team.name}/channels/${channel.name}`); - cy.clickPostDotMenu(postId); - cy.get(`#CENTER_flagIcon_${postId}`).click(); + cy.get(`#post_${postId}`).trigger('mouseover', {force: true}); + cy.wait(TIMEOUTS.HALF_SEC).get(`#CENTER_flagIcon_${postId}`).click(); }); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/edit_incoming_webhook_spec.js b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/edit_incoming_webhook_spec.js index 0da9132a9c..3e75213606 100644 --- a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/edit_incoming_webhook_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/edit_incoming_webhook_spec.js @@ -69,6 +69,12 @@ describe('Incoming webhook', () => { cy.getLastPost().within(() => { cy.findByRole('link', {name: 'Testing Integration Attachments', hidden: true}); + }); + + // # Scroll to the bottom of the posts + cy.get('.post-list__dynamic').scrollTo('bottom'); + + cy.getLastPost().within(() => { cy.get('.attachment__image').should('be.visible'); cy.get(':nth-child(2) > thead > tr > .attachment-field__caption').should('have.text', 'Area'); cy.get(':nth-child(3) > thead > tr > :nth-child(1)').should('have.text', 'Iteration'); diff --git a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_shift_slash/react_to_center_spec.js b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_shift_slash/react_to_center_spec.js index c75dd0200b..4c16ed5ef4 100644 --- a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_shift_slash/react_to_center_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_shift_slash/react_to_center_spec.js @@ -191,7 +191,9 @@ describe('Keyboard shortcut CTRL/CMD+Shift+\\ for adding reaction to last messag Cypress._.times(3, () => { doReactToLastMessageShortcut('CENTER'); cy.get('#emojiPicker').should('exist'); - cy.get('body').click(); + + // # Click anywhere to close emoji picker + cy.get('#channelHeaderInfo').click(); cy.get('#emojiPicker').should('not.exist'); });