diff --git a/cypress/e2e/download-share-disabled.cy.js b/cypress/e2e/download-share-disabled.cy.js index 04e94c70f..a0fe773a4 100644 --- a/cypress/e2e/download-share-disabled.cy.js +++ b/cypress/e2e/download-share-disabled.cy.js @@ -92,7 +92,7 @@ describe(`Download ${fileName} in viewer`, function() { it('See the title on the viewer header but not the Download button', function() { cy.get('body > .viewer .modal-title').should('contain', 'image1.jpg') - cy.get('body > .viewer .modal-header button.action-item > .download-icon').should('not.exist') + cy.get('body > .viewer .modal-header a.action-item .download-icon').should('not.exist') cy.get('body > .viewer .modal-header button.header-close').should('be.visible') }) diff --git a/cypress/e2e/download-share.cy.js b/cypress/e2e/download-share.cy.js index f60a376d1..cb15271e4 100644 --- a/cypress/e2e/download-share.cy.js +++ b/cypress/e2e/download-share.cy.js @@ -27,6 +27,8 @@ const randUser = randHash() const fileName = 'image1.jpg' describe(`Download ${fileName} from viewer in link share`, function() { + let token = null + before(function() { // Init user cy.nextcloudCreateUser(randUser, 'password') @@ -60,7 +62,8 @@ describe(`Download ${fileName} from viewer in link share`, function() { }) it('Share the Photos folder with a share link and access the share link', function() { - cy.createLinkShare('/Photos').then(token => { + cy.createLinkShare('/Photos').then(newToken => { + token = newToken cy.logout() cy.visit(`/s/${token}`) }) @@ -80,13 +83,15 @@ describe(`Download ${fileName} from viewer in link share`, function() { it('See the download icon and title on the viewer header', function() { cy.get('body > .viewer .modal-title').should('contain', 'image1.jpg') - cy.get('body > .viewer .modal-header button.action-item > .download-icon').should('be.visible') + cy.get(`body > .viewer .modal-header a.action-item[href*='/s/${token}/download']`).should('be.visible') cy.get('body > .viewer .modal-header button.header-close').should('be.visible') }) it('Download the image', function() { + // https://github.com/cypress-io/cypress/issues/14857 + cy.window().then((win) => { setTimeout(() => { win.location.reload() }, 5000) }) // download the file - cy.get('body > .viewer .modal-header button.action-item > .download-icon').click() + cy.get('body > .viewer .modal-header a.action-item .download-icon').click() }) it('Compare downloaded file with asset by size', function() { diff --git a/cypress/e2e/non-dav-files.cy.js b/cypress/e2e/non-dav-files.cy.js index 4f387a24f..9115429d9 100644 --- a/cypress/e2e/non-dav-files.cy.js +++ b/cypress/e2e/non-dav-files.cy.js @@ -39,10 +39,10 @@ describe('Open non-dav files in viewer', function() { it('Open login background', function() { const fileInfo = { - filename: '/core/img/logo/logo.png', + filename: '/core/img/app-background.png', basename: 'logo.png', mime: 'image/png', - source: '/core/img/logo/logo.png', + source: '/core/img/app-background.png', etag: 'abc', hasPreview: false, fileid: 123, diff --git a/cypress/e2e/visual-regression.cy.js b/cypress/e2e/visual-regression.cy.js index 453c92a3a..dcdc02599 100644 --- a/cypress/e2e/visual-regression.cy.js +++ b/cypress/e2e/visual-regression.cy.js @@ -86,7 +86,7 @@ describe('Visual regression tests ', function() { }) it('Show second file on next', function() { - cy.get('body > .viewer a.next').click() + cy.get('body > .viewer button.next').click() cy.get('body > .viewer .modal-container img').should('have.length', 1) cy.get('body > .viewer .modal-container img').should('have.attr', 'src') cy.get('body > .viewer button.prev').should('be.visible') @@ -129,10 +129,10 @@ describe('Visual regression tests ', function() { it('Open non-dav image', function() { const fileInfo = { - filename: '/core/img/logo/logo.png', - basename: 'logo.png', + filename: '/core/img/favicon.png', + basename: 'favicon.png', mime: 'image/png', - source: '/core/img/logo/logo.png', + source: '/core/img/favicon.png', etag: 'abc', hasPreview: false, fileid: 123, diff --git a/cypress/snapshots/base/visual-regression.cy.js/image-base.png b/cypress/snapshots/base/visual-regression.cy.js/image-base.png index 43ccb1674..d67c80202 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/image-base.png and b/cypress/snapshots/base/visual-regression.cy.js/image-base.png differ diff --git a/cypress/snapshots/base/visual-regression.cy.js/image2-base.png b/cypress/snapshots/base/visual-regression.cy.js/image2-base.png index 866d966d5..2b3242078 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/image2-base.png and b/cypress/snapshots/base/visual-regression.cy.js/image2-base.png differ diff --git a/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png b/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png index f530bbf7d..c0101f84d 100644 Binary files a/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png and b/cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png differ