Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #1346

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 8 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,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() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/non-dav-files.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/visual-regression.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down
Binary file modified cypress/snapshots/base/visual-regression.cy.js/image-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/base/visual-regression.cy.js/image2-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/base/visual-regression.cy.js/non-dav-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.