diff --git a/.github/workflows/render-suspend-labeler.yml b/.github/workflows/render-suspend-labeler.yml index 7860ae3ade..e9dd2e8b9b 100644 --- a/.github/workflows/render-suspend-labeler.yml +++ b/.github/workflows/render-suspend-labeler.yml @@ -8,16 +8,16 @@ permissions: issues: write jobs: - label-stale-deploys: + label-stale-ce-deploys: runs-on: ubuntu-latest permissions: - pull-requests: write + pull-requests: write steps: - uses: akshaysasidrn/stale-label-fetch@v1.1 id: stale-label with: github-token: ${{ secrets.GITHUB_TOKEN }} - stale-label: 'active-review-app' + stale-label: 'active-ce-review-app' stale-time: '86400' type: 'pull_request' - name: Get stale numbers @@ -40,6 +40,42 @@ jobs: issue_number: prNumber, owner: context.repo.owner, repo: context.repo.repo, - labels: ['suspend-review-app'] + labels: ['suspend-ce-review-app'] + }) + } + + label-stale-ee-deploys: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: akshaysasidrn/stale-label-fetch@v1.1 + id: stale-label + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + stale-label: 'active-ee-review-app' + stale-time: '86400' + type: 'pull_request' + - name: Get stale numbers + run: echo "Matched PR numbers - ${{ steps.stale-label.outputs.stale-numbers }}" + - name: Add suspend label + uses: actions/github-script@v6 + env: + STALE_NUMBERS: ${{ steps.stale-label.outputs.stale-numbers }} + with: + github-token: ${{ secrets.TJ_BOT_PAT }} + script: | + if (!process.env.STALE_NUMBERS) return + + const prNumbers = process.env.STALE_NUMBERS.split(",") + + console.log(`Adding suspend labels for: ${prNumbers}`) + + for (const prNumber of prNumbers) { + github.rest.issues.addLabels({ + issue_number: prNumber, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['suspend-ee-review-app'] }) } diff --git a/.github/workflows/vulnerability-ci.yml b/.github/workflows/vulnerability-ci.yml index 15f8425a46..568ab6df31 100644 --- a/.github/workflows/vulnerability-ci.yml +++ b/.github/workflows/vulnerability-ci.yml @@ -11,7 +11,7 @@ on: # Schedule the workflow to run every two weeks once schedule: - - cron: '30 5 */14 * *' + - cron: '30 5 * * 1' jobs: PeriodicVulnerability-CheckOn-frontend-code: diff --git a/cypress-tests/cypress/constants/texts/postgreSql.js b/cypress-tests/cypress/constants/texts/postgreSql.js index 5fdff49ae4..bcc686413d 100644 --- a/cypress-tests/cypress/constants/texts/postgreSql.js +++ b/cypress-tests/cypress/constants/texts/postgreSql.js @@ -5,7 +5,7 @@ export const postgreSqlText = { allDataSources: () => { return Cypress.env("marketplace_action") ? "All data sources (44)" - : "All data sources (42)"; + : "All data sources (43)"; }, commonlyUsed: "Commonly used (5)", allDatabase: () => { @@ -13,7 +13,7 @@ export const postgreSqlText = { ? "Databases (20)" : "Databases (18)"; }, - allApis: "APIs (20)", + allApis: "APIs (21)", allCloudStorage: "Cloud Storages (4)", postgreSQL: "PostgreSQL", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/bigqueryHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/bigqueryHappyPath.cy.js index e0e5db1bd4..6e8dfa0ff0 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/bigqueryHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/bigqueryHappyPath.cy.js @@ -4,6 +4,7 @@ import { postgreSqlText } from "Texts/postgreSql"; import { bigqueryText } from "Texts/bigquery"; import { firestoreText } from "Texts/firestore"; import { commonSelectors } from "Selectors/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { fillDataSourceTextField, selectAndAddDataSource, @@ -16,6 +17,7 @@ const data = {}; describe("Data source BigQuery", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); cy.intercept("GET", "/api/v2/data_sources"); data.dataSourceName = fake.lastName .toLowerCase() @@ -50,10 +52,19 @@ describe("Data source BigQuery", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - bigqueryText.bigQuery, - data.dataSourceName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-bigquery`, + "bigquery", + [{ key: "private_key", value: "", encrypted: true }] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-bigquery-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-bigquery` ); cy.get('[data-cy="label-private-key"]').verifyVisibleElement( diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/clickHouseHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/clickHouseHappyPath.cy.js index da601cbe30..f221ed3c16 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/clickHouseHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/clickHouseHappyPath.cy.js @@ -1,9 +1,8 @@ import { fake } from "Fixtures/fake"; import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; -import { commonWidgetText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; import { addQuery, @@ -21,6 +20,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -51,13 +51,20 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "ClickHouse", data.dataSourceName); - - // cy.get(postgreSqlSelector.dataSourceNameInputField).should( - // //username,password,host,port,protocol,dbname,usepost, trimquery,gzip,debug,raw - // "have.value", - // "ClickHouse" - // ); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-clickhouse`, + "clickhouse", + [] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-clickhouse-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-clickhouse` + ); cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement( "have.text", postgreSqlText.labelUserName @@ -78,7 +85,7 @@ describe("Data sources", () => { cy.get(postgreSqlSelector.labelDbName).verifyVisibleElement( "have.text", - postgreSqlText.labelDbName + "Database Name" ); cy.get('[data-cy="label-protocol"]').verifyVisibleElement( "have.text", @@ -140,11 +147,7 @@ describe("Data sources", () => { Cypress.env("pg_host") ); fillDataSourceTextField(postgreSqlText.labelPort, "8123", "8123"); - fillDataSourceTextField( - postgreSqlText.labelDbName, - "database name", - "{del}" - ); + fillDataSourceTextField("Database Name", "database name", "{del}"); fillDataSourceTextField( postgreSqlText.labelUserName, postgreSqlText.placeholderEnterUserName, diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/cosmosDbHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/cosmosDbHappyPath.cy.js index 12da4c9684..53fab94f67 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/cosmosDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/cosmosDbHappyPath.cy.js @@ -1,9 +1,8 @@ import { fake } from "Fixtures/fake"; import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; -import { commonWidgetText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; import { addQuery, @@ -21,6 +20,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -50,7 +50,23 @@ describe("Data sources", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "CosmosDB", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-cosmosdb`, + "cosmosdb", + [ + { key: "endpoint", value: "" }, + { key: "key", value: "", encrypted: true }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-cosmosdb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-cosmosdb` + ); cy.get('[data-cy="label-end-point"]').verifyVisibleElement( "have.text", @@ -92,7 +108,7 @@ describe("Data sources", () => { deleteDatasource(`cypress-${data.dataSourceName}-cosmosdb`); }); - it.only("Should verify the functionality of CosmosDB connection form.", () => { + it("Should verify the functionality of CosmosDB connection form.", () => { selectAndAddDataSource("databases", "CosmosDB", data.dataSourceName); fillDataSourceTextField( diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/couchDbHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/couchDbHappyPath.cy.js index 240d8de87b..e16c6d5314 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/couchDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/couchDbHappyPath.cy.js @@ -3,7 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { commonWidgetText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; import { @@ -22,6 +22,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -52,7 +53,27 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "CouchDB", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-couchdb`, + "couchdb", + [ + { key: "username", value: "", encrypted: false }, + { key: "password", value: "", encrypted: true }, + { key: "database", value: "" }, + { key: "port", value: "5984" }, + { key: "host", value: "" }, + { key: "protocol" }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-couchdb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-couchdb` + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -72,7 +93,7 @@ describe("Data sources", () => { ); cy.get(postgreSqlSelector.labelDbName).verifyVisibleElement( "have.text", - postgreSqlText.labelDbName + "Database Name" ); cy.get('[data-cy="label-protocol"]').verifyVisibleElement( @@ -122,11 +143,7 @@ describe("Data sources", () => { Cypress.env("couchdb_host") ); fillDataSourceTextField(postgreSqlText.labelPort, "5984 ", "5984"); - fillDataSourceTextField( - postgreSqlText.labelDbName, - "database name", - "{del}" - ); + fillDataSourceTextField("Database Name", "database name", "{del}"); fillDataSourceTextField( postgreSqlText.labelUserName, "username for couchDB", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/dynamoDbHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/dynamoDbHappyPath.cy.js index b8e588cf7d..eb9a030963 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/dynamoDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/dynamoDbHappyPath.cy.js @@ -3,7 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { dynamoDbText } from "Texts/dynamodb"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { fillDataSourceTextField, @@ -20,6 +20,7 @@ const data = {}; describe("Data source DynamoDB", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -50,10 +51,28 @@ describe("Data source DynamoDB", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - dynamoDbText.dynamoDb, - data.dataSourceName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-dynamodb`, + "dynamodb", + [ + { key: "region", value: "" }, + { key: "access_key", value: "" }, + { key: "secret_key", value: "", encrypted: true }, + { + key: "instance_metadata_credentials", + value: "iam_access_keys", + encrypted: false, + }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-dynamodb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-dynamodb` ); cy.get('[data-cy="label-region"]').verifyVisibleElement( diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/elasticsearchHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/elasticsearchHappyPath.cy.js index 774416c222..c7a1f242fa 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/elasticsearchHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/elasticsearchHappyPath.cy.js @@ -3,7 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { elasticsearchText } from "Texts/elasticsearch"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { fillDataSourceTextField, selectAndAddDataSource, @@ -18,6 +18,7 @@ const data = {}; describe("Data source Elasticsearch", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); }); @@ -46,12 +47,27 @@ describe("Data source Elasticsearch", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - elasticsearchText.elasticSearch, - data.lastName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-elasticsearch`, + "elasticsearch", + [ + { key: "host", value: "localhost" }, + { key: "port", value: 9200 }, + { key: "username", value: "" }, + { key: "password", value: "", encrypted: true }, + { key: "ssl_enabled", value: true, encrypted: false }, + { key: "ssl_certificate", value: "none", encrypted: false }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-elasticsearch-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-elasticsearch` ); - cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", postgreSqlText.labelHost @@ -74,7 +90,7 @@ describe("Data source Elasticsearch", () => { ); cy.get(postgreSqlSelector.labelSSLCertificate).verifyVisibleElement( "have.text", - postgreSqlText.sslCertificate + "SSL Certificate" ); cy.get(postgreSqlSelector.labelIpWhitelist).verifyVisibleElement( "have.text", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/fireStoreHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/fireStoreHappyPath.cy.js index 8792279352..6e703fc895 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/fireStoreHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/fireStoreHappyPath.cy.js @@ -3,7 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { firestoreText } from "Texts/firestore"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { verifyCouldnotConnectWithAlert, deleteDatasource, @@ -18,6 +18,7 @@ const data = {}; describe("Data source Firestore", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -47,12 +48,20 @@ describe("Data source Firestore", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - firestoreText.firestore, - data.dataSourceName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-firestore`, + "firestore", + [{ key: "gcp_key", value: "", encrypted: true }] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-firestore-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-firestore` ); - cy.get('[data-cy="label-private-key"]').verifyVisibleElement( "have.text", firestoreText.labelPrivateKey diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/influxDbHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/influxDbHappyPath.cy.js index ee1d515a61..36b39572d4 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/influxDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/influxDbHappyPath.cy.js @@ -1,8 +1,8 @@ import { fake } from "Fixtures/fake"; import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; -import { commonWidgetText, commonText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { addQuery, fillDataSourceTextField, @@ -24,6 +24,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -54,7 +55,25 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "InfluxDB", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-influxdb`, + "influxdb", + [ + { key: "api_token", value: "", encrypted: true }, + { key: "port", value: "8086", encrypted: false }, + { key: "host", value: "", encrypted: false }, + { key: "protocol", value: "http", encrypted: false }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-influxdb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-influxdb` + ); cy.get('[data-cy="label-api-token"]').verifyVisibleElement( "have.text", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.skip.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.js similarity index 90% rename from cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.skip.js rename to cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.js index 3fafe5a23c..4c6c57d596 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.skip.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mariaDbHappyPath.cy.js @@ -1,6 +1,6 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; -import { commonWidgetText, commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; import { addQuery, @@ -20,6 +20,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -50,7 +51,20 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "MariaDB", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-mariadb`, + "mariadb", + [{ key: "connectionLimit", value: 5 }] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-mariadb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-mariadb` + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -83,7 +97,7 @@ describe("Data sources", () => { cy.get(postgreSqlSelector.labelSSLCertificate).verifyVisibleElement( "have.text", - postgreSqlText.sslCertificate + "SSL Certificate" ); cy.get(postgreSqlSelector.labelIpWhitelist).verifyVisibleElement( "have.text", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mongoDbHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mongoDbHappyPath.cy.js index 41d2a564fb..77d2e2ffa4 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mongoDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mongoDbHappyPath.cy.js @@ -3,7 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { mongoDbText } from "Texts/mongoDb"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; import { fillDataSourceTextField, @@ -28,6 +28,7 @@ const data = {}; describe("Data source MongoDB", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -56,10 +57,28 @@ describe("Data source MongoDB", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - mongoDbText.mongoDb, - data.dataSourceName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-mongodb`, + "mongodb", + [ + { key: "database", value: "", encrypted: false }, + { key: "host", value: "localhost" }, + { key: "port", value: 27017 }, + { key: "username", value: "" }, + { key: "password", value: "", encrypted: true }, + { key: "connection_type", value: "manual" }, + { key: "connection_string", value: "", encrypted: true }, + { key: "tls_certificate", value: "none", encrypted: false }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-mongodb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-mongodb` ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( @@ -72,7 +91,7 @@ describe("Data source MongoDB", () => { ); cy.get(postgreSqlSelector.labelDbName).verifyVisibleElement( "have.text", - postgreSqlText.labelDbName + "Database Name" ); cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement( "have.text", @@ -168,7 +187,7 @@ describe("Data source MongoDB", () => { data.dataSourceName ); - cy.get('[data-cy="query-select-dropdown"]').type( + cy.get('[data-cy="connection-type-select-dropdown"]').type( mongoDbText.optionConnectUsingConnectionString ); diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mysqlHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mysqlHappyPath.cy.js index 0cf7cb5277..38e221ba0a 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mysqlHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/mysqlHappyPath.cy.js @@ -19,6 +19,7 @@ import { deleteDatasource, verifyCouldnotConnectWithAlert, } from "Support/utils/dataSource"; +import { dataSourceSelector } from "Selectors/dataSource"; import { realHover } from "cypress-real-events/commands/realHover"; const data = {}; @@ -26,6 +27,7 @@ const data = {}; describe("Data sources MySql", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -56,7 +58,30 @@ describe("Data sources MySql", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "MySQL", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-mysql`, + "mysql", + [ + { key: "connection_type", value: "hostname" }, + { key: "host", value: "localhost" }, + { key: "port", value: 3306 }, + { key: "database", value: "" }, + { key: "socket", value: "", encrypted: false }, + { key: "username", value: "" }, + { key: "password", value: "", encrypted: true }, + { key: "ssl_enabled", value: false, encrypted: false }, + { key: "ssl_certificate", value: "none", encrypted: false }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-mysql-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-mysql` + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -110,7 +135,7 @@ describe("Data sources MySql", () => { deleteDatasource(`cypress-${data.dataSourceName}-mysql`); }); - it.only("Should verify the functionality of MySQL connection form.", () => { + it("Should verify the functionality of MySQL connection form.", () => { selectAndAddDataSource("databases", "MySQL", data.dataSourceName); fillDataSourceTextField( @@ -170,9 +195,9 @@ describe("Data sources MySql", () => { verifyCouldnotConnectWithAlert( "ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'103.171.99.42' (using password: YES)" ); - cy.get('[data-cy="-toggle-input"]').then(($el) => { + cy.get('[data-cy="ssl-enabled-toggle-input"]').then(($el) => { if ($el.is(":checked")) { - cy.get('[data-cy="-toggle-input"]').uncheck(); + cy.get('[data-cy="ssl-enabled-toggle-input"]').uncheck(); } }); diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/postgresHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/postgresHappyPath.cy.js index 26ca6a8f21..a6ff7595e5 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/postgresHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/postgresHappyPath.cy.js @@ -3,6 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { commonWidgetText, commonText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { addQuery, fillDataSourceTextField, @@ -20,6 +21,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -52,10 +54,31 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource( - "databases", - postgreSqlText.postgreSQL, - data.dataSourceName + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-postgresql`, + "postgresql", + [ + { key: "connection_type", value: "manual", encrypted: false }, + { key: "host", value: "localhost", encrypted: false }, + { key: "port", value: 5432, encrypted: false }, + { key: "ssl_enabled", value: true, encrypted: false }, + { key: "ssl_certificate", value: "none", encrypted: false }, + { key: "password", value: null, encrypted: true }, + { key: "ca_cert", value: null, encrypted: true }, + { key: "client_key", value: null, encrypted: true }, + { key: "client_cert", value: null, encrypted: true }, + { key: "root_cert", value: null, encrypted: true }, + { key: "connection_string", value: null, encrypted: true }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-postgresql-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-postgresql` ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/rethinkDbHappyPath.cy.skip.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/rethinkDbHappyPath.cy.skip.js index 8f04fa4572..267eedea1f 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/rethinkDbHappyPath.cy.skip.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/rethinkDbHappyPath.cy.skip.js @@ -3,6 +3,7 @@ import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { commonWidgetText, commonText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { addQuery, fillDataSourceTextField, @@ -19,6 +20,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -49,7 +51,26 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "RethinkDB", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-rethinkdb`, + "rethinkdb", + [ + { key: "port", value: "28015", encrypted: false }, + { key: "host", value: "", encrypted: false }, + { key: "database", value: "", encrypted: false }, + { key: "username", value: "", encrypted: false }, + { key: "password", value: "", encrypted: true }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-rethinkdb-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-rethinkdb` + ); cy.get('[data-cy="label-database"]').verifyVisibleElement( "have.text", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/s3HappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/s3HappyPath.cy.js index 7a128c1470..12b3817f16 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/s3HappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/s3HappyPath.cy.js @@ -4,7 +4,7 @@ import { s3Selector } from "Selectors/awss3"; import { postgreSqlText } from "Texts/postgreSql"; import { s3Text } from "Texts/awss3"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { fillDataSourceTextField, selectAndAddDataSource, @@ -51,7 +51,31 @@ describe("Data sources AWS S3", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("cloudstorage", s3Text.awsS3, data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-aws-s3`, + "s3", + [ + { key: "access_key", value: "" }, + { key: "secret_key", value: "", encrypted: true }, + { key: "region", value: "" }, + { key: "endpoint", value: "" }, + { key: "endpoint_enabled", value: false, encrypted: false }, + { + key: "instance_metadata_credentials", + value: "iam_access_keys", + encrypted: false, + }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-aws-s3-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-aws-s3` + ); cy.get(s3Selector.accessKeyLabel).verifyVisibleElement( "have.text", s3Text.accessKey diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/smtpHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/smtpHappyPath.cy.js index 90594f8122..4e824aeda5 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/smtpHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/smtpHappyPath.cy.js @@ -2,7 +2,7 @@ import { fake } from "Fixtures/fake"; import { postgreSqlSelector } from "Selectors/postgreSql"; import { postgreSqlText } from "Texts/postgreSql"; import { commonSelectors } from "Selectors/common"; -import { commonText } from "Texts/common"; +import { dataSourceSelector } from "Selectors/dataSource"; import { fillDataSourceTextField, selectAndAddDataSource, @@ -14,6 +14,7 @@ const data = {}; describe("Data source SMTP", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -43,7 +44,25 @@ describe("Data source SMTP", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("apis", "SMTP", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-smtp`, + "smtp", + [ + { key: "host", value: "localhost", encrypted: false }, + { key: "port", value: 465, encrypted: false }, + { key: "user", value: "", encrypted: false }, + { key: "password", value: "", encrypted: true }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-smtp-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-smtp` + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/snowflakeHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/snowflakeHappyPath.cy.js index 22f2afd08e..4409c0577b 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/snowflakeHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/snowflakeHappyPath.cy.js @@ -4,6 +4,7 @@ import { postgreSqlText } from "Texts/postgreSql"; import { commonWidgetText, commonText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; +import { dataSourceSelector } from "Selectors/dataSource"; import { addQuery, @@ -20,6 +21,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -49,8 +51,28 @@ describe("Data sources", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "Snowflake", data.dataSourceName); - + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-snowflake`, + "snowflake", + [ + { key: "username", value: "" }, + { key: "account", value: "" }, + { key: "password", value: "", encrypted: true }, + { key: "database", value: "" }, + { key: "schema", value: "" }, + { key: "warehouse", value: "" }, + { key: "role", value: "" }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-snowflake-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-snowflake` + ); cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement( "have.text", postgreSqlText.labelUserName @@ -113,7 +135,7 @@ describe("Data sources", () => { deleteDatasource(`cypress-${data.dataSourceName}-snowflake`); }); - it.skip("Should verify the functionality of PostgreSQL connection form.", () => { + it.skip("Should verify the functionality of snowflake connection form.", () => { selectAndAddDataSource("databases", "Snowflake", data.dataSourceName); fillDataSourceTextField( diff --git a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/sqlServerHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/sqlServerHappyPath.cy.js index aa578ed1df..9501fdabbb 100644 --- a/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/sqlServerHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/marketplace/commonTestcases/data-source/sqlServerHappyPath.cy.js @@ -4,6 +4,7 @@ import { postgreSqlText } from "Texts/postgreSql"; import { commonWidgetText, commonText } from "Texts/common"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; import { deleteDatasource, closeDSModal } from "Support/utils/dataSource"; +import { dataSourceSelector } from "Selectors/dataSource"; import { addQuery, @@ -21,6 +22,7 @@ const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + cy.defaultWorkspaceLogin(); data.dataSourceName = fake.lastName .toLowerCase() .replaceAll("[^A-Za-z]", ""); @@ -51,7 +53,28 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "SQL Server", data.dataSourceName); + cy.apiCreateGDS( + `${Cypress.env("server_host")}/api/data-sources`, + `cypress-${data.dataSourceName}-sql-server`, + "mssql", + [ + { key: "host", value: "localhost" }, + { key: "instanceName", value: "" }, + { key: "port", value: 1433 }, + { key: "database", value: "" }, + { key: "username", value: "" }, + { key: "password", value: "", encrypted: true }, + { key: "azure", value: false, encrypted: false }, + ] + ); + cy.reload(); + cy.get(`[data-cy="cypress-${data.dataSourceName}-sql-server-button"]`) + .should("be.visible") + .click(); + cy.get(dataSourceSelector.dsNameInputField).should( + "have.value", + `cypress-${data.dataSourceName}-sql-server` + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -67,7 +90,7 @@ describe("Data sources", () => { ); cy.get(postgreSqlSelector.labelDbName).verifyVisibleElement( "have.text", - postgreSqlText.labelDbName + "Database Name" ); cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement( "have.text", @@ -78,8 +101,8 @@ describe("Data sources", () => { "Password" ); - cy.get('[data-cy="label-azure"]').verifyVisibleElement( - "have.text", + cy.get('[data-cy^="label-azure-"]').verifyVisibleElement( + "contain", "Azure" ); cy.get(postgreSqlSelector.labelIpWhitelist).verifyVisibleElement( @@ -135,7 +158,7 @@ describe("Data sources", () => { "1433" ); fillDataSourceTextField( - postgreSqlText.labelDbName, + "Database Name", postgreSqlText.placeholderNameOfDB, Cypress.env("sqlserver_db") ); diff --git a/cypress-tests/cypress/support/utils/dataSource.js b/cypress-tests/cypress/support/utils/dataSource.js index e907a991e2..6f17004409 100644 --- a/cypress-tests/cypress/support/utils/dataSource.js +++ b/cypress-tests/cypress/support/utils/dataSource.js @@ -6,6 +6,7 @@ import { commonText } from "Texts/common"; import { dataSourceSelector } from "Selectors/dataSource"; import { dataSourceText } from "Texts/dataSource"; import { navigateToAppEditor } from "Support/utils/common"; +import { verifyAppDelete } from "Support/utils/dashboard"; export const verifyCouldnotConnectWithAlert = (dangerText) => { cy.get(postgreSqlSelector.connectionFailedText, { @@ -60,6 +61,15 @@ export const deleteDatasource = (datasourceName) => { // " Databases" // ); }; +export const deleteAppandDatasourceAfterExecution = ( + appName, + datasourceName +) => { + cy.backToApps(); + cy.deleteApp(appName); + verifyAppDelete(appName); + deleteDatasource(datasourceName); +}; export const closeDSModal = () => { cy.get("body").then(($body) => { @@ -96,9 +106,7 @@ export const addQueryN = (queryName, query, dbName) => { export const addQuery = (queryName, query, dbName) => { cy.get('[data-cy="show-ds-popover-button"]').click(); cy.get(".css-4e90k9").type(`${dbName}`); - cy.intercept("POST", "/api/data-queries/**").as( - "createQuery" - ); + cy.intercept("POST", "/api/data-queries/**").as("createQuery"); cy.contains(`[id*="react-select-"]`, dbName).click(); cy.get('[data-cy="query-rename-input"]').clear().type(queryName); @@ -225,7 +233,14 @@ export const createDataQuery = (appName, url, key, value) => { }); }; -export const createRestAPIQuery = (queryName, dsName, key = '', value = '', url = "", run = true) => { +export const createRestAPIQuery = ( + queryName, + dsName, + key = "", + value = "", + url = "", + run = true +) => { cy.getCookie("tj_auth_token").then((cookie) => { const headers = { "Tj-Workspace-Id": Cypress.env("workspaceId"),