diff --git a/.github/workflows/cypress-platform.yml b/.github/workflows/cypress-platform.yml index d136991e38..04bde2e492 100644 --- a/.github/workflows/cypress-platform.yml +++ b/.github/workflows/cypress-platform.yml @@ -147,13 +147,27 @@ jobs: name: screenshots-${{ matrix.edition }} path: cypress-tests/cypress/screenshots - Cypress-Platform-Subpath: runs-on: ubuntu-22.04 if: | - github.event.action == 'labeled' && - (github.event.label.name == 'run-cypress-platform-subpath' || - github.event.label.name == 'run-proxy-platform') + github.event.action == 'labeled' && + ( + github.event.label.name == 'run-cypress-platform-subpath' || + github.event.label.name == 'run-proxy-platform' || + github.event.label.name == 'run-ce-cypress-platform-subpath' || + github.event.label.name == 'run-ee-cypress-platform-subpath' + ) + + strategy: + matrix: + edition: >- + ${{ + contains(github.event.pull_request.labels.*.name, 'run-cypress-platform-subpath') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-proxy-platform') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-ce-cypress-platform-subpath') && fromJson('["ce"]') || + contains(github.event.pull_request.labels.*.name, 'run-ee-cypress-platform-subpath') && fromJson('["ee"]') || + fromJson('[]') + }} steps: - name: Setup Node.js @@ -161,11 +175,22 @@ jobs: with: node-version: 18.18.2 - - name: Checkout + - name: Set up Git authentication for private submodules + run: | + git config --global url."https://x-access-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - name: Checkout with Submodules uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} + - name: Checking out the correct branch for submodules EE + if: matrix.edition == 'ee' + run: | + git submodule update --init --recursive + git submodule foreach --recursive ' + git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout main' + - name: Set up Docker configuration run: | mkdir -p ~/.docker/cli-plugins @@ -186,13 +211,14 @@ jobs: uses: docker/build-push-action@v4 with: context: . - file: docker/production.Dockerfile + file: ${{ matrix.edition == 'ee' && 'docker/ee/ee-production.Dockerfile' || 'docker/ce-production.Dockerfile' }} push: true tags: tooljet/tj-osv:${{ env.SAFE_BRANCH_NAME }} platforms: linux/amd64 - name: Set up environment variables run: | + echo "TOOLJET_EDITION=${{ matrix.edition == 'ee' && 'ee' || 'ce' }}" >> .env echo "TOOLJET_HOST=http://localhost:3000" >> .env echo "LOCKBOX_MASTER_KEY=cd97331a419c09387bef49787f7da8d2a81d30733f0de6bed23ad8356d2068b2" >> .env echo "SECRET_KEY_BASE=7073b9a35a15dd20914ae17e36a693093f25b74b96517a5fec461fc901c51e011cd142c731bee48c5081ec8bac321c1f259ef097ef2a16f25df17a3798c03426" >> .env @@ -254,15 +280,30 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: screenshots + name: screenshots-${{ matrix.edition }} path: cypress-tests/cypress/screenshots Cypress-Platform-Proxy: runs-on: ubuntu-22.04 if: | - github.event.action == 'labeled' && - (github.event.label.name == 'run-cypress-platform-proxy' || - github.event.label.name == 'run-proxy-platform') + github.event.action == 'labeled' && + ( + github.event.label.name == 'run-cypress-platform-proxy' || + github.event.label.name == 'run-proxy-platform' || + github.event.label.name == 'run-ce-cypress-platform-proxy' || + github.event.label.name == 'run-ee-cypress-platform-proxy' + ) + + strategy: + matrix: + edition: >- + ${{ + contains(github.event.pull_request.labels.*.name, 'run-cypress-platform-proxy') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-proxy-platform') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-ce-cypress-platform-proxy') && fromJson('["ce"]') || + contains(github.event.pull_request.labels.*.name, 'run-ee-cypress-platform-proxy') && fromJson('["ee"]') || + fromJson('[]') + }} steps: - name: Setup Node.js @@ -270,11 +311,22 @@ jobs: with: node-version: 18.18.2 - - name: Checkout + - name: Set up Git authentication for private submodules + run: | + git config --global url."https://x-access-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - name: Checkout with Submodules uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} + - name: Checking out the correct branch for submodules EE + if: matrix.edition == 'ee' + run: | + git submodule update --init --recursive + git submodule foreach --recursive ' + git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout main' + - name: Set up Docker configuration run: | mkdir -p ~/.docker/cli-plugins @@ -295,13 +347,14 @@ jobs: uses: docker/build-push-action@v4 with: context: . - file: docker/production.Dockerfile + file: ${{ matrix.edition == 'ee' && 'docker/ee/ee-production.Dockerfile' || 'docker/ce-production.Dockerfile' }} push: true tags: tooljet/tj-osv:${{ env.SAFE_BRANCH_NAME }} platforms: linux/amd64 - name: Set up environment variables run: | + echo "TOOLJET_EDITION=${{ matrix.edition == 'ee' && 'ee' || 'ce' }}" >> .env echo "TOOLJET_HOST=http://localhost:3000" >> .env echo "LOCKBOX_MASTER_KEY=cd97331a419c09387bef49787f7da8d2a81d30733f0de6bed23ad8356d2068b2" >> .env echo "SECRET_KEY_BASE=7073b9a35a15dd20914ae17e36a693093f25b74b96517a5fec461fc901c51e011cd142c731bee48c5081ec8bac321c1f259ef097ef2a16f25df17a3798c03426" >> .env @@ -375,15 +428,30 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: screenshots + name: screenshots-${{ matrix.edition }} path: cypress-tests/cypress/screenshots Cypress-Platform-Proxy-Subpath: runs-on: ubuntu-22.04 if: | - github.event.action == 'labeled' && - (github.event.label.name == 'run-cypress-platform-proxy-subpath' || - github.event.label.name == 'run-proxy-platform') + github.event.action == 'labeled' && + ( + github.event.label.name == 'run-cypress-platform-proxy-subpath' || + github.event.label.name == 'run-proxy-platform' || + github.event.label.name == 'run-ce-cypress-platform-proxy-subpath' || + github.event.label.name == 'run-ee-cypress-platform-proxy-subpath' + ) + + strategy: + matrix: + edition: >- + ${{ + contains(github.event.pull_request.labels.*.name, 'run-cypress-platform-proxy-subpath') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-proxy-platform') && fromJson('["ce", "ee"]') || + contains(github.event.pull_request.labels.*.name, 'run-ce-cypress-platform-proxy-subpath') && fromJson('["ce"]') || + contains(github.event.pull_request.labels.*.name, 'run-ee-cypress-platform-proxy-subpath') && fromJson('["ee"]') || + fromJson('[]') + }} steps: - name: Setup Node.js @@ -391,11 +459,22 @@ jobs: with: node-version: 18.18.2 - - name: Checkout + - name: Set up Git authentication for private submodules + run: | + git config --global url."https://x-access-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - name: Checkout with Submodules uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} + - name: Checking out the correct branch for submodules EE + if: matrix.edition == 'ee' + run: | + git submodule update --init --recursive + git submodule foreach --recursive ' + git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout main' + - name: Set up Docker configuration run: | mkdir -p ~/.docker/cli-plugins @@ -416,13 +495,14 @@ jobs: uses: docker/build-push-action@v4 with: context: . - file: docker/production.Dockerfile + file: ${{ matrix.edition == 'ee' && 'docker/ee/ee-production.Dockerfile' || 'docker/ce-production.Dockerfile' }} push: true tags: tooljet/tj-osv:${{ env.SAFE_BRANCH_NAME }} platforms: linux/amd64 - name: Set up environment variables run: | + echo "TOOLJET_EDITION=${{ matrix.edition == 'ee' && 'ee' || 'ce' }}" >> .env echo "TOOLJET_HOST=http://localhost:3000" >> .env echo "LOCKBOX_MASTER_KEY=cd97331a419c09387bef49787f7da8d2a81d30733f0de6bed23ad8356d2068b2" >> .env echo "SECRET_KEY_BASE=7073b9a35a15dd20914ae17e36a693093f25b74b96517a5fec461fc901c51e011cd142c731bee48c5081ec8bac321c1f259ef097ef2a16f25df17a3798c03426" >> .env @@ -497,5 +577,5 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: screenshots + name: screenshots-${{ matrix.edition }} path: cypress-tests/cypress/screenshots diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 67a994adf6..6bb2f8241f 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -137,7 +137,8 @@ jobs: uses: docker/build-push-action@v4 with: context: . - args: ${{ secrets.CUSTOM_GITHUB_TOKEN }} + build-args: | + CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }} file: docker/ee/ee-production.Dockerfile push: true tags: tooljet/tooljet-ee:${{ github.event.release.tag_name }},tooljet/tooljet-ee:ee-lts-latest,tooljet/tooljet:ee-lts-latest,tooljet/tooljet:${{ github.event.release.tag_name }} @@ -152,8 +153,9 @@ jobs: uses: docker/build-push-action@v4 with: context: . - args: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - file: docker/ee-production.Dockerfile + build-args: | + CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }} + file: docker/ee/ee-production.Dockerfile push: true tags: tooljet/tooljet-ee:${{ github.event.release.tag_name }},tooljet/tooljet-ee:ee-lts-latest,tooljet/tooljet:ee-lts-latest,tooljet/tooljet:${{ github.event.release.tag_name }} platforms: linux/amd64 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/appbuilder/commonTestcases/components/appTitle.cy.js b/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/components/appTitle.cy.js index 34f303769f..994138348a 100644 --- a/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/components/appTitle.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/components/appTitle.cy.js @@ -43,8 +43,10 @@ describe("Editor title", () => { cy.apiDeleteApp(); }); it("should verify titles", () => { - cy.url().should("include", "/my-workspace"); - cy.title().should("eq", "Dashboard | ToolJet"); + cy.url().should("include", "/tjs-workspace"); + // cy.title().should("eq", "Dashboard | ToolJet"); + cy.title().should("eq", "ToolJet"); + cy.log(data.appName); cy.openApp(); @@ -54,12 +56,20 @@ describe("Editor title", () => { cy.openInCurrentTab(commonWidgetSelector.previewButton); cy.url().should("include", `/applications/${Cypress.env("appId")}`); - cy.title().should("eq", `Preview - ${data.appName} | ToolJet`); + cy.title().should("eq", `${data.appName} | ToolJet`); + // cy.title().should("eq", `Preview - ${data.appName} | ToolJet`); + cy.go("back"); cy.releaseApp(); - cy.url().then((url) => cy.visit(`/applications/${url.split("/").pop()}`)); + cy.url().then((url) => { + const appId = url.split("/").filter(Boolean).pop(); + cy.log(appId); + cy.visit(`/applications/${appId}`); + }); cy.url().should("include", `/applications/${Cypress.env("appId")}`); - cy.title().should("eq", `${data.appName}`); + cy.title().should("eq", `${data.appName} | ToolJet`); + // cy.title().should("eq", `${data.appName}`); }); }); + diff --git a/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/globalSetingsHappyPath.cy.js b/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/globalSetingsHappyPath.cy.js index 195262cfdc..3802f068ed 100644 --- a/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/globalSetingsHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/happyPath/appbuilder/commonTestcases/globalSetingsHappyPath.cy.js @@ -35,13 +35,13 @@ describe("Editor- Global Settings", () => { "have.text", "Global settings" ); - cy.get( - '[data-cy="label-hide-header-for-launched-apps"]' - ).verifyVisibleElement("have.text", "Hide header for launched apps"); - cy.get('[data-cy="label-maintenance-mode"]').verifyVisibleElement( - "have.text", - "Maintenance mode" - ); + // cy.get( + // '[data-cy="label-hide-header-for-launched-apps"]' + // ).verifyVisibleElement("have.text", "Hide header for launched apps"); + // cy.get('[data-cy="label-maintenance-mode"]').verifyVisibleElement( + // "have.text", + // "Maintenance mode" + // ); cy.hideTooltip(); cy.get('[data-cy="label-max-canvas-width"]').verifyVisibleElement( "have.text", @@ -60,7 +60,7 @@ describe("Editor- Global Settings", () => { ); verifyWidgetColorCss( - ".canvas-area", + '[data-cy="real-canvas"]', "background-color", data.backgroundColor, true @@ -87,24 +87,25 @@ describe("Editor- Global Settings", () => { cy.get("[data-cy='left-sidebar-settings-button']").click(); cy.get('[data-cy="toggle-maintenance-mode"]').realClick(); cy.get('[data-cy="modal-confirm-button"]').click(); - cy.verifyToastMessage( - commonSelectors.toastMessage, - "Application is on maintenance.", - false - ); + // cy.verifyToastMessage( + // commonSelectors.toastMessage, + // "Application is on maintenance.", + // false + // ); cy.forceClickOnCanvas(); cy.wait(500); cy.waitForAutoSave(); - //Fix this after the release. 2.9.0 - // cy.get('[data-cy="button-release"]').click(); - // cy.get('[data-cy="yes-button"]').click(); - // cy.get('[data-cy="editor-page-logo"]').click(); - // cy.get(`[data-cy="${data.appName.toLowerCase()}-card"]`) - // .realHover() - // .find('[data-cy="launch-button"]') - // .invoke("attr", "class") - // .should("contains", "disabled-btn"); - + // Fix this after the release. 2.9.0 + cy.get('[data-cy="button-release"]').click(); + cy.get('[data-cy="yes-button"]').click(); + cy.get('[data-cy="editor-page-logo"]').click(); + cy.get('[data-cy="back-to-app-option"]').click(); + cy.get(`[data-cy="${data.appName.toLowerCase()}-card"]`) + .realHover().within(() => { + cy.get('[data-cy="launch-button"]').should('have.text', 'Maintenance') + .invoke("attr", "class") + .should("contains", "disabled-btn"); + }) cy.apiDeleteApp(); }); }); 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/button.js b/cypress-tests/cypress/support/utils/button.js index ddace2f305..66e340965c 100644 --- a/cypress-tests/cypress/support/utils/button.js +++ b/cypress-tests/cypress/support/utils/button.js @@ -40,7 +40,7 @@ export const verifyControlComponentAction = (widgetName, value) => { export const addBasicData = (data) => { openEditorSidebar(buttonText.defaultWidgetName); - verifyAndModifyParameter(buttonText.buttonTextLabel, data.widgetName); + verifyAndModifyParameter('Label', data.widgetName); openAccordion(commonWidgetText.accordionEvents); addDefaultEventHandler(data.alertMessage); 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"), diff --git a/frontend/ee b/frontend/ee index dcd948d284..96d68bb980 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit dcd948d284b5f14a868480830e09b90496db8572 +Subproject commit 96d68bb9801411de58e6ec62c9d0e84bba631fdd diff --git a/frontend/src/AppBuilder/AppCanvas/RenderWidget.jsx b/frontend/src/AppBuilder/AppCanvas/RenderWidget.jsx index f6d6419ac4..9507370e13 100644 --- a/frontend/src/AppBuilder/AppCanvas/RenderWidget.jsx +++ b/frontend/src/AppBuilder/AppCanvas/RenderWidget.jsx @@ -192,6 +192,7 @@ const RenderWidget = ({ onComponentClick={onComponentClick} darkMode={darkMode} componentName={componentName} + dataCy={`draggable-widget-${componentName}`} />