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] Test to add postgres db in editor (ToolJet#484)
1. Added test file- 'editor-datasource-postgres.spec.js' 2. Updated test file- 'editor-navigation-bar.spec.js' for latest changes in UI. 3. Updated commands.js file for common function to create postgres DB.
- Loading branch information
Mohini Dahiya
authored
Aug 13, 2021
1 parent
200cd9f
commit df04bb9
Showing
6 changed files
with
128 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe('Editor- Add "PostgreSQL" datasource', () => { | ||
|
||
beforeEach(() => { | ||
|
||
//read login data from fixtures | ||
cy.fixture('login-data').then(function (testdata) { | ||
cy.login(testdata.email, testdata.password) | ||
}) | ||
cy.wait(1000) | ||
cy.get('body').then(($title => { | ||
//check you are not running tests on empty dashboard state | ||
if ($title.text().includes('You haven\'t created any apps yet.')) { | ||
cy.get('a.btn').eq(0).should('have.text', 'Create your first app') | ||
.click() | ||
cy.go('back') | ||
} | ||
cy.wait(2000) | ||
cy.get('.badge').contains('Edit').click() | ||
cy.get('title').should('have.text', 'ToolJet - Dashboard') | ||
})) | ||
}) | ||
|
||
it('should add First data source successfully', () => { | ||
|
||
cy.get('.left-sidebar') | ||
.find('.datasources-container.w-100.mt-3') | ||
.find('.p-1.text-muted') | ||
.should('have.text', 'DATASOURCES') | ||
.and('be.visible') | ||
|
||
cy.get('.table-responsive') | ||
.find('.p-2') | ||
.should('include.text', "You haven't added data sources yet. ") | ||
|
||
cy.get('center[class="p-2 text-muted"]') | ||
.find('button[class="btn btn-sm btn-outline-azure mt-3"]') | ||
.should('have.text', 'add datasource') | ||
.click() | ||
|
||
cy.addPostgresDataSource() | ||
}); | ||
|
||
it('should add data source from "Add new datasource button', () => { | ||
|
||
cy.get('.left-sidebar') | ||
.find('.datasources-container.w-100.mt-3') | ||
.find('.p-1.text-muted') | ||
.should('have.text', 'DATASOURCES') | ||
.and('be.visible') | ||
|
||
cy.get('[data-tip="Add new datasource"]').click() | ||
|
||
cy.addPostgresDataSource() | ||
}); | ||
}) |
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
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