diff --git a/playwright/e2e/read-receipts/read-receipts.spec.ts b/playwright/e2e/read-receipts/read-receipts.spec.ts index 5d42513b56..9cbdadfac8 100644 --- a/playwright/e2e/read-receipts/read-receipts.spec.ts +++ b/playwright/e2e/read-receipts/read-receipts.spec.ts @@ -100,12 +100,7 @@ test.describe("Read receipts", { tag: "@mergequeue" }, () => { await page.goto(`/#/room/${selectedRoomId}`); }); - // Disabled due to flakiness: https://github.com/element-hq/element-web/issues/26895 - test.skip("With sync accumulator, considers main thread and unthreaded receipts #24629", async ({ - page, - app, - bot, - }) => { + test("With sync accumulator, considers main thread and unthreaded receipts #24629", async ({ page, app, bot }) => { // Details are in https://github.com/vector-im/element-web/issues/24629 // This proves we've fixed one of the "stuck unreads" issues. diff --git a/playwright/e2e/threads/threads.spec.ts b/playwright/e2e/threads/threads.spec.ts index edcc0578d8..c654792659 100644 --- a/playwright/e2e/threads/threads.spec.ts +++ b/playwright/e2e/threads/threads.spec.ts @@ -24,8 +24,7 @@ test.describe("Threads", () => { }); }); - // Flaky: https://github.com/vector-im/element-web/issues/26452 - test.skip("should be usable for a conversation", { tag: "@screenshot" }, async ({ page, app, bot }) => { + test("should be usable for a conversation", { tag: "@screenshot" }, async ({ page, app, bot }) => { const roomId = await app.client.createRoom({}); await app.client.inviteUser(roomId, bot.credentials.userId); await bot.joinRoom(roomId); @@ -76,7 +75,7 @@ test.describe("Threads", () => { mask: mask, }); await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble); - await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='bubble']")).toBeVisible(); + await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='bubble']")).toHaveCount(2); await expect(page.locator(".mx_ThreadView")).toMatchScreenshot("Initial_ThreadView_on_bubble_layout.png", { mask: mask, @@ -136,8 +135,8 @@ test.describe("Threads", () => { await page.getByRole("gridcell", { name: "👋" }).click(); locator = page.locator(".mx_ThreadView"); - // Make sure the CSS style for spacing is applied to mx_ReactionsRow on group/modern layout - await expect(locator.locator(".mx_EventTile[data-layout=group] .mx_ReactionsRow")).toHaveCSS( + // Make sure the CSS style for spacing is applied to mx_EventTile_footer on group/modern layout + await expect(locator.locator(".mx_EventTile[data-layout=group] .mx_EventTile_footer")).toHaveCSS( "margin-inline-start", ThreadViewGroupSpacingStart, ); @@ -164,7 +163,7 @@ test.describe("Threads", () => { locator = page.locator( ".mx_ThreadView .mx_GenericEventListSummary[data-layout=bubble] .mx_EventTile_info.mx_EventTile_last", ); - expect(locator.locator(".mx_EventTile_line .mx_EventTile_content")) + await expect(locator.locator(".mx_EventTile_line .mx_EventTile_content")) // 76px: ThreadViewGroupSpacingStart + 14px + 6px // 14px: avatar width // See: _EventTile.pcss @@ -202,12 +201,14 @@ test.describe("Threads", () => { await locator.click(); // Wait until the response is redacted - await expect( - page.locator(".mx_ThreadView").locator(".mx_EventTile_last .mx_EventTile_receiptSent"), - ).toBeVisible(); + // XXX: one would expect this redaction to be shown in the thread the message was in, but due to redactions + // stripping the thread_id, it is instead shown in the main timeline + await expect(page.locator(".mx_MainSplit_timeline").locator(".mx_EventTile_last")).toContainText( + "Message deleted", + ); // Take snapshots in group layout and bubble layout (IRC layout is not available on ThreadView) - await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='group']")).toBeVisible(); + await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='group']")).toHaveCount(2); await expect(page.locator(".mx_ThreadView")).toMatchScreenshot( "ThreadView_with_redacted_messages_on_group_layout.png", { @@ -215,7 +216,7 @@ test.describe("Threads", () => { }, ); await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble); - await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='bubble']")).toBeVisible(); + await expect(page.locator(".mx_ThreadView .mx_EventTile[data-layout='bubble']")).toHaveCount(2); await expect(page.locator(".mx_ThreadView")).toMatchScreenshot( "ThreadView_with_redacted_messages_on_bubble_layout.png", { @@ -233,8 +234,8 @@ test.describe("Threads", () => { // User closes right panel after clicking back to thread list locator = page.locator(".mx_ThreadPanel"); - locator.getByRole("button", { name: "Threads" }).click(); - locator.getByRole("button", { name: "Close" }).click(); + await locator.getByRole("button", { name: "Threads" }).click(); + await locator.getByRole("button", { name: "Close" }).click(); // Bot responds to thread await bot.sendMessage(roomId, "How are things?", threadId); @@ -243,9 +244,8 @@ test.describe("Threads", () => { await expect(locator.locator(".mx_ThreadSummary_sender").getByText("BotBob")).toBeAttached(); await expect(locator.locator(".mx_ThreadSummary_content").getByText("How are things?")).toBeAttached(); - locator = page.getByRole("button", { name: "Threads" }); - await expect(locator).toHaveAttribute("data-indicator", "default"); // User asserts thread list unread indicator - // await expect(locator).toHaveClass(/mx_LegacyRoomHeader_button--unread/); + locator = page.getByRole("banner").getByRole("button", { name: "Threads" }); + await expect(locator).toHaveAttribute("data-indicator", "success"); // User asserts thread list unread indicator await locator.click(); // User opens thread list // User asserts thread with correct root & latest events & unread dot @@ -273,20 +273,18 @@ test.describe("Threads", () => { await expect(locator.getByText("Great!")).toBeAttached(); await locator.locator(".mx_EventTile_line").hover(); await locator.locator(".mx_EventTile_line").getByRole("button", { name: "Edit" }).click(); - await locator.getByRole("textbox").fill(" How about yourself?{enter}"); + await locator.getByRole("textbox").pressSequentially(" How about yourself?"); // fill would overwrite the original text await locator.getByRole("textbox").press("Enter"); locator = page.locator(".mx_RoomView_body .mx_ThreadSummary"); await expect(locator.locator(".mx_ThreadSummary_sender").getByText("Tom")).toBeAttached(); - await expect( - locator.locator(".mx_ThreadSummary_content").getByText("Great! How about yourself?"), - ).toBeAttached(); + await expect(locator.locator(".mx_ThreadSummary_content")).toHaveText("Great! How about yourself?"); // User closes right panel await page.locator(".mx_ThreadPanel").getByRole("button", { name: "Close" }).click(); // Bot responds to thread and saves the id of their message to @eventId - const { event_id: eventId } = await bot.sendMessage(roomId, threadId, "I'm very good thanks"); + const { event_id: eventId } = await bot.sendMessage(roomId, "I'm very good thanks", threadId); // User asserts locator = page.locator(".mx_RoomView_body .mx_ThreadSummary"); @@ -344,7 +342,7 @@ test.describe("Threads", () => { await expect(page.locator(".mx_ThreadView_timelinePanelWrapper")).toHaveCount(1); - (await app.openMessageComposerOptions(true)).getByRole("menuitem", { name: "Voice Message" }).click(); + await (await app.openMessageComposerOptions(true)).getByRole("menuitem", { name: "Voice Message" }).click(); await page.waitForTimeout(3000); await app.getComposer(true).getByRole("button", { name: "Send voice message" }).click(); await expect(page.locator(".mx_ThreadView .mx_MVoiceMessageBody")).toHaveCount(1); diff --git a/playwright/e2e/timeline/timeline.spec.ts b/playwright/e2e/timeline/timeline.spec.ts index fc8205709c..26d286b53a 100644 --- a/playwright/e2e/timeline/timeline.spec.ts +++ b/playwright/e2e/timeline/timeline.spec.ts @@ -590,10 +590,6 @@ test.describe("Timeline", () => { "should set inline start padding to a hidden event line", { tag: "@screenshot" }, async ({ page, app, room }) => { - test.skip( - true, - "Disabled due to screenshot test being flaky - https://github.com/element-hq/element-web/issues/26890", - ); await sendEvent(app.client, room.roomId); await page.goto(`/#/room/${room.roomId}`); await app.settings.setValue("showHiddenEventsInTimeline", null, SettingLevel.DEVICE, true); diff --git a/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-bubble-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-bubble-layout-linux.png new file mode 100644 index 0000000000..60d6dc9e18 Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-bubble-layout-linux.png differ diff --git a/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-group-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-group-layout-linux.png new file mode 100644 index 0000000000..301201c1f6 Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/Initial-ThreadView-on-group-layout-linux.png differ diff --git a/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-bubble-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-bubble-layout-linux.png new file mode 100644 index 0000000000..cff1b27bd3 Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-bubble-layout-linux.png differ diff --git a/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-group-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-group-layout-linux.png new file mode 100644 index 0000000000..67414d1e7b Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-reaction-and-a-hidden-event-on-group-layout-linux.png differ diff --git a/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-bubble-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-bubble-layout-linux.png new file mode 100644 index 0000000000..c92780196d Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-bubble-layout-linux.png differ diff --git a/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-group-layout-linux.png b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-group-layout-linux.png new file mode 100644 index 0000000000..4b779aa788 Binary files /dev/null and b/playwright/snapshots/threads/threads.spec.ts/ThreadView-with-redacted-messages-on-group-layout-linux.png differ diff --git a/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-padding-modern-layout-linux.png b/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-padding-modern-layout-linux.png new file mode 100644 index 0000000000..efcbba43f9 Binary files /dev/null and b/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-padding-modern-layout-linux.png differ diff --git a/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-zero-padding-irc-layout-linux.png b/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-zero-padding-irc-layout-linux.png new file mode 100644 index 0000000000..00c697f9a6 Binary files /dev/null and b/playwright/snapshots/timeline/timeline.spec.ts/hidden-event-line-zero-padding-irc-layout-linux.png differ