Skip to content

Commit

Permalink
test: add cypress test for notification panel functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrkollar committed Aug 6, 2024
1 parent fbe3ff0 commit 9f16410
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
56 changes: 56 additions & 0 deletions cypress/e2e/ui/notification-panel.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/// <reference types="cypress" />

Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})

describe('Check notification panel functionality', () => {
it('Set Data', () => {
cy.fixture('baseurl').then((data) => {
cy.visit(data.baseurl)
})
cy.setZclProperties()
})
it(
'Open notification panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('not.have.class', ' q-layout--prevent-focus')
}
)
it('Check active status on navbar', () => {
cy.get('#Notifications').should('have.class', 'navmenu-item--active')
})
it(
'Close notification panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('have.class', 'q-layout--prevent-focus')
}
)
it(
'Open notification panel and open preview panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('not.have.class', 'q-layout--prevent-focus')
cy.get('#Preview').click()
cy.get('#NotificationPanel')
.parent()
.should('have.class', 'q-layout--prevent-focus')
}
)
})
1 change: 1 addition & 0 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
side="right"
:breakpoint="0"
class="bg-glass column"
id="NotificationPanel"
>
<NotificationPage />
</q-drawer>
Expand Down

0 comments on commit 9f16410

Please sign in to comment.