Skip to content

Commit

Permalink
test(first_run): load modals
Browse files Browse the repository at this point in the history
test initial load scenarios

see eXist-db#652
  • Loading branch information
duncdrum committed Dec 20, 2023
1 parent b8e593a commit 62b02ef
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions cypress/e2e/initial_run.spec.js
Original file line number Diff line number Diff line change
@@ -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')
})
})

0 comments on commit 62b02ef

Please sign in to comment.