diff --git a/apps/meteor/tests/e2e/e2e-encryption.spec.ts b/apps/meteor/tests/e2e/e2e-encryption.spec.ts index 847b627a9431f..1c528306e559c 100644 --- a/apps/meteor/tests/e2e/e2e-encryption.spec.ts +++ b/apps/meteor/tests/e2e/e2e-encryption.spec.ts @@ -1007,7 +1007,9 @@ test.describe.serial('e2ee room setup', () => { await injectInitialData(); await restoreState(page, Users.admin); - await poHomeChannel.sidebar.openChat(channelName); + await poHomeChannel.sidebar.typeSearch(channelName); + await poHomeChannel.sidebar.getSearchRoomByName(channelName).click(); + await poHomeChannel.content.waitForPageLoad(); await page.locator('role=button[name="Save E2EE password"]').click(); await page.locator('#modal-root >> button:has-text("I saved my password")').click(); diff --git a/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts b/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts index a103ee895b142..eadf554c7faff 100644 --- a/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts +++ b/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts @@ -410,4 +410,9 @@ export class HomeContent { await expect(this.page.getByRole('main').getByRole('list', { name: 'Message list' })).not.toHaveAttribute('aria-busy', 'true'); } + + async waitForPageLoad(): Promise { + await this.page.waitForSelector('main'); + await this.page.waitForSelector('main >> role=heading'); + } } diff --git a/apps/meteor/tests/e2e/sidebar.spec.ts b/apps/meteor/tests/e2e/sidebar.spec.ts index 259f2f77c9626..f8e5524773dbb 100644 --- a/apps/meteor/tests/e2e/sidebar.spec.ts +++ b/apps/meteor/tests/e2e/sidebar.spec.ts @@ -14,9 +14,9 @@ test.describe.serial('sidebar', () => { }); test('should navigate on sidebar toolbar using arrow keys', async ({ page }) => { + await poHomeDiscussion.content.waitForPageLoad(); await poHomeDiscussion.navbar.homeButton.focus(); await page.keyboard.press('ArrowRight'); - await expect(poHomeDiscussion.navbar.directoryButton).toBeFocused(); });