Skip to content

Commit

Permalink
test(cy): also test failed reconnect attempt
Browse files Browse the repository at this point in the history
Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Jul 2, 2024
1 parent eb9dcbb commit 97da812
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cypress/e2e/sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ describe('Sync', () => {
.should('contain', 'Document could not be loaded.')
cy.get('#editor-container .document-status')
.find('.button.primary').click()
cy.intercept('**/apps/text/session/*/*', req => {
if (req.url.endsWith('create')) {
req.alias = 'create'
}
req.continue()
}).as('alive')
cy.get('.toastify').should('contain', 'Connection failed.')
cy.get('.toastify', { timeout: 30000 }).should('not.exist')
cy.get('#editor-container .document-status', { timeout: 30000 })
.should('contain', 'Document could not be loaded.')
// bring back the network connection
cy.intercept('**/apps/text/session/*/*', req => { req.continue() }).as('alive')
cy.intercept('**/apps/text/session/*/create').as('create')
cy.get('#editor-container .document-status')
.find('.button.primary').click()
cy.wait('@alive', { timeout: 30000 })
cy.wait('@create', { timeout: 10000 })
.its('request.body')
Expand Down

0 comments on commit 97da812

Please sign in to comment.