diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-26 16:25:43 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-26 16:25:43 +0100 |
commit | 4b3e6eabab4b112135ea955929c165371ef066e3 (patch) | |
tree | f77b2bf8e0f6a37291821230e85b2f6fe978a0e9 /cypress | |
parent | 02432159f5e065f43b608ceb38df5513fd221efa (diff) | |
download | nextcloud-server-4b3e6eabab4b112135ea955929c165371ef066e3.tar.gz nextcloud-server-4b3e6eabab4b112135ea955929c165371ef066e3.zip |
fix(cypress): Await copy move request to avoid flaky CI
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/files/files_copy-move.cy.ts | 20 |
1 files changed, 19 insertions, 1 deletions
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 |