@@ -155,7 +155,7 @@ describe("Timeline", () => {
155155 cy . visit ( "/#/room/" + roomId ) ;
156156 cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . IRC ) ;
157157 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary[data-layout=irc] " +
158- ".mx_GenericEventListSummary_summary" , "created and configured the room." ) ;
158+ ".mx_GenericEventListSummary_summary" , "created and configured the room." ) . should ( "exist" ) ;
159159 cy . get ( ".mx_Spinner" ) . should ( "not.exist" ) ;
160160 cy . percySnapshot ( "Configured room on IRC layout" ) ;
161161 } ) ;
@@ -166,7 +166,7 @@ describe("Timeline", () => {
166166
167167 // Wait until configuration is finished
168168 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary " +
169- ".mx_GenericEventListSummary_summary" , "created and configured the room." ) ;
169+ ".mx_GenericEventListSummary_summary" , "created and configured the room." ) . should ( "exist" ) ;
170170
171171 // Click "expand" link button
172172 cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . click ( ) ;
@@ -193,14 +193,14 @@ describe("Timeline", () => {
193193 cy . visit ( "/#/room/" + roomId ) ;
194194 cy . setSettingValue ( "showHiddenEventsInTimeline" , null , SettingLevel . DEVICE , true ) ;
195195 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary .mx_GenericEventListSummary_summary" ,
196- "created and configured the room." ) ;
196+ "created and configured the room." ) . should ( "exist" ) ;
197197
198198 // Edit message
199199 cy . contains ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line" , "Message" ) . within ( ( ) => {
200200 cy . get ( '[aria-label="Edit"]' ) . click ( { force : true } ) ; // Cypress has no ability to hover
201201 cy . get ( ".mx_BasicMessageComposer_input" ) . type ( "Edit{enter}" ) ;
202202 } ) ;
203- cy . get ( ".mx_RoomView_body .mx_EventTile" ) . contains ( ".mx_EventTile[data-scroll-tokens]" , "MessageEdit" ) ;
203+ cy . contains ( ".mx_EventTile[data-scroll-tokens]" , "MessageEdit" ) . should ( "exist ") ;
204204
205205 // Click timestamp to highlight hidden event line
206206 cy . get ( ".mx_RoomView_body .mx_EventTile_info .mx_MessageTimestamp" ) . click ( ) ;
@@ -228,18 +228,19 @@ describe("Timeline", () => {
228228 cy . visit ( "/#/room/" + roomId ) ;
229229 cy . setSettingValue ( "showHiddenEventsInTimeline" , null , SettingLevel . DEVICE , true ) ;
230230 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary " +
231- ".mx_GenericEventListSummary_summary" , "created and configured the room." ) ;
231+ ".mx_GenericEventListSummary_summary" , "created and configured the room." ) . should ( "exist" ) ;
232232
233233 // Edit message
234234 cy . contains ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line" , "Message" ) . within ( ( ) => {
235235 cy . get ( '[aria-label="Edit"]' ) . click ( { force : true } ) ; // Cypress has no ability to hover
236236 cy . get ( ".mx_BasicMessageComposer_input" ) . type ( "Edit{enter}" ) ;
237237 } ) ;
238- cy . contains ( ".mx_RoomView_body .mx_EventTile[data-scroll-tokens]" , "MessageEdit" ) ;
238+ cy . contains ( ".mx_RoomView_body .mx_EventTile[data-scroll-tokens]" , "MessageEdit" ) . should ( "exist" ) ;
239239
240240 // Click top left of the event toggle, which should not be covered by MessageActionBar's safe area
241- cy . get ( ".mx_EventTile .mx_ViewSourceEvent" ) . realHover ( )
242- . get ( ".mx_EventTile .mx_ViewSourceEvent .mx_ViewSourceEvent_toggle" ) . click ( 'topLeft' , { force : false } ) ;
241+ cy . get ( ".mx_EventTile .mx_ViewSourceEvent" ) . realHover ( ) . within ( ( ) => {
242+ cy . get ( ".mx_ViewSourceEvent_toggle" ) . click ( 'topLeft' , { force : false } ) ;
243+ } ) ;
243244
244245 // Make sure the expand toggle worked
245246 cy . get ( ".mx_EventTile .mx_ViewSourceEvent_expanded .mx_ViewSourceEvent_toggle" ) . should ( "be.visible" ) ;
@@ -249,17 +250,17 @@ describe("Timeline", () => {
249250 cy . visit ( "/#/room/" + roomId ) ;
250251 cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . Bubble ) ;
251252 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary[data-layout=bubble] " +
252- ".mx_GenericEventListSummary_summary" , "created and configured the room." ) ;
253+ ".mx_GenericEventListSummary_summary" , "created and configured the room." ) . should ( "exist" ) ;
253254
254255 // Click "expand" link button
255256 cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . click ( ) ;
256257
257258 // Click "collapse" link button on the first hovered info event line
258- cy . get ( ".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type" ) . realHover ( )
259- . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . click ( { force : false } ) ;
259+ cy . get ( ".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type" ) . realHover ( ) ;
260+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . click ( { force : false } ) ;
260261
261262 // Make sure "collapse" link button worked
262- cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) ;
263+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . should ( "exist" ) ;
263264 } ) ;
264265
265266 it ( "should highlight search result words regardless of formatting" , ( ) => {
@@ -285,7 +286,7 @@ describe("Timeline", () => {
285286 cy . getComposer ( ) . type ( `${ MESSAGE } {enter}` ) ;
286287
287288 // Reply to the message
288- cy . get ( ".mx_RoomView_body .mx_EventTile " ) . contains ( ".mx_EventTile_line" , "Hello world" ) . within ( ( ) => {
289+ cy . get ( ".mx_RoomView_body" ) . contains ( ".mx_EventTile_line" , "Hello world" ) . within ( ( ) => {
289290 cy . get ( '[aria-label="Reply"]' ) . click ( { force : true } ) ; // Cypress has no ability to hover
290291 } ) ;
291292 } ;
@@ -296,20 +297,22 @@ describe("Timeline", () => {
296297
297298 cy . getComposer ( ) . type ( `${ reply } {enter}` ) ;
298299
299- cy . get ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line" ) . find ( " .mx_ReplyTile .mx_MTextBody")
300+ cy . get ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line .mx_ReplyTile .mx_MTextBody" )
300301 . should ( "contain" , MESSAGE ) ;
301- cy . get ( ".mx_RoomView_body .mx_EventTile > .mx_EventTile_line > .mx_MTextBody" ) . contains ( reply )
302+ cy . contains ( ".mx_RoomView_body .mx_EventTile > .mx_EventTile_line > .mx_MTextBody" , reply )
302303 . should ( "have.length" , 1 ) ;
303304 } ) ;
304305
305- xit ( "can reply with a voice message" , ( ) => {
306+ it ( "can reply with a voice message" , ( ) => {
306307 viewRoomSendMessageAndSetupReply ( ) ;
307308
308- cy . openMessageComposerOptions ( ) . find ( `[aria-label="Voice Message"]` ) . click ( ) ;
309+ cy . openMessageComposerOptions ( ) . within ( ( ) => {
310+ cy . get ( `[aria-label="Voice Message"]` ) . click ( ) ;
311+ } ) ;
309312 cy . wait ( 3000 ) ;
310- cy . getComposer ( ) . find ( " .mx_MessageComposer_sendMessage") . click ( ) ;
313+ cy . get ( ".mx_RoomView_body .mx_MessageComposer .mx_MessageComposer_sendMessage") . click ( ) ;
311314
312- cy . get ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line" ) . find ( " .mx_ReplyTile .mx_MTextBody")
315+ cy . get ( ".mx_RoomView_body .mx_EventTile .mx_EventTile_line .mx_ReplyTile .mx_MTextBody" )
313316 . should ( "contain" , MESSAGE ) ;
314317 cy . get ( ".mx_RoomView_body .mx_EventTile > .mx_EventTile_line > .mx_MVoiceMessageBody" )
315318 . should ( "have.length" , 1 ) ;
0 commit comments