From b784074212d96124ece489d099634c92d17286f7 Mon Sep 17 00:00:00 2001 From: yasser khan Date: Wed, 18 Jun 2025 17:22:57 +0530 Subject: [PATCH] Fix Flaky test failing on prod and in master branch (#31407) --- .../archived_channel/archive_channel_operations_spec.ts | 2 +- .../integration/channels/enterprise/ldap/ldap_guest_spec.ts | 2 ++ .../keyboard_shortcuts/ctrl_cmd_k_open_gm_with_mouse_spec.js | 2 ++ .../notifications/message_posted_while_scrolled_up_spec.js | 2 +- e2e-tests/playwright/lib/src/ui/pages/threads.ts | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/archived_channel/archive_channel_operations_spec.ts b/e2e-tests/cypress/tests/integration/channels/archived_channel/archive_channel_operations_spec.ts index b950a7e3b8..99a84df649 100644 --- a/e2e-tests/cypress/tests/integration/channels/archived_channel/archive_channel_operations_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/archived_channel/archive_channel_operations_spec.ts @@ -40,7 +40,7 @@ describe('Leave an archived channel', () => { }); }); - it.skip('MM-T1704 Archived channels appear in channel switcher after refresh', () => { + it('MM-T1704 Archived channels appear in channel switcher after refresh', () => { // # Archive the channel cy.apiLogin(testUser); cy.uiArchiveChannel(); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/ldap/ldap_guest_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/ldap/ldap_guest_spec.ts index 703bc2d380..f74cc7fefe 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/ldap/ldap_guest_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/ldap/ldap_guest_spec.ts @@ -209,6 +209,7 @@ describe('LDAP guest', () => { // # Save settings cy.get('#saveSetting').should('be.enabled').click(); + cy.get('#genericModalLabel > span').should('be.visible').and('have.text', 'Save and remove 1 user?'); // # Accept confirmation modal cy.get('#confirmModalButton').should('be.visible').click(); @@ -227,6 +228,7 @@ describe('LDAP guest', () => { cy.uiOpenTeamMenu('Invite people'); cy.wait(TIMEOUTS.TWO_SEC); + cy.get('#invitation_modal_title').should('be.visible'); // # Option to invite guest should not be visible cy.findByTestId('inviteGuestLink').should('not.exist'); diff --git a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_k_open_gm_with_mouse_spec.js b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_k_open_gm_with_mouse_spec.js index 22622a9aaf..107229987c 100644 --- a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_k_open_gm_with_mouse_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/ctrl_cmd_k_open_gm_with_mouse_spec.js @@ -44,6 +44,8 @@ describe('Keyboard Shortcuts', () => { // # Press Cmd/Ctrl-K to open "Switch Channels" modal cy.uiGetPostTextBox().cmdOrCtrlShortcut('K'); + cy.waitUntil(() => cy.findAllByTestId('suggestionList').should('be.visible')); + // # Click on the GM link to go to channel cy.get('.status--group').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/notifications/message_posted_while_scrolled_up_spec.js b/e2e-tests/cypress/tests/integration/channels/notifications/message_posted_while_scrolled_up_spec.js index ce79b3d43c..55528de1d1 100644 --- a/e2e-tests/cypress/tests/integration/channels/notifications/message_posted_while_scrolled_up_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/notifications/message_posted_while_scrolled_up_spec.js @@ -28,7 +28,7 @@ describe('Notifications', () => { }); }); - it.skip('MM-T562 New message bar - Message posted while scrolled up in same channel', () => { + it('MM-T562 New message bar - Message posted while scrolled up in same channel', () => { // # Post 30 random messages from the 'otherUser' account in off-topic Cypress._.times(numberOfPosts, (num) => { cy.postMessageAs({sender: otherUser, message: `${num} ${getRandomId()}`, channelId: offTopicChannelId}); diff --git a/e2e-tests/playwright/lib/src/ui/pages/threads.ts b/e2e-tests/playwright/lib/src/ui/pages/threads.ts index 5736ea4728..9b0d8a31e1 100644 --- a/e2e-tests/playwright/lib/src/ui/pages/threads.ts +++ b/e2e-tests/playwright/lib/src/ui/pages/threads.ts @@ -35,6 +35,7 @@ export default class ThreadsPage { } async toNotHaveThreadSelected() { + await this.noThreadSelected.waitFor({state: 'visible'}); await expect(this.noThreadSelected).toBeVisible(); }