Skip to content

Commit

Permalink
Merge pull request #4294 from nextcloud/backport/4285/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Nov 30, 2024
2 parents f42e52a + 740d08e commit f8148aa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
cypress:

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/new.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})
2 changes: 1 addition & 1 deletion cypress/e2e/share-federated.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/share-internal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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')
})
})
5 changes: 2 additions & 3 deletions cypress/e2e/share-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function waitForCollabora() {

cy.get('@loleafletframe').within(() => {
cy.get('#closebutton').click()
cy.waitForViewerClose()
})

cy.get('#viewer', { timeout: 5000 }).should('not.exist')
}
}
5 changes: 5 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f8148aa

Please sign in to comment.