diff --git a/cypress/e2e/apply_configuration.cy.js b/cypress/e2e/apply_configuration.cy.js index 9a2e43f9..85e17b26 100644 --- a/cypress/e2e/apply_configuration.cy.js +++ b/cypress/e2e/apply_configuration.cy.js @@ -51,12 +51,15 @@ describe('Apply configuration', () => { * The open-dialog is non-modal (wrapped in a
). */ function waitForSaveDialog() { - cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 5000 }) + cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 10000 }) .should('have.attr', 'open') } function saveDialogShouldBeClosed() { - cy.get('#open-dialog').closest('.eXide-dialog') + // The dialog closes only once the save round trip returns, so this waits on + // the server, not on the DOM. Cypress's 4s default is too tight for the + // first save against a freshly started instance. + cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 10000 }) .should('not.have.attr', 'open') } @@ -150,14 +153,14 @@ describe('Apply configuration', () => { // waitForSaveDialog() // Toast should confirm save - cy.get('.eXide-toast', { timeout: 5000 }).should('contain', 'stored') + cy.get('.eXide-toast', { timeout: 10000 }).should('contain', 'stored') // Dialog should have opened waitForApplyConfigDialog() // Toast should confirm application of configuration - cy.get('.eXide-toast', { timeout: 5000 }).should('contain', 'Configuration applied.') + cy.get('.eXide-toast', { timeout: 10000 }).should('contain', 'Configuration applied.') // Dialog should not have opened saveDialogShouldBeClosed() diff --git a/cypress/e2e/autocomplete_spec.cy.js b/cypress/e2e/autocomplete_spec.cy.js index 68a3f894..74615d46 100644 --- a/cypress/e2e/autocomplete_spec.cy.js +++ b/cypress/e2e/autocomplete_spec.cy.js @@ -76,7 +76,7 @@ describe('Autocomplete', () => { if (!lspAvailable) this.skip() setContentAndComplete('util:wai') - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'util:wait') @@ -88,7 +88,7 @@ describe('Autocomplete', () => { setContentAndComplete('util:wai') cy.wait('@completions', { timeout: 10000 }) - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'util:wait') @@ -105,7 +105,7 @@ describe('Autocomplete', () => { // "let $myVar := 42\nreturn $myVar" — cursor at pos 27 = after "$my" setContentAndComplete('let $myVar := 42\nreturn $myVar', 27) - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', '$myVar') @@ -117,7 +117,7 @@ describe('Autocomplete', () => { setContentAndComplete('util:') cy.wait('@completions', { timeout: 10000 }) - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'util:') @@ -142,7 +142,7 @@ describe('Autocomplete', () => { // Typing "conc" without "fn:" should suggest fn:concat via default namespace lookup setContentAndComplete('conc') - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'concat') @@ -154,7 +154,7 @@ describe('Autocomplete', () => { setContentAndComplete('conc') cy.wait('@completions', { timeout: 10000 }) - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'concat') @@ -171,7 +171,7 @@ describe('Autocomplete', () => { if (!lspAvailable) this.skip() setContentAndComplete('fn:conc') - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'fn:concat') @@ -183,7 +183,7 @@ describe('Autocomplete', () => { setContentAndComplete('fn:conc') cy.wait('@completions', { timeout: 10000 }) - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'fn:concat') @@ -198,7 +198,7 @@ describe('Autocomplete', () => { if (!lspAvailable) this.skip() setContentAndComplete('repo:') - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'repo:deploy') @@ -209,7 +209,7 @@ describe('Autocomplete', () => { if (!lspAvailable) this.skip() setContentAndComplete('repo') - cy.get('.cm-tooltip-autocomplete', { timeout: 5000 }) + cy.get('.cm-tooltip-autocomplete', { timeout: 10000 }) .should('be.visible') .invoke('text') .should('contain', 'repo:') diff --git a/cypress/e2e/file_save_spec.cy.js b/cypress/e2e/file_save_spec.cy.js index 3166f064..e03c3638 100644 --- a/cypress/e2e/file_save_spec.cy.js +++ b/cypress/e2e/file_save_spec.cy.js @@ -27,12 +27,13 @@ describe('File save', () => { * The open-dialog is non-modal (wrapped in a
). */ function waitForSaveDialog() { - cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 5000 }) + cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 10000 }) .should('have.attr', 'open') } function saveDialogShouldBeClosed() { - cy.get('#open-dialog').closest('.eXide-dialog') + // Waits on the save round trip — see the note in apply_configuration. + cy.get('#open-dialog').closest('.eXide-dialog', { timeout: 10000 }) .should('not.have.attr', 'open') } @@ -76,7 +77,7 @@ describe('File save', () => { // Dialog should close and path should update saveDialogShouldBeClosed() - cy.get('.path', { timeout: 5000 }).should('contain', testFile) + cy.get('.path', { timeout: 10000 }).should('contain', testFile) }) it('saves an existing document without opening dialog', () => { @@ -91,7 +92,7 @@ describe('File save', () => { cy.get('#save').click() // Toast should confirm save - cy.get('.eXide-toast', { timeout: 5000 }).should('contain', 'stored') + cy.get('.eXide-toast', { timeout: 10000 }).should('contain', 'stored') // Dialog should not have opened saveDialogShouldBeClosed() diff --git a/cypress/e2e/websocket_spec.cy.js b/cypress/e2e/websocket_spec.cy.js index d29e7eee..7aa62e01 100644 --- a/cypress/e2e/websocket_spec.cy.js +++ b/cypress/e2e/websocket_spec.cy.js @@ -67,7 +67,7 @@ describe('WebSocket transport', () => { failOnStatusCode: false }).then(() => { // Retry until WebSocket delivers the message - cy.wrap(null, { timeout: 5000 }).should(() => { + cy.wrap(null, { timeout: 15000 }).should(() => { expect(received).to.not.be.null expect(received.type).to.eq("exist/metrics") expect(received.version).to.be.a("string") @@ -92,7 +92,7 @@ describe('WebSocket transport', () => { body: { query: 'let $x := retrun $x', base: 'xmldb:exist:///db', uri: 'test.xq' }, failOnStatusCode: false }).then(() => { - cy.wrap(null, { timeout: 5000 }).should(() => { + cy.wrap(null, { timeout: 15000 }).should(() => { expect(received).to.not.be.null expect(received.type).to.eq("textDocument/publishDiagnostics") expect(received.uri).to.eq("test.xq")