Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e6a3238

Browse files
authored
Deflake the chat export test (#12854)
Just set a fixed time instead, as per comment (Im not actually sure my changes broke this, I think it might just be because it's August now).
1 parent a0c029c commit e6a3238

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

playwright/e2e/chat-export/html-export.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ test.describe("HTML Export", () => {
9898
});
9999

100100
test("should export html successfully and match screenshot", async ({ page, app, room }) => {
101+
// Set a fixed time rather than masking off the line with the time in it: we don't need to worry
102+
// about the width changing and we can actually test this line looks correct.
103+
page.clock.setSystemTime(new Date("2024-01-01T00:00:00Z"));
104+
101105
// Send a bunch of messages to populate the room
102106
for (let i = 1; i < 10; i++) {
103107
await app.client.sendMessage(room.roomId, { body: `Testing ${i}`, msgtype: "m.text" });
@@ -123,7 +127,6 @@ test.describe("HTML Export", () => {
123127
await page.goto(`file://${dirPath}/${Object.keys(zip.files)[0]}/messages.html`);
124128
await expect(page).toMatchScreenshot("html-export.png", {
125129
mask: [
126-
page.getByText("This is the start of export", { exact: false }),
127130
// We need to mask the whole thing because the width of the time part changes
128131
page.locator(".mx_TimelineSeparator"),
129132
page.locator(".mx_MessageTimestamp"),
9.27 KB
Loading

0 commit comments

Comments
 (0)