@@ -27,6 +27,8 @@ const randUser = randHash()
2727const fileName = 'image1.jpg'
2828
2929describe ( `Download ${ fileName } from viewer in link share` , function ( ) {
30+ let token = null
31+
3032 before ( function ( ) {
3133 // Init user
3234 cy . nextcloudCreateUser ( randUser , 'password' )
@@ -60,7 +62,8 @@ describe(`Download ${fileName} from viewer in link share`, function() {
6062 } )
6163
6264 it ( 'Share the Photos folder with a share link and access the share link' , function ( ) {
63- cy . createLinkShare ( '/Photos' ) . then ( token => {
65+ cy . createLinkShare ( '/Photos' ) . then ( newToken => {
66+ token = newToken
6467 cy . logout ( )
6568 cy . visit ( `/s/${ token } ` )
6669 } )
@@ -80,13 +83,13 @@ describe(`Download ${fileName} from viewer in link share`, function() {
8083
8184 it ( 'See the download icon and title on the viewer header' , function ( ) {
8285 cy . get ( 'body > .viewer .modal-title' ) . should ( 'contain' , 'image1.jpg' )
83- cy . get ( ' body > .viewer .modal-header button .action-item > . download-icon' ) . should ( 'be.visible' )
86+ cy . get ( ` body > .viewer .modal-header a .action-item[href*='/s/ ${ token } / download']` ) . should ( 'be.visible' )
8487 cy . get ( 'body > .viewer .modal-header button.header-close' ) . should ( 'be.visible' )
8588 } )
8689
8790 it ( 'Download the image' , function ( ) {
8891 // download the file
89- cy . get ( 'body > .viewer .modal-header button .action-item > .download-icon' ) . click ( )
92+ cy . get ( 'body > .viewer .modal-header a .action-item .download-icon' ) . click ( )
9093 } )
9194
9295 it ( 'Compare downloaded file with asset by size' , function ( ) {
0 commit comments