@@ -908,23 +908,37 @@ test.describe("Timeline", () => {
908908 } ) ;
909909 } ) ;
910910
911- test ( "should be able to hide an image" , { tag : "@screenshot" } , async ( { page, app, room, context } ) => {
912- await app . viewRoomById ( room . roomId ) ;
913- await sendImage ( app . client , room . roomId , NEW_AVATAR ) ;
914- await app . timeline . scrollToBottom ( ) ;
915- const imgTile = page . locator ( ".mx_MImageBody" ) . first ( ) ;
916- await expect ( imgTile ) . toBeVisible ( ) ;
917- await imgTile . hover ( ) ;
918- await page . getByRole ( "button" , { name : "Hide" } ) . click ( ) ;
911+ test (
912+ "should be able to hide an image" ,
913+ { tag : "@screenshot" } ,
914+ async ( { page, app, homeserver, room, context } ) => {
915+ await app . viewRoomById ( room . roomId ) ;
919916
920- // Check that the image is now hidden.
921- await expect ( page . getByRole ( "button" , { name : "Show image" } ) ) . toBeVisible ( ) ;
922- } ) ;
917+ const bot = new Bot ( page , homeserver , { } ) ;
918+ await bot . prepareClient ( ) ;
919+ await app . client . inviteUser ( room . roomId , bot . credentials . userId ) ;
923920
924- test ( "should be able to hide a video" , async ( { page, app, room, context } ) => {
921+ await sendImage ( bot , room . roomId , NEW_AVATAR ) ;
922+ await app . timeline . scrollToBottom ( ) ;
923+ const imgTile = page . locator ( ".mx_MImageBody" ) . first ( ) ;
924+ await expect ( imgTile ) . toBeVisible ( ) ;
925+ await imgTile . hover ( ) ;
926+ await page . getByRole ( "button" , { name : "Hide" } ) . click ( ) ;
927+
928+ // Check that the image is now hidden.
929+ await expect ( page . getByRole ( "button" , { name : "Show image" } ) ) . toBeVisible ( ) ;
930+ } ,
931+ ) ;
932+
933+ test ( "should be able to hide a video" , async ( { page, app, homeserver, room, context } ) => {
925934 await app . viewRoomById ( room . roomId ) ;
926- const upload = await app . client . uploadContent ( VIDEO_FILE , { name : "bbb.webm" , type : "video/webm" } ) ;
927- await app . client . sendEvent ( room . roomId , null , "m.room.message" as EventType , {
935+
936+ const bot = new Bot ( page , homeserver , { } ) ;
937+ await bot . prepareClient ( ) ;
938+ await app . client . inviteUser ( room . roomId , bot . credentials . userId ) ;
939+
940+ const upload = await bot . uploadContent ( VIDEO_FILE , { name : "bbb.webm" , type : "video/webm" } ) ;
941+ await bot . sendEvent ( room . roomId , null , "m.room.message" as EventType , {
928942 msgtype : "m.video" as MsgType ,
929943 body : "bbb.webm" ,
930944 url : upload . content_uri ,
0 commit comments