@@ -134,18 +134,22 @@ test.describe("Audio player", () => {
134134 ) . toBeVisible ( ) ;
135135 } ) ;
136136
137- test ( "should be correctly rendered - light theme" , async ( { page, app } ) => {
137+ test ( "should be correctly rendered - light theme" , { tag : "@screenshot" } , async ( { page, app } ) => {
138138 await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
139139 await takeSnapshots ( page , app , "Selected EventTile of audio player (light theme)" ) ;
140140 } ) ;
141141
142- test ( "should be correctly rendered - light theme with monospace font" , async ( { page, app } ) => {
143- await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
142+ test (
143+ "should be correctly rendered - light theme with monospace font" ,
144+ { tag : "@screenshot" } ,
145+ async ( { page, app } ) => {
146+ await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
144147
145- await takeSnapshots ( page , app , "Selected EventTile of audio player (light theme, monospace font)" , true ) ; // Enable monospace
146- } ) ;
148+ await takeSnapshots ( page , app , "Selected EventTile of audio player (light theme, monospace font)" , true ) ; // Enable monospace
149+ } ,
150+ ) ;
147151
148- test ( "should be correctly rendered - high contrast theme" , async ( { page, app } ) => {
152+ test ( "should be correctly rendered - high contrast theme" , { tag : "@screenshot" } , async ( { page, app } ) => {
149153 // Disable system theme in case ThemeWatcher enables the theme automatically,
150154 // so that the high contrast theme can be enabled
151155 await app . settings . setValue ( "use_system_theme" , null , SettingLevel . DEVICE , false ) ;
@@ -161,7 +165,7 @@ test.describe("Audio player", () => {
161165 await takeSnapshots ( page , app , "Selected EventTile of audio player (high contrast)" ) ;
162166 } ) ;
163167
164- test ( "should be correctly rendered - dark theme" , async ( { page, app } ) => {
168+ test ( "should be correctly rendered - dark theme" , { tag : "@screenshot" } , async ( { page, app } ) => {
165169 // Enable dark theme
166170 await app . settings . setValue ( "theme" , null , SettingLevel . ACCOUNT , "dark" ) ;
167171
@@ -207,93 +211,101 @@ test.describe("Audio player", () => {
207211 expect ( download . suggestedFilename ( ) ) . toBe ( "1sec.ogg" ) ;
208212 } ) ;
209213
210- test ( "should support replying to audio file with another audio file" , async ( { page, app } ) => {
211- await uploadFile ( page , "playwright/sample-files/1sec.ogg" ) ;
214+ test (
215+ "should support replying to audio file with another audio file" ,
216+ { tag : "@screenshot" } ,
217+ async ( { page, app } ) => {
218+ await uploadFile ( page , "playwright/sample-files/1sec.ogg" ) ;
212219
213- // Assert the audio player is rendered
214- await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
220+ // Assert the audio player is rendered
221+ await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
215222
216- // Find and click "Reply" button on MessageActionBar
217- const tile = page . locator ( ".mx_EventTile_last" ) ;
218- await tile . hover ( ) ;
219- await tile . getByRole ( "button" , { name : "Reply" , exact : true } ) . click ( ) ;
223+ // Find and click "Reply" button on MessageActionBar
224+ const tile = page . locator ( ".mx_EventTile_last" ) ;
225+ await tile . hover ( ) ;
226+ await tile . getByRole ( "button" , { name : "Reply" , exact : true } ) . click ( ) ;
220227
221- // Reply to the player with another audio file
222- await uploadFile ( page , "playwright/sample-files/1sec.ogg" ) ;
228+ // Reply to the player with another audio file
229+ await uploadFile ( page , "playwright/sample-files/1sec.ogg" ) ;
223230
224- // Assert that the audio player is rendered
225- await expect ( tile . locator ( ".mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
231+ // Assert that the audio player is rendered
232+ await expect ( tile . locator ( ".mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
226233
227- // Assert that replied audio file is rendered as file button inside ReplyChain
228- const button = tile . locator ( ".mx_ReplyChain_wrapper .mx_MFileBody_info[role='button']" ) ;
229- // Assert that the file button has file name
230- await expect ( button . locator ( ".mx_MFileBody_info_filename" ) ) . toBeVisible ( ) ;
234+ // Assert that replied audio file is rendered as file button inside ReplyChain
235+ const button = tile . locator ( ".mx_ReplyChain_wrapper .mx_MFileBody_info[role='button']" ) ;
236+ // Assert that the file button has file name
237+ await expect ( button . locator ( ".mx_MFileBody_info_filename" ) ) . toBeVisible ( ) ;
231238
232- await takeSnapshots ( page , app , "Selected EventTile of audio player with a reply" ) ;
233- } ) ;
239+ await takeSnapshots ( page , app , "Selected EventTile of audio player with a reply" ) ;
240+ } ,
241+ ) ;
234242
235- test ( "should support creating a reply chain with multiple audio files" , async ( { page, app, user } ) => {
236- // Note: "mx_ReplyChain" element is used not only for replies which
237- // create a reply chain, but also for a single reply without a replied
238- // message. This test checks whether a reply chain which consists of
239- // multiple audio file replies is rendered properly.
243+ test (
244+ "should support creating a reply chain with multiple audio files" ,
245+ { tag : "@screenshot" } ,
246+ async ( { page, app, user } ) => {
247+ // Note: "mx_ReplyChain" element is used not only for replies which
248+ // create a reply chain, but also for a single reply without a replied
249+ // message. This test checks whether a reply chain which consists of
250+ // multiple audio file replies is rendered properly.
240251
241- const tile = page . locator ( ".mx_EventTile_last" ) ;
252+ const tile = page . locator ( ".mx_EventTile_last" ) ;
242253
243- // Find and click "Reply" button
244- const clickButtonReply = async ( ) => {
245- await tile . scrollIntoViewIfNeeded ( ) ;
246- await tile . hover ( ) ;
247- await tile . getByRole ( "button" , { name : "Reply" , exact : true } ) . click ( ) ;
248- } ;
254+ // Find and click "Reply" button
255+ const clickButtonReply = async ( ) => {
256+ await tile . scrollIntoViewIfNeeded ( ) ;
257+ await tile . hover ( ) ;
258+ await tile . getByRole ( "button" , { name : "Reply" , exact : true } ) . click ( ) ;
259+ } ;
249260
250- await uploadFile ( page , "playwright/sample-files/upload-first.ogg" ) ;
261+ await uploadFile ( page , "playwright/sample-files/upload-first.ogg" ) ;
251262
252- // Assert that the audio player is rendered
253- await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
263+ // Assert that the audio player is rendered
264+ await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
254265
255- await clickButtonReply ( ) ;
266+ await clickButtonReply ( ) ;
256267
257- // Reply to the player with another audio file
258- await uploadFile ( page , "playwright/sample-files/upload-second.ogg" ) ;
268+ // Reply to the player with another audio file
269+ await uploadFile ( page , "playwright/sample-files/upload-second.ogg" ) ;
259270
260- // Assert that the audio player is rendered
261- await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
271+ // Assert that the audio player is rendered
272+ await expect ( page . locator ( ".mx_EventTile_last .mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
262273
263- await clickButtonReply ( ) ;
274+ await clickButtonReply ( ) ;
264275
265- // Reply to the player with yet another audio file to create a reply chain
266- await uploadFile ( page , "playwright/sample-files/upload-third.ogg" ) ;
276+ // Reply to the player with yet another audio file to create a reply chain
277+ await uploadFile ( page , "playwright/sample-files/upload-third.ogg" ) ;
267278
268- // Assert that the audio player is rendered
269- await expect ( tile . locator ( ".mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
279+ // Assert that the audio player is rendered
280+ await expect ( tile . locator ( ".mx_AudioPlayer_container" ) ) . toBeVisible ( ) ;
270281
271- // Assert that there are two "mx_ReplyChain" elements
272- await expect ( tile . locator ( ".mx_ReplyChain" ) ) . toHaveCount ( 2 ) ;
282+ // Assert that there are two "mx_ReplyChain" elements
283+ await expect ( tile . locator ( ".mx_ReplyChain" ) ) . toHaveCount ( 2 ) ;
273284
274- // Assert that one line contains the user name
275- await expect ( tile . locator ( ".mx_ReplyChain .mx_ReplyTile_sender" ) . getByText ( user . displayName ) ) . toBeVisible ( ) ;
285+ // Assert that one line contains the user name
286+ await expect ( tile . locator ( ".mx_ReplyChain .mx_ReplyTile_sender" ) . getByText ( user . displayName ) ) . toBeVisible ( ) ;
276287
277- // Assert that the other line contains the file button
278- await expect ( tile . locator ( ".mx_ReplyChain .mx_MFileBody" ) ) . toBeVisible ( ) ;
288+ // Assert that the other line contains the file button
289+ await expect ( tile . locator ( ".mx_ReplyChain .mx_MFileBody" ) ) . toBeVisible ( ) ;
279290
280- // Click "In reply to"
281- await tile . locator ( ".mx_ReplyChain .mx_ReplyChain_show" , { hasText : "In reply to" } ) . click ( ) ;
291+ // Click "In reply to"
292+ await tile . locator ( ".mx_ReplyChain .mx_ReplyChain_show" , { hasText : "In reply to" } ) . click ( ) ;
282293
283- const replyChain = tile . locator ( ".mx_ReplyChain:first-of-type" ) ;
284- // Assert that "In reply to" has disappeared
285- await expect ( replyChain . getByText ( "In reply to" ) ) . not . toBeVisible ( ) ;
294+ const replyChain = tile . locator ( ".mx_ReplyChain:first-of-type" ) ;
295+ // Assert that "In reply to" has disappeared
296+ await expect ( replyChain . getByText ( "In reply to" ) ) . not . toBeVisible ( ) ;
286297
287- // Assert that the file button contains the name of the file sent at first
288- await expect (
289- replyChain
290- . locator ( ".mx_MFileBody_info[role='button']" )
291- . locator ( ".mx_MFileBody_info_filename" , { hasText : "upload-first.ogg" } ) ,
292- ) . toBeVisible ( ) ;
298+ // Assert that the file button contains the name of the file sent at first
299+ await expect (
300+ replyChain
301+ . locator ( ".mx_MFileBody_info[role='button']" )
302+ . locator ( ".mx_MFileBody_info_filename" , { hasText : "upload-first.ogg" } ) ,
303+ ) . toBeVisible ( ) ;
293304
294- // Take snapshots
295- await takeSnapshots ( page , app , "Selected EventTile of audio player with a reply chain" ) ;
296- } ) ;
305+ // Take snapshots
306+ await takeSnapshots ( page , app , "Selected EventTile of audio player with a reply chain" ) ;
307+ } ,
308+ ) ;
297309
298310 test ( "should be rendered, play, and support replying on a thread" , async ( { page, app } ) => {
299311 await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
0 commit comments