From 3cb163deee6c306b52ce0bb6d96d4151a1aa8e6e Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Wed, 14 Jan 2026 19:37:53 +0100 Subject: [PATCH] frontend: Improve E2EE UI tests by enhancing panel close interactions and timeout handling --- .../webcomponent/tests/e2e/e2ee-ui.test.ts | 17 ++++++++++++----- .../tests/helpers/function-helpers.ts | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/meet-ce/frontend/webcomponent/tests/e2e/e2ee-ui.test.ts b/meet-ce/frontend/webcomponent/tests/e2e/e2ee-ui.test.ts index 30d9f8ec..b302fa2e 100644 --- a/meet-ce/frontend/webcomponent/tests/e2e/e2ee-ui.test.ts +++ b/meet-ce/frontend/webcomponent/tests/e2e/e2ee-ui.test.ts @@ -491,17 +491,24 @@ test.describe('E2EE UI Tests', () => { expect(ownName2).toBe(participant2Name); expect(ownName2).not.toContain('*'); - // Close settings panel + // Close settings panel - click the close button await Promise.all([ interactWithElementInIframe(page, '.panel-close-button', { action: 'click' }), interactWithElementInIframe(page2, '.panel-close-button', { action: 'click' }) ]); - await Promise.all([ - waitForElementInIframe(page, 'ov-settings-panel', { state: 'hidden' }), - waitForElementInIframe(page2, 'ov-settings-panel', { state: 'hidden' }) - ]); + + // Wait a moment for the close action to initiate + await page.waitForTimeout(200); + + // Close the more options menu first (this can interfere with panel closing) await Promise.all([closeMoreOptionsMenu(page), closeMoreOptionsMenu(page2)]); + // Now wait for the settings panel to be fully hidden + await Promise.all([ + waitForElementInIframe(page, 'ov-settings-panel', { state: 'hidden', timeout: 10000 }), + waitForElementInIframe(page2, 'ov-settings-panel', { state: 'hidden', timeout: 10000 }) + ]); + // ===== CHECK CHAT MESSAGES ===== // Open chat await Promise.all([ diff --git a/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts b/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts index ed33764c..c082e2ba 100644 --- a/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts +++ b/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts @@ -468,12 +468,23 @@ export const openMoreOptionsMenu = async (page: Page) => { await waitForElementInIframe(page, '#toolbar', { state: 'visible' }); // Open more options menu await interactWithElementInIframe(page, '#more-options-btn', { action: 'click' }); - await page.waitForTimeout(500); // Wait for menu animation + await waitForElementInIframe(page, '#more-options-menu', { state: 'visible', timeout: 5000 }); + await page.waitForTimeout(300); // Wait for menu animation to complete }; export const closeMoreOptionsMenu = async (page: Page) => { - await interactWithElementInIframe(page, 'body', { action: 'click' }); - await page.waitForTimeout(500); // Wait for menu to close + // Check if the menu is still visible before trying to close + const frameLocator = await getIframeInShadowDom(page); + const menu = frameLocator.locator('#more-options-menu'); + const menuVisible = await menu.isVisible().catch(() => false); + + if (menuVisible) { + // Click outside the menu to close it (using a safe click area) + await interactWithElementInIframe(page, 'body', { action: 'click' }); + // Wait for menu to be hidden with a timeout + await waitForElementInIframe(page, '#more-options-menu', { state: 'hidden', timeout: 5000 }); + await page.waitForTimeout(300); // Wait for close animation + } }; // ==========================================