diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 9ebd473044..b8fb311015 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -19,7 +19,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 b02806b954..8e5fdc273c 100644 --- a/cypress/e2e/integration.spec.js +++ b/cypress/e2e/integration.spec.js @@ -93,8 +93,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() diff --git a/cypress/e2e/new.spec.js b/cypress/e2e/new.spec.js index 3254b76903..1217885494 100644 --- a/cypress/e2e/new.spec.js +++ b/cypress/e2e/new.spec.js @@ -76,8 +76,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 4331d8a5ae..d94c90a298 100644 --- a/cypress/e2e/share-internal.spec.js +++ b/cypress/e2e/share-internal.spec.js @@ -53,8 +53,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() { @@ -76,7 +76,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 186d57a2ca..d0050f5ddc 100644 --- a/cypress/e2e/share-link.js +++ b/cypress/e2e/share-link.js @@ -129,7 +129,6 @@ function waitForCollabora() { cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() + cy.waitForViewerClose() }) - - cy.get('#viewer', { timeout: 5000 }).should('not.exist') -} \ No newline at end of file +} diff --git a/cypress/support/commands.js b/cypress/support/commands.js index bf349140eb..27da30e0c5 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -244,6 +244,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) {