@@ -134,18 +134,22 @@ test.describe("Audio player", () => {
134
134
) . toBeVisible ( ) ;
135
135
} ) ;
136
136
137
- test ( "should be correctly rendered - light theme" , async ( { page, app } ) => {
137
+ test ( "should be correctly rendered - light theme" , { tag : "@screenshot" } , async ( { page, app } ) => {
138
138
await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
139
139
await takeSnapshots ( page , app , "Selected EventTile of audio player (light theme)" ) ;
140
140
} ) ;
141
141
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" ) ;
144
147
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
+ ) ;
147
151
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 } ) => {
149
153
// Disable system theme in case ThemeWatcher enables the theme automatically,
150
154
// so that the high contrast theme can be enabled
151
155
await app . settings . setValue ( "use_system_theme" , null , SettingLevel . DEVICE , false ) ;
@@ -161,7 +165,7 @@ test.describe("Audio player", () => {
161
165
await takeSnapshots ( page , app , "Selected EventTile of audio player (high contrast)" ) ;
162
166
} ) ;
163
167
164
- test ( "should be correctly rendered - dark theme" , async ( { page, app } ) => {
168
+ test ( "should be correctly rendered - dark theme" , { tag : "@screenshot" } , async ( { page, app } ) => {
165
169
// Enable dark theme
166
170
await app . settings . setValue ( "theme" , null , SettingLevel . ACCOUNT , "dark" ) ;
167
171
@@ -207,93 +211,101 @@ test.describe("Audio player", () => {
207
211
expect ( download . suggestedFilename ( ) ) . toBe ( "1sec.ogg" ) ;
208
212
} ) ;
209
213
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" ) ;
212
219
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 ( ) ;
215
222
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 ( ) ;
220
227
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" ) ;
223
230
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 ( ) ;
226
233
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 ( ) ;
231
238
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
+ ) ;
234
242
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.
240
251
241
- const tile = page . locator ( ".mx_EventTile_last" ) ;
252
+ const tile = page . locator ( ".mx_EventTile_last" ) ;
242
253
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
+ } ;
249
260
250
- await uploadFile ( page , "playwright/sample-files/upload-first.ogg" ) ;
261
+ await uploadFile ( page , "playwright/sample-files/upload-first.ogg" ) ;
251
262
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 ( ) ;
254
265
255
- await clickButtonReply ( ) ;
266
+ await clickButtonReply ( ) ;
256
267
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" ) ;
259
270
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 ( ) ;
262
273
263
- await clickButtonReply ( ) ;
274
+ await clickButtonReply ( ) ;
264
275
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" ) ;
267
278
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 ( ) ;
270
281
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 ) ;
273
284
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 ( ) ;
276
287
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 ( ) ;
279
290
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 ( ) ;
282
293
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 ( ) ;
286
297
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 ( ) ;
293
304
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
+ ) ;
297
309
298
310
test ( "should be rendered, play, and support replying on a thread" , async ( { page, app } ) => {
299
311
await uploadFile ( page , "playwright/sample-files/1sec-long-name-audio-file.ogg" ) ;
0 commit comments