diff --git a/backend/ew.test.config.json b/backend/ew.test.config.json index 52be51b8f..f8b3ee5c4 100644 --- a/backend/ew.test.config.json +++ b/backend/ew.test.config.json @@ -26,8 +26,7 @@ "features": { "feature_element_call_video_rooms": true, "feature_video_rooms": true, - "feature_group_calls": true, - "feature_release_announcement": false + "feature_group_calls": true }, "default_federate": true, "default_theme": "light", @@ -40,7 +39,10 @@ }, "setting_defaults": { "breadcrumbs": true, - "feature_group_calls": true + "feature_group_calls": true, + "releaseAnnouncementData": { + "room_list_section": true + } }, "jitsi": { "preferred_domain": "meet.element.io" diff --git a/backend/ew.test.othersite.config.json b/backend/ew.test.othersite.config.json index 2ad3df4f3..6b3cb3a9c 100644 --- a/backend/ew.test.othersite.config.json +++ b/backend/ew.test.othersite.config.json @@ -26,8 +26,7 @@ "features": { "feature_element_call_video_rooms": true, "feature_video_rooms": true, - "feature_group_calls": true, - "feature_release_announcement": false + "feature_group_calls": true }, "default_federate": true, "default_theme": "light", @@ -40,7 +39,10 @@ }, "setting_defaults": { "breadcrumbs": true, - "feature_group_calls": true + "feature_group_calls": true, + "releaseAnnouncementData": { + "room_list_section": true + } }, "jitsi": { "preferred_domain": "meet.element.io" diff --git a/docs/agents/testing.md b/docs/agents/testing.md index d1a325897..eb8792d67 100644 --- a/docs/agents/testing.md +++ b/docs/agents/testing.md @@ -48,6 +48,8 @@ Test what a user observes: the peer sees the change, it survives a reconnect, it right after a reload. Reuse `playwright/spa-helpers.ts`, `playwright/widget/test-helpers.ts`, `playwright/fixtures/`. +To mark new release announcements as viewed, add them in `backend/ew.test*.config.json`. + ```sh pnpm test # unit + storybook pnpm backend # Synapse + LiveKit, required for e2e diff --git a/playwright/fixtures/widget-user.ts b/playwright/fixtures/widget-user.ts index d21f443df..b21732594 100644 --- a/playwright/fixtures/widget-user.ts +++ b/playwright/fixtures/widget-user.ts @@ -29,47 +29,10 @@ export interface MyFixtures { addUser: (username: string, host: string) => Promise; } -// Minimal config.json for the local element-web instance -const CONFIG_JSON = { - default_server_config: { - "m.homeserver": { - base_url: "https://synapse.m.localhost", - server_name: "synapse.m.localhost", - }, - }, - - element_call: { - participant_limit: 8, - brand: "Element Call", - }, - - // The default language is set here for test consistency - setting_defaults: { - language: "en-GB", - feature_group_calls: true, - }, - - // the location tests want a map style url. - map_style_url: - "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx", - - features: { - // We don't want to go through the feature announcement during the e2e test - feature_release_announcement: false, - feature_element_call_video_rooms: true, - feature_video_rooms: true, - feature_group_calls: true, - }, -}; - export const widgetTest = test.extend({ // allow per-test override: `widgetTest.use({ callType: "dm" })` callType: ["room", { option: true }], - asWidget: async ({ browser, context, callType }, pUse) => { - await context.route(`http://localhost:8081/config.json*`, async (route) => { - await route.fulfill({ json: CONFIG_JSON }); - }); - + asWidget: async ({ browser, callType }, pUse) => { const brooksDisplayName = `brooks_${Date.now()}`; const whistlerDisplayName = `whistler_${Date.now()}`; diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 8a821d511..4e255f869 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -153,9 +153,10 @@ export class TestHelpers { return { page, clientHandle, mxId }; } - // Dismisses any toasts that appear on startup, such as "Failed to load service worker" or "Back up your chats". - // Toast can be stacked, and only the top one can be dismiss, so just look at what is on top and - // dismiss (if part of expected toats) + // Dismisses the toasts a fresh device gets after sign-in. + // + // Toasts stack and only the top one can be dismissed, so look + // at what is on top each time. public static async dismissStartupToasts(page: Page): Promise { const expectedToasts: { title: string; @@ -163,6 +164,7 @@ export class TestHelpers { confirm?: string; }[] = [ { title: "Failed to load service worker", button: "OK" }, + { title: "Verify this device", button: "Later" }, { title: "Back up your chats", button: "Not now" }, { title: "Turn on key storage", @@ -213,30 +215,6 @@ export class TestHelpers { } } - /** - * Clears what Element Web stacks over the room list after sign-in. The - * release announcement is held back while any toast is up, so it is closed - * after the toasts, not before. - */ - public static async clearRoomListOverlays(page: Page): Promise { - await TestHelpers.dismissStartupToasts(page); - await TestHelpers.closeReleaseAnnouncement(page, "Introducing Sections"); - } - - public static async closeReleaseAnnouncement( - page: Page, - name: string, - ): Promise { - try { - await page - .getByRole("dialog", { name }) - .getByRole("button", { name: "OK" }) - .click({ timeout: 2000 }); - } catch { - // Announcement not shown; nothing to do - } - } - public static async expandAllSections(page: Page): Promise { try { await page @@ -282,15 +260,14 @@ export class TestHelpers { /** * Opens the room list's "New" menu and picks the given item. * - * While the sections announcement is anchored to the "New" button, the - * button has no menu at all, so the overlays go first. Driven by keyboard, - * as a toast arriving afterwards sits over the button and swallows clicks. + * Driven by keyboard, as a toast arriving late sits over the button and + * swallows clicks. */ public static async chooseFromRoomListNewMenu( page: Page, itemName: string, ): Promise { - await TestHelpers.clearRoomListOverlays(page); + await TestHelpers.dismissStartupToasts(page); await page .getByRole("navigation", { name: "Room list" }) .getByRole("button", { name: "New", exact: true }) @@ -427,9 +404,8 @@ export class TestHelpers { name: "Toggle Invites section", }); await expect(invitesSection).toBeVisible({ timeout: 10000 }); - // Toasts and the announcement sit over the top of the room list, where - // this header is - await TestHelpers.clearRoomListOverlays(page); + // Toasts sit over the top of the room list, where this header is. + await TestHelpers.dismissStartupToasts(page); if ((await invitesSection.getAttribute("aria-expanded")) !== "true") { await invitesSection.click(); }