mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix(cypress): Await copy move request to avoid flaky CI
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
02432159f5
commit
4b3e6eabab
1 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue