diff --git a/.github/workflows/cypress-e2e.yml b/.github/workflows/cypress-e2e.yml index 350e96bcd4..38b38ac29b 100644 --- a/.github/workflows/cypress-e2e.yml +++ b/.github/workflows/cypress-e2e.yml @@ -21,7 +21,7 @@ env: jobs: cypress: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/cypress/e2e/integration.spec.js b/cypress/e2e/integration.spec.js index e031596592..4d98c1fd82 100644 --- a/cypress/e2e/integration.spec.js +++ b/cypress/e2e/integration.spec.js @@ -79,8 +79,8 @@ describe('Nextcloud integration', function() { cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - cy.get('#viewer', { timeout: 5000 }).should('not.exist') // FIXME: We should not need to reload cy.get('.breadcrumb__crumbs a').eq(0).click({ force: true }) diff --git a/cypress/e2e/new.spec.js b/cypress/e2e/new.spec.js index 4f8cd4524b..f68ba52ffb 100644 --- a/cypress/e2e/new.spec.js +++ b/cypress/e2e/new.spec.js @@ -62,8 +62,8 @@ describe.skip('Create new office files', function() { cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - cy.get('#viewer', { timeout: 5000 }).should('not.exist') }) }) }) diff --git a/cypress/e2e/share-federated.spec.js b/cypress/e2e/share-federated.spec.js index 52f7c71587..9bdfa146fb 100644 --- a/cypress/e2e/share-federated.spec.js +++ b/cypress/e2e/share-federated.spec.js @@ -35,7 +35,7 @@ describe('Federated sharing of office documents', function() { cy.waitForViewer() cy.waitForCollabora(true, true).within(() => { cy.get('#closebutton').click() - cy.get('#viewer', { timeout: 5000 }).should('not.exist') + cy.waitForViewerClose() }) }) diff --git a/cypress/e2e/share-internal.spec.js b/cypress/e2e/share-internal.spec.js index 5ffd6a0049..e66572e881 100644 --- a/cypress/e2e/share-internal.spec.js +++ b/cypress/e2e/share-internal.spec.js @@ -38,8 +38,8 @@ describe('File sharing of office documents', function() { // Validate closing cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - cy.get('#viewer', { timeout: 5000 }).should('not.exist') }) it('Open a shared file as readonly', function() { @@ -61,7 +61,7 @@ describe('File sharing of office documents', function() { // Validate closing cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - cy.get('#viewer', { timeout: 5000 }).should('not.exist') }) }) diff --git a/cypress/e2e/share-link.js b/cypress/e2e/share-link.js index b84d33cdd0..b9c8addcbc 100644 --- a/cypress/e2e/share-link.js +++ b/cypress/e2e/share-link.js @@ -117,7 +117,6 @@ function waitForCollabora() { cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - - cy.get('#viewer', { timeout: 5000 }).should('not.exist') } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 069ad76888..8e840b782d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -229,6 +229,11 @@ Cypress.Commands.add('waitForViewer', () => { .and('not.have.class', 'icon-loading') }) +Cypress.Commands.add('waitForViewerClose', () => { + cy.get('#viewer', { timeout: 30000 }) + .should('not.exist') +}) + Cypress.Commands.add('waitForCollabora', (wrapped = false, federated = false) => { const wrappedFrameIdentifier = federated ? 'coolframe' : 'documentframe' if (wrapped) {