@@ -104,6 +104,8 @@ const checkAttachment = (documentId, fileName, fileId, index, isImage = true) =>
104104 const srcFileNameParam = isImage ? 'imageFileName' : 'mediaFileName'
105105
106106 cy . wrap ( $el )
107+ // ensure the image is not hidden behind the menu bar.
108+ . scrollIntoView ( { offset : { top : - 50 , left : 0 } } )
107109 . should ( 'be.visible' )
108110 . find ( 'img' )
109111 . should ( 'have.attr' , 'src' )
@@ -220,6 +222,7 @@ describe('Test all attachment insertion methods', () => {
220222
221223 return waitForRequestAndCheckAttachment ( requestAlias )
222224 } )
225+ cy . closeFile ( )
223226 } )
224227
225228 it ( 'Upload a local image file (table.png)' , ( ) => {
@@ -236,6 +239,7 @@ describe('Test all attachment insertion methods', () => {
236239
237240 return waitForRequestAndCheckAttachment ( requestAlias )
238241 } )
242+ cy . closeFile ( )
239243 } )
240244
241245 it ( 'Upload a local media file (file.txt.gz)' , ( ) => {
@@ -252,6 +256,7 @@ describe('Test all attachment insertion methods', () => {
252256
253257 return waitForRequestAndCheckAttachment ( requestAlias , undefined , false )
254258 } )
259+ cy . closeFile ( )
255260 } )
256261
257262 it ( 'Upload image files with the same name' , ( ) => {
@@ -280,8 +285,9 @@ describe('Test all attachment insertion methods', () => {
280285 assertImage ( index ) . then ( resolve , reject )
281286 } )
282287 } )
283- return cy . getEditor ( ) . find ( '[data-component="image-view"]' )
288+ cy . getEditor ( ) . find ( '[data-component="image-view"]' )
284289 . should ( 'have.length' , 3 )
290+ cy . closeFile ( )
285291 } )
286292
287293 it ( 'test if attachment files are in the attachment folder' , ( ) => {
0 commit comments