@@ -103,6 +103,9 @@ const checkAttachment = (documentId, fileName, fileId, index, isImage = true) =>
103103 const srcPathEnd = isImage ? 'image' : 'mediaPreview'
104104 const srcFileNameParam = isImage ? 'imageFileName' : 'mediaFileName'
105105
106+ // ensure the image is not hidden behind the menu bar.
107+ cy . wrap ( $el ) . scrollIntoView ( { offset : { top : - 50 , left : 0 } } )
108+
106109 cy . wrap ( $el )
107110 . should ( 'be.visible' )
108111 . find ( 'img' )
@@ -220,6 +223,7 @@ describe('Test all attachment insertion methods', () => {
220223
221224 return waitForRequestAndCheckAttachment ( requestAlias )
222225 } )
226+ cy . closeFile ( )
223227 } )
224228
225229 it ( 'Upload a local image file (table.png)' , ( ) => {
@@ -236,6 +240,7 @@ describe('Test all attachment insertion methods', () => {
236240
237241 return waitForRequestAndCheckAttachment ( requestAlias )
238242 } )
243+ cy . closeFile ( )
239244 } )
240245
241246 it ( 'Upload a local media file (file.txt.gz)' , ( ) => {
@@ -252,6 +257,7 @@ describe('Test all attachment insertion methods', () => {
252257
253258 return waitForRequestAndCheckAttachment ( requestAlias , undefined , false )
254259 } )
260+ cy . closeFile ( )
255261 } )
256262
257263 it ( 'Upload image files with the same name' , ( ) => {
@@ -280,8 +286,9 @@ describe('Test all attachment insertion methods', () => {
280286 assertImage ( index ) . then ( resolve , reject )
281287 } )
282288 } )
283- return cy . getEditor ( ) . find ( '[data-component="image-view"]' )
289+ cy . getEditor ( ) . find ( '[data-component="image-view"]' )
284290 . should ( 'have.length' , 3 )
291+ cy . closeFile ( )
285292 } )
286293
287294 it ( 'test if attachment files are in the attachment folder' , ( ) => {
0 commit comments