ToolJet/cypress/integration/editor/editor-datasource-postgres.spec.js
Mohini Dahiya 80145bd315
[Cypress] Fix existing tests on Editor (#728)
* Test try git

* Updated 'editor-navigation-bar.spec.js' tests

Fixes #718
1. Removes test for hiding left sidebar.
2. Fixes test - resize canvas
3. Fixes test - switch to dark theme

* Updated index.js and cypress.json files

1. Added viewport to cypress.json file to support macbook pro 16.
2. Updated index.js file to do golobal import of cypress-drag-drop.
3. Merged custom method from dev branch to command.js file.

* Add cypress. reference type to index.js

* Fixes 'editor-datasource-postgres.spec.js'

1. Updated test with new UI changes.
2. Updated 'addPostgresDataSource' method in 'command.js' file to mark SSL box unchecked.
2021-09-15 08:21:56 +05:30

42 lines
No EOL
1.4 KiB
JavaScript

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.createAppIfEmptyDashboard();
cy.wait(2000);
cy.get('.badge').contains('Edit').click();
cy.get('title').should('have.text', 'ToolJet - Dashboard');
});
it.only('should add First data source successfully', () => {
//test database icon
cy.get('.left-sidebar')
.find('.svg-icon[src="/assets/images/icons/editor/left-sidebar/database.svg"]')
.should('be.visible')
.click()
cy.get('.table-responsive')
.find('.p-2')
.should('have.text', "You haven't added any datasources yet. ")
cy.get('div[class="table-responsive"] button[class="btn btn-sm btn-outline-azure mt-3"]')
.should('have.text', 'Add datasource')
.click();
//create database
cy.addPostgresDataSource();
//verify if you can see postgres database in the list now.
cy.get('.left-sidebar')
.find('.svg-icon[src="/assets/images/icons/editor/left-sidebar/database.svg"]')
.should('be.visible')
.click()
cy.get('.table-responsive')
.find('tr td')
.contains('PostgreSQL')
});
});