Skip to content
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
12 changes: 6 additions & 6 deletions cypress/integration/files-shares.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -139,7 +139,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -157,7 +157,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -178,7 +178,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -196,7 +196,7 @@ describe('See shared folder with link share', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/image-small.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open image-small.png in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/image.gif.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Open image.gif in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/image.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open image.png in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/image.svg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Open image.svg in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/images-custom-list-loadmore.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -172,7 +172,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -190,7 +190,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -208,7 +208,7 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/images-custom-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Open custom images list in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('Open custom images list in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -145,7 +145,7 @@ describe('Open custom images list in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/images.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Open images in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('Open images in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -110,7 +110,7 @@ describe('Open images in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -129,7 +129,7 @@ describe('Open images in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -147,7 +147,7 @@ describe('Open images in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/sidebar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Open the sidebar from the viewer and open viewer with sidebar already
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('Open the sidebar from the viewer and open viewer with sidebar already
cy.get('#fileList tr[data-file="image1.jpg"] .date .modified').click()

cy.openFile('image1.jpg')
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/video.mkv.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open video.mkv in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/video.mp4.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open video1.mp4 in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/video.ogv.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open video.ogv in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/video.webm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Open video.webm in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/videos.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('Open mp4 videos in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand All @@ -92,7 +92,7 @@ describe('Open mp4 videos in viewer', function() {
})

it('Does not see a loading animation', function() {
cy.get('#viewer-content', { timeout: 4000 })
cy.get('#viewer-content', { timeout: 10000 })
.should('be.visible')
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
Expand Down
20 changes: 13 additions & 7 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'

addMatchImageSnapshotCommand()

Expand All @@ -32,7 +31,7 @@ Cypress.env('baseUrl', url)
Cypress.Commands.add('login', (user, password, route = '/apps/files') => {
cy.clearCookies()
Cypress.Cookies.defaults({
whitelist: /^(oc|nc)/
preserve: /^(oc|nc)/,
})
cy.visit(route)
cy.get('input[name=user]').type(user)
Expand Down Expand Up @@ -71,11 +70,13 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
})

Cypress.Commands.add('uploadFile', (fileName, mimeType, path = '') => {
cy.fixture(fileName, 'base64')
.then(Cypress.Blob.base64StringToBlob)
.then(async blob => {
// get fixture
return cy.fixture(fileName, 'base64').then(file => {
// convert the logo base64 string to a blob
const blob = Cypress.Blob.base64StringToBlob(file, mimeType)
try {
const file = new File([blob], fileName, { type: mimeType })
await cy.window().then(async window => {
return cy.window().then(async window => {
await axios.put(`${Cypress.env('baseUrl')}/remote.php/webdav${path}/${fileName}`, file, {
headers: {
requesttoken: window.OC.requestToken,
Expand All @@ -85,7 +86,12 @@ Cypress.Commands.add('uploadFile', (fileName, mimeType, path = '') => {
cy.log(`Uploaded ${fileName}`, response)
})
})
})
} catch (error) {
cy.log(error)
throw new Error(`Unable to process file ${fileName}`)
}
})

})

Cypress.Commands.add('createFolder', dirName => {
Expand Down
Loading