diff --git a/apps/meteor/tests/e2e/e2e-encryption.spec.ts b/apps/meteor/tests/e2e/e2e-encryption.spec.ts index 847b627a9431..5d5cca138018 100644 --- a/apps/meteor/tests/e2e/e2e-encryption.spec.ts +++ b/apps/meteor/tests/e2e/e2e-encryption.spec.ts @@ -710,7 +710,7 @@ test.describe.serial('e2e-encryption', () => { }); }); - test('expect create a private channel, send unecrypted messages, encrypt the channel and delete the last message and check the last message in the sidebar', async ({ + test.only('expect create a private channel, send unecrypted messages, encrypt the channel and delete the last message and check the last message in the sidebar', async ({ page, }) => { const channelName = faker.string.uuid(); @@ -754,7 +754,7 @@ test.describe.serial('e2e-encryption', () => { // Check last message in the sidebar const sidebarChannel = poHomeChannel.sidebar.getSidebarItemByName(channelName); await expect(sidebarChannel).toBeVisible(); - await expect(sidebarChannel.locator('span')).toContainText(encriptedMessage1); + await expect(sidebarChannel.filter({ hasText: encriptedMessage1 })).toBeVisible(); }); test('expect create a private encrypted channel and pin/star an encrypted message', async ({ page }) => { @@ -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 a103ee895b14..eadf554c7faf 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 259f2f77c962..f8e5524773db 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(); });