From 3e84d20dbe9332a9eb51c2feab6aba5dfe4ae6db Mon Sep 17 00:00:00 2001 From: yasserfaraazkhan Date: Tue, 24 Sep 2024 19:07:17 +0530 Subject: [PATCH] E2E: Add delay to slow down cypress and depict end user's speed. (#28113) --- .../accessibility/accessibility_modals_dialogs_spec.js | 1 + .../channels/messaging/emoji_to_markdown_spec.js | 8 ++++---- .../cypress/tests/integration/channels/scroll/helpers.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.js index 829681c5090..39bf1147de8 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.js @@ -153,6 +153,7 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => { cy.findAllByRole('dialog').eq(0).within(() => { const modalName = `Add people to ${testChannel.display_name}`; cy.findByRole('heading', {name: modalName}); + cy.wait(TIMEOUTS.ONE_SEC); // * Verify the accessibility support in search input cy.findByRole('textbox', {name: 'Search for people or groups'}). diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/emoji_to_markdown_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/emoji_to_markdown_spec.js index 4fd73e526c4..d0348cf521d 100644 --- a/e2e-tests/cypress/tests/integration/channels/messaging/emoji_to_markdown_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/messaging/emoji_to_markdown_spec.js @@ -66,11 +66,11 @@ function createAndVerifyMessage(message, isCode) { }); } else { aliases.forEach((alias) => { + const emoticonText = message.trim() === ':D' ? ':smile:' : ':taco:'; cy.get('@' + alias). - children().should('have.class', 'all-emoji'). - children().find('span').last().should('have.class', 'emoticon'). - and('have.attr', 'alt', message.trim() === ':D' ? ':smile:' : ':taco:'). - and('have.text', message.trim() === ':D' ? ':smile:' : ':taco:'); + find(`span[data-testid="postEmoji.${emoticonText}"]`). + and('have.attr', 'alt', emoticonText). + and('have.text', message.trim()); }); } } diff --git a/e2e-tests/cypress/tests/integration/channels/scroll/helpers.js b/e2e-tests/cypress/tests/integration/channels/scroll/helpers.js index 36d5a5bfa77..4ffb047c0db 100644 --- a/e2e-tests/cypress/tests/integration/channels/scroll/helpers.js +++ b/e2e-tests/cypress/tests/integration/channels/scroll/helpers.js @@ -7,6 +7,7 @@ import * as TIMEOUTS from '../../../fixtures/timeouts'; export function postListOfMessages({sender, channelId, numberOfMessages = 30}) { Cypress._.times(numberOfMessages, (postIndex) => { cy.postMessageAs({sender, message: `Other users p-${postIndex}`, channelId}); + cy.wait(TIMEOUTS.ONE_SEC); }); }