Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] ci: Attempt to make cypress tests more stable with a unified wait for close #4287

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cypress-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 @@ -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 })
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 @@ -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')
})
})
})
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 @@ -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() {
Expand All @@ -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')
})
})
3 changes: 1 addition & 2 deletions cypress/e2e/share-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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 @@ -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) {
Expand Down
Loading