From 62b02ef01a4404192d97e9b763d1a2e293e96965 Mon Sep 17 00:00:00 2001 From: duncdrum Date: Wed, 20 Dec 2023 13:03:46 +0100 Subject: [PATCH] test(first_run): load modals test initial load scenarios see #652 --- cypress/e2e/initial_run.spec.js | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cypress/e2e/initial_run.spec.js diff --git a/cypress/e2e/initial_run.spec.js b/cypress/e2e/initial_run.spec.js new file mode 100644 index 00000000..744f3acd --- /dev/null +++ b/cypress/e2e/initial_run.spec.js @@ -0,0 +1,48 @@ +describe('eXide initial run', () => { + // {testIsolation: false} + beforeEach('load eXide', () => { + // Go to eXide + cy.visit('/index.html') + }) + + // TODO(DP) force clicking in L16 below should not be necessary + // see #652 + it('should display welcome dialog in fresh browser', () => { + cy.clearAllLocalStorage() + cy.get('#dialog-startup') + .should('be.visible') + .contains('Getting Help') + .parents("div.ui-dialog ").within(() => { + cy.get("div.ui-dialog-buttonset button").click({ force: true }) + }) + cy.reload() + cy.get('#dialog-startup') + .should('not.be.visible') + }) + + // reload as local storage has been purged + it('should just show new document', () => { + cy.reload() + cy.get('#dialog-startup') + .should('not.be.visible') + cy.get("#ui-id-1") + .should('not.be.visible') + cy.get('.ace_content') + .contains('xquery version') + cy.get('.path') + cy.contains('__new__1') + .should('be.visible') + }) + + // + it('should display version note', () => { + cy.get("#ui-id-1") + .should('be.visible') + .contains('Version Note') + .parents("div.ui-dialog ").within(() => { + cy.get("div.ui-dialog-buttonset button").click() + }) + cy.get("#ui-id-1") + .should('not.be.visible') + }) +}) \ No newline at end of file