forked from ToolJet/ToolJet
-
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.
Cypress tests for empty dashboard state (ToolJet#409)
Modified dashboard.spec.js Added test file empty-state-dashboard.spec.js
- Loading branch information
Mohini Dahiya
authored
Jul 20, 2021
1 parent
946ccea
commit b806e87
Showing
3 changed files
with
68 additions
and
7 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
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
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,43 @@ | ||
describe('Empty state of dashboard', () => { | ||
|
||
const email = 'dev@tooljet.io'; | ||
const password = 'password'; | ||
|
||
beforeEach(() => { | ||
cy.login(email, password); | ||
}) | ||
|
||
|
||
it('should show empty screen when there are no apps', () => { | ||
|
||
cy.wait(1000) | ||
cy.get('body').then(($title=> | ||
{ | ||
//if user has not created any app yet | ||
if($title.text().includes('You haven\'t created any apps yet.')) | ||
{ | ||
//image for empty state should be visible | ||
cy.get('.empty-img').should('be.visible') | ||
|
||
//empty title should be visible | ||
cy.log('Testing empty state dashboard view.') | ||
cy.get('.empty-title').should('be.visible') | ||
.and('have.text','You haven\'t created any apps yet.') | ||
|
||
//Read Documentation button should be present and working | ||
cy.get('a.btn').eq(1).should('have.attr','href','https://docs.tooljet.io') | ||
.and('have.text','Read documentation') | ||
|
||
//test Create your first app button should be visible and working | ||
cy.get('a.btn').eq(0).should('be.visible') | ||
.and('have.text','Create your first app') | ||
.click() | ||
cy.get('title').should('have.text','ToolJet - Dashboard') | ||
} | ||
else | ||
{ | ||
cy.log("User has already created few apps hence this test will be skipped.") | ||
} | ||
})) | ||
}) | ||
}) |