Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 23, 2022
1 parent 9320acb commit 5e46b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/download-share-disabled.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

Expand Down
9 changes: 6 additions & 3 deletions cypress/e2e/download-share.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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}`)
})
Expand All @@ -80,13 +83,13 @@ 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() {
// 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() {
Expand Down

0 comments on commit 5e46b25

Please sign in to comment.