@@ -15,6 +15,9 @@ const MEDIA_FILE = fs.readFileSync("playwright/sample-files/riot.png");
15
15
test . describe ( "Media preview settings" , ( ) => {
16
16
test . use ( {
17
17
displayName : "Alan" ,
18
+ botCreateOpts : {
19
+ displayName : "Bob" ,
20
+ } ,
18
21
room : async ( { app, page, homeserver, bot, user } , use ) => {
19
22
const mxc = ( await bot . uploadContent ( MEDIA_FILE , { name : "image.png" , type : "image/png" } ) ) . content_uri ;
20
23
const roomId = await bot . createRoom ( {
@@ -39,7 +42,14 @@ test.describe("Media preview settings", () => {
39
42
await app . viewRoomById ( room . roomId ) ;
40
43
await expect (
41
44
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
+ } ) ;
43
53
await expect (
44
54
page . getByRole ( "tree" , { name : "Rooms" } ) . getByRole ( "treeitem" , { name : "Test room" } ) ,
45
55
) . toMatchScreenshot ( "invite-room-tree-no-avatar.png" ) ;
@@ -52,7 +62,14 @@ test.describe("Media preview settings", () => {
52
62
await app . viewRoomById ( room . roomId ) ;
53
63
await expect (
54
64
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
+ } ) ;
56
73
await expect (
57
74
page . getByRole ( "tree" , { name : "Rooms" } ) . getByRole ( "treeitem" , { name : "Test room" } ) ,
58
75
) . toMatchScreenshot ( "invite-room-tree-with-avatar.png" ) ;
0 commit comments