mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 06:18:34 +00:00
* initial: flow setup * [BugFix] Fix dynamic form breaking in case "react-component-headers" form type outside of the editor * fixes: initial creation of datasource with default options * resolve: local ds issues and cleanup * cleanup * fix: equality check * revamp: gds flow * fix: local ds not updating * fix: minor bugs * remove datasource confirmation modal * bug fixes * Modify the datasource cypress test cases * Add data-cy for new datasource components * rename to data sources * rename: data sources * fix: local ds wrapper css * Add new commands file * Add new commands file * fix: datasource route * Modify data source test cases * Modify cypress config * Modify data source icon tooltip text --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: Nakul Nagargade <[email protected]> Co-authored-by: emidhun <[email protected]>
170 lines
4.9 KiB
JavaScript
170 lines
4.9 KiB
JavaScript
import { postgreSqlSelector } from "Selectors/postgreSql";
|
|
import { postgreSqlText } from "Texts/postgreSql";
|
|
import { commonWidgetText, commonText } from "Texts/common";
|
|
import { commonSelectors, commonWidgetSelector } from "Selectors/common";
|
|
import {
|
|
addQuery,
|
|
fillDataSourceTextField,
|
|
fillConnectionForm,
|
|
selectAndAddDataSource,
|
|
openQueryEditor,
|
|
selectQueryMode,
|
|
addGuiQuery,
|
|
addWidgetsToAddUser,
|
|
} from "Support/utils/postgreSql";
|
|
|
|
describe("Data sources", () => {
|
|
beforeEach(() => {
|
|
cy.appUILogin();
|
|
// cy.createApp();
|
|
});
|
|
|
|
it("Should verify elements on connection form", () => {
|
|
cy.get(commonSelectors.globalDataSourceIcon).click();
|
|
cy.reload();
|
|
cy.get(commonSelectors.addNewDataSourceButton)
|
|
.verifyVisibleElement("have.text", commonText.addNewDataSourceButton)
|
|
.click();
|
|
|
|
|
|
|
|
cy.get(postgreSqlSelector.allDatasourceLabelAndCount).should(
|
|
"have.text",
|
|
postgreSqlText.allDataSources
|
|
);
|
|
cy.get(postgreSqlSelector.databaseLabelAndCount).should(
|
|
"have.text",
|
|
postgreSqlText.allDatabase
|
|
);
|
|
cy.get(postgreSqlSelector.apiLabelAndCount).should(
|
|
"have.text",
|
|
postgreSqlText.allApis
|
|
);
|
|
cy.get(postgreSqlSelector.cloudStorageLabelAndCount).should(
|
|
"have.text",
|
|
postgreSqlText.allCloudStorage
|
|
);
|
|
|
|
cy.get(postgreSqlSelector.dataSourceSearchInputField).type(
|
|
postgreSqlText.postgreSQL
|
|
);
|
|
cy.get("[data-cy*='data-source-']")
|
|
.eq(1)
|
|
.should("contain", postgreSqlText.postgreSQL);
|
|
cy.get(postgreSqlSelector.postgresDataSource).click();
|
|
|
|
cy.get(postgreSqlSelector.dataSourceNameInputField).should(
|
|
"have.value",
|
|
postgreSqlText.postgreSQL
|
|
);
|
|
cy.get(postgreSqlSelector.labelHost).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelHost
|
|
);
|
|
cy.get(postgreSqlSelector.labelPort).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelPort
|
|
);
|
|
cy.get(postgreSqlSelector.labelSsl).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelSSL
|
|
);
|
|
cy.get(postgreSqlSelector.labelDbName).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelDbName
|
|
);
|
|
cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelUserName
|
|
);
|
|
cy.get(postgreSqlSelector.labelPassword).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.labelPassword
|
|
);
|
|
cy.get(postgreSqlSelector.labelSSLCertificate).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.sslCertificate
|
|
);
|
|
cy.get(postgreSqlSelector.labelIpWhitelist).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.whiteListIpText
|
|
);
|
|
cy.get(postgreSqlSelector.buttonCopyIp).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.textCopy
|
|
);
|
|
|
|
cy.get(postgreSqlSelector.linkReadDocumentation).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.readDocumentation
|
|
);
|
|
cy.get(postgreSqlSelector.buttonTestConnection)
|
|
.verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.buttonTextTestConnection
|
|
)
|
|
.click();
|
|
cy.get(postgreSqlSelector.connectionFailedText).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.couldNotConnect
|
|
);
|
|
cy.get(postgreSqlSelector.buttonSave).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.buttonTextSave
|
|
);
|
|
cy.get(postgreSqlSelector.dangerAlertNotSupportSSL).verifyVisibleElement(
|
|
"have.text",
|
|
postgreSqlText.serverNotSuppotSsl
|
|
);
|
|
});
|
|
|
|
it("Should verify the functionality of PostgreSQL connection form.", () => {
|
|
selectAndAddDataSource(postgreSqlText.postgreSQL);
|
|
|
|
cy.clearAndType(
|
|
'[data-cy="data-source-name-input-filed"]',
|
|
postgreSqlText.psqlName
|
|
);
|
|
|
|
fillDataSourceTextField(
|
|
postgreSqlText.labelHost,
|
|
postgreSqlText.placeholderEnterHost,
|
|
Cypress.env("pg_host")
|
|
);
|
|
fillDataSourceTextField(
|
|
postgreSqlText.labelPort,
|
|
postgreSqlText.placeholderEnterPort,
|
|
"5432"
|
|
);
|
|
fillDataSourceTextField(
|
|
postgreSqlText.labelDbName,
|
|
postgreSqlText.placeholderNameOfDB,
|
|
"postgres"
|
|
);
|
|
fillDataSourceTextField(
|
|
postgreSqlText.labelUserName,
|
|
postgreSqlText.placeholderEnterUserName,
|
|
"postgres"
|
|
);
|
|
|
|
cy.get(postgreSqlSelector.passwordTextField).type(
|
|
Cypress.env("pg_password")
|
|
);
|
|
|
|
cy.get(postgreSqlSelector.buttonTestConnection).click();
|
|
cy.get(postgreSqlSelector.textConnectionVerified, {
|
|
timeout: 10000,
|
|
}).should("have.text", postgreSqlText.labelConnectionVerified);
|
|
cy.get(postgreSqlSelector.buttonSave).click();
|
|
|
|
cy.verifyToastMessage(
|
|
commonSelectors.toastMessage,
|
|
postgreSqlText.toastDSAdded
|
|
);
|
|
|
|
cy.get(postgreSqlSelector.datasourceLabelOnList)
|
|
.should("have.text", postgreSqlText.psqlName)
|
|
.find("button")
|
|
.should("be.visible");
|
|
});
|
|
});
|