Skip to content

Commit adc110a

Browse files
authored
Fix invite flake (#29812)
1 parent 6329f69 commit adc110a

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

playwright/e2e/timeline/media-preview-settings.spec.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ const MEDIA_FILE = fs.readFileSync("playwright/sample-files/riot.png");
1515
test.describe("Media preview settings", () => {
1616
test.use({
1717
displayName: "Alan",
18+
botCreateOpts: {
19+
displayName: "Bob",
20+
},
1821
room: async ({ app, page, homeserver, bot, user }, use) => {
1922
const mxc = (await bot.uploadContent(MEDIA_FILE, { name: "image.png", type: "image/png" })).content_uri;
2023
const roomId = await bot.createRoom({
@@ -39,7 +42,14 @@ test.describe("Media preview settings", () => {
3942
await app.viewRoomById(room.roomId);
4043
await expect(
4144
page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }),
42-
).toMatchScreenshot("invite-no-avatar.png");
45+
).toMatchScreenshot("invite-no-avatar.png", {
46+
// Hide the mxid, which is not stable.
47+
css: `
48+
.mx_RoomPreviewBar_inviter_mxid {
49+
display: none !important;
50+
}
51+
`,
52+
});
4353
await expect(
4454
page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }),
4555
).toMatchScreenshot("invite-room-tree-no-avatar.png");
@@ -52,7 +62,14 @@ test.describe("Media preview settings", () => {
5262
await app.viewRoomById(room.roomId);
5363
await expect(
5464
page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }),
55-
).toMatchScreenshot("invite-with-avatar.png");
65+
).toMatchScreenshot("invite-with-avatar.png", {
66+
// Hide the mxid, which is not stable.
67+
css: `
68+
.mx_RoomPreviewBar_inviter_mxid {
69+
display: none !important;
70+
}
71+
`,
72+
});
5673
await expect(
5774
page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }),
5875
).toMatchScreenshot("invite-room-tree-with-avatar.png");
Loading
Loading

0 commit comments

Comments
 (0)