Skip to content

Commit 5e46b25

Browse files
committed
Fix tests
Signed-off-by: John Molakvoæ <[email protected]>
1 parent 9320acb commit 5e46b25

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cypress/e2e/download-share-disabled.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe(`Download ${fileName} in viewer`, function() {
9292

9393
it('See the title on the viewer header but not the Download button', function() {
9494
cy.get('body > .viewer .modal-title').should('contain', 'image1.jpg')
95-
cy.get('body > .viewer .modal-header button.action-item > .download-icon').should('not.exist')
95+
cy.get('body > .viewer .modal-header a.action-item .download-icon').should('not.exist')
9696
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
9797
})
9898

cypress/e2e/download-share.cy.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const randUser = randHash()
2727
const fileName = 'image1.jpg'
2828

2929
describe(`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

Comments
 (0)