diff --git a/cypress/e2e/files/files_copy-move.cy.ts b/cypress/e2e/files/files_copy-move.cy.ts index 7fd1b66e350..17a9213f427 100644 --- a/cypress/e2e/files/files_copy-move.cy.ts +++ b/cypress/e2e/files/files_copy-move.cy.ts @@ -47,6 +47,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { cy.login(currentUser) cy.visit('/apps/files') + // intercept the move so we can wait for it + cy.intercept('COPY', /\/remote.php\/dav\/files\//).as('copyFile') + getRowForFile('original.txt').should('be.visible') triggerActionForFile('original.txt', 'move-copy') @@ -55,6 +58,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { // click copy cy.get('.file-picker').contains('button', 'Copy to new-folder').should('be.visible').click() + // wait for copy to finish + cy.wait('@copyFile') + getRowForFile('new-folder').find('[data-cy-files-list-row-name-link]').click() cy.url().should('contain', 'dir=/new-folder') @@ -68,6 +74,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { cy.login(currentUser) cy.visit('/apps/files') + // intercept the move so we can wait for it + cy.intercept('MOVE', /\/remote.php\/dav\/files\//).as('moveFile') + getRowForFile('original.txt').should('be.visible') triggerActionForFile('original.txt', 'move-copy') @@ -76,6 +85,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { // click copy cy.get('.file-picker').contains('button', 'Move to new-folder').should('be.visible').click() + // wait for move to finish + cy.wait('@moveFile') + // wait until visible again getRowForFile('new-folder').should('be.visible') // original should be moved -> not exist anymore @@ -94,7 +106,7 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { cy.login(currentUser) cy.visit('/apps/files') - // intercept the copy so we can wait for it + // intercept the move so we can wait for it cy.intercept('MOVE', /\/remote.php\/dav\/files\//).as('moveFile') getRowForFile('original').should('be.visible') @@ -124,6 +136,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { cy.login(currentUser) cy.visit('/apps/files') + // intercept the move so we can wait for it + cy.intercept('MOVE', /\/remote.php\/dav\/files\//).as('moveFile') + getRowForFile('new-folder').should('be.visible').find('[data-cy-files-list-row-name-link]').click() cy.url().should('contain', 'dir=/new-folder') @@ -135,6 +150,9 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { // click move cy.get('.file-picker').contains('button', 'Move').should('be.visible').click() + // wait for move to finish + cy.wait('@moveFile') + // wait until visible again cy.get('main').contains('No files in here').should('be.visible') // original should be moved -> not exist anymore