forked from project-chip/zap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add cypress test for notification panel functionality.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
} | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters