2021-08-13 08:29:50 +00:00
|
|
|
describe('Editor- Add "PostgreSQL" datasource', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
//read login data from fixtures
|
|
|
|
|
cy.fixture('login-data').then(function (testdata) {
|
2021-09-12 04:22:29 +00:00
|
|
|
cy.login(testdata.email, testdata.password);
|
|
|
|
|
});
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
cy.createAppIfEmptyDashboard();
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
cy.get('.badge').contains('Edit').click();
|
|
|
|
|
cy.get('title').should('have.text', 'ToolJet - Dashboard');
|
|
|
|
|
});
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
it.only('should add First data source successfully', () => {
|
|
|
|
|
//test database icon
|
2021-08-13 08:29:50 +00:00
|
|
|
cy.get('.left-sidebar')
|
2021-09-15 02:51:56 +00:00
|
|
|
.find('.svg-icon[src="/assets/images/icons/editor/left-sidebar/database.svg"]')
|
|
|
|
|
.should('be.visible')
|
|
|
|
|
.click()
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
cy.get('.table-responsive')
|
|
|
|
|
.find('.p-2')
|
|
|
|
|
.should('have.text', "You haven't added any datasources yet. ")
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
cy.get('div[class="table-responsive"] button[class="btn btn-sm btn-outline-azure mt-3"]')
|
|
|
|
|
.should('have.text', 'Add datasource')
|
2021-09-12 04:22:29 +00:00
|
|
|
.click();
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
//create database
|
2021-09-12 04:22:29 +00:00
|
|
|
cy.addPostgresDataSource();
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
//verify if you can see postgres database in the list now.
|
2021-08-13 08:29:50 +00:00
|
|
|
cy.get('.left-sidebar')
|
2021-09-15 02:51:56 +00:00
|
|
|
.find('.svg-icon[src="/assets/images/icons/editor/left-sidebar/database.svg"]')
|
|
|
|
|
.should('be.visible')
|
|
|
|
|
.click()
|
2021-08-13 08:29:50 +00:00
|
|
|
|
2021-09-15 02:51:56 +00:00
|
|
|
cy.get('.table-responsive')
|
|
|
|
|
.find('tr td')
|
|
|
|
|
.contains('PostgreSQL')
|
2021-08-13 08:29:50 +00:00
|
|
|
});
|
2021-09-15 02:51:56 +00:00
|
|
|
});
|