frontend: Improve E2EE UI tests by enhancing panel close interactions and timeout handling

This commit is contained in:
Carlos Santos 2026-01-14 19:37:53 +01:00
parent 4ecd086f21
commit 3cb163deee
2 changed files with 26 additions and 8 deletions

View File

@ -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([

View File

@ -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
}
};
// ==========================================