diff --git a/.github/workflows/cypress-marketplace.yml b/.github/workflows/cypress-marketplace.yml index 8cf6c12253..d4a5f4249c 100644 --- a/.github/workflows/cypress-marketplace.yml +++ b/.github/workflows/cypress-marketplace.yml @@ -37,12 +37,30 @@ jobs: - name: use mybuilder buildx run: docker buildx use mybuilder - - name: Build docker image - run: docker buildx build --platform=linux/amd64 -f docker/production.Dockerfile . -t tooljet/tj-osv:cypressplaform + - name: Docker Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set SAFE_BRANCH_NAME + run: echo "SAFE_BRANCH_NAME=$(echo ${{ env.BRANCH_NAME }} | tr '/' '-')" >> $GITHUB_ENV + + - name: Build and Push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: docker/production.Dockerfile + push: true + tags: tooljet/tj-osv:${{ env.SAFE_BRANCH_NAME }} + platforms: linux/amd64 + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Set up environment variables run: | - echo "TOOLJET_HOST=http://localhost:80" >> .env + echo "TOOLJET_HOST=http://localhost:3000" >> .env echo "LOCKBOX_MASTER_KEY=cd97331a419c09387bef49787f7da8d2a81d30733f0de6bed23ad8356d2068b2" >> .env echo "SECRET_KEY_BASE=7073b9a35a15dd20914ae17e36a693093f25b74b96517a5fec461fc901c51e011cd142c731bee48c5081ec8bac321c1f259ef097ef2a16f25df17a3798c03426" >> .env echo "PG_DB=tooljet_development" >> .env @@ -62,10 +80,18 @@ jobs: echo "SSO_GIT_OAUTH2_CLIENT_SECRET=dummy" >> .env echo "SSO_GIT_OAUTH2_HOST=dummy" >> .env echo "SSO_GOOGLE_OAUTH2_CLIENT_ID=dummy" >> .env + echo "ENABLE_MARKETPLACE_FEATURE=true" >> .env + - name: Pulling the docker-compose file run: curl -LO https://tooljet-test.s3.us-west-1.amazonaws.com/docker-compose.yaml && mkdir postgres_data + + - name: Update docker-compose file + run: | + # Update docker-compose.yaml with the new image + sed -i '/^[[:space:]]*tooljet:/,/^$/ s|^\([[:space:]]*image:[[:space:]]*\).*|\1tooljet/tj-osv:${{ env.SAFE_BRANCH_NAME }}|' docker-compose.yaml + - name: Run docker-compose file run: docker-compose up -d @@ -78,7 +104,7 @@ jobs: - name: Wait for the server to be ready run: | timeout 1500 bash -c ' - until curl --silent --fail http://localhost:80; do + until curl --silent --fail http://localhost:3000; do sleep 5 done' @@ -97,7 +123,7 @@ jobs: uses: cypress-io/github-action@v5 with: working-directory: ./cypress-tests - config: "baseUrl=http://localhost:80" + config: "baseUrl=http://localhost:3000" config-file: cypress-marketplace.config.js - name: Capture Screenshots @@ -107,6 +133,7 @@ jobs: name: screenshots path: cypress-tests/cypress/screenshots + Cypress-Marketplace-Subpath: runs-on: ubuntu-22.04 diff --git a/.version b/.version index f01356823f..e88ba89bab 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.29.0 +2.30.3 diff --git a/cypress-tests/cypress/constants/selectors/common.js b/cypress-tests/cypress/constants/selectors/common.js index ae7246d94b..6aab19607c 100644 --- a/cypress-tests/cypress/constants/selectors/common.js +++ b/cypress-tests/cypress/constants/selectors/common.js @@ -256,8 +256,7 @@ export const commonSelectors = { .toLowerCase()}-label"]`; }, defaultModalTitle: '[data-cy="modal-title"]', - workspaceConstantsIcon: '[data-cy="icon-workspace-constants"]' - + workspaceConstantsIcon: '[data-cy="icon-workspace-constants"]', }; export const commonWidgetSelector = { @@ -268,7 +267,9 @@ export const commonWidgetSelector = { draggableWidget: (widgetName) => { return `[data-cy=draggable-widget-${cyParamName(widgetName)}]`; }, - + textInputInputField: (widgetName) => { + return `[data-cy=input-${cyParamName(widgetName)}]`; + }, parameterLabel: (paramName) => { return `[data-cy="${cyParamName(paramName)}-widget-parameter-label"]`; }, diff --git a/cypress-tests/cypress/constants/texts/postgreSql.js b/cypress-tests/cypress/constants/texts/postgreSql.js index 007fab5a25..8abbc48c46 100644 --- a/cypress-tests/cypress/constants/texts/postgreSql.js +++ b/cypress-tests/cypress/constants/texts/postgreSql.js @@ -3,14 +3,14 @@ export const postgreSqlText = { labelAddDataSource: "+ add data source", allDataSources: () => { - return process.env.NODE_ENV === "development" - ? "All data sources (41)" - : "All data sources (43)"; + return Cypress.env("marketplace_action") + ? "All data sources (43)" + : "All data sources (41)"; }, allDatabase: () => { - return process.env.NODE_ENV === "development" - ? "Databases (17)" - : "Databases (19)"; + return Cypress.env("marketplace_action") + ? "Databases (19)" + : "Databases (17)"; }, allApis: "APIs (20)", allCloudStorage: "Cloud Storages (4)", diff --git a/cypress-tests/cypress/e2e/database/database.cy.js b/cypress-tests/cypress/e2e/database/database.cy.skip.js similarity index 100% rename from cypress-tests/cypress/e2e/database/database.cy.js rename to cypress-tests/cypress/e2e/database/database.cy.skip.js diff --git a/cypress-tests/cypress/e2e/editor/data-source/azureBlobStorageHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/azureBlobStorageHappyPath.cy.js index a0a28c2201..8682c4bef9 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/azureBlobStorageHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/azureBlobStorageHappyPath.cy.js @@ -13,13 +13,15 @@ import { dataSourceSelector } from "Selectors/dataSource"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); data.customText = fake.randomSentence; describe("Data source Azure Blob Storage", () => { beforeEach(() => { cy.appUILogin(); cy.intercept("GET", "/api/v2/data_sources"); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on Azure Blob Storage connection form", () => { @@ -48,7 +50,7 @@ describe("Data source Azure Blob Storage", () => { selectAndAddDataSource( "cloudstorage", azureBlobStorageText.azureBlobStorage, - data.lastName + data.dataSourceName ); // cy.get("[data-cy*='data-source-']") @@ -97,7 +99,7 @@ describe("Data source Azure Blob Storage", () => { "have.text", "Cannot read properties of undefined (reading 'startsWith')" ); - deleteDatasource(`cypress-${data.lastName}-azure-blob-storage`); + deleteDatasource(`cypress-${data.dataSourceName}-azure-blob-storage`); }); it("Should verify the functionality of Azure Blob Storage connection form.", () => { @@ -110,7 +112,7 @@ describe("Data source Azure Blob Storage", () => { selectAndAddDataSource( "cloudstorage", azureBlobStorageText.azureBlobStorage, - data.lastName + data.dataSourceName ); fillDataSourceTextField( @@ -155,12 +157,12 @@ describe("Data source Azure Blob Storage", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-azure-blob-storage-button"]` + `[data-cy="cypress-${data.dataSourceName}-azure-blob-storage-button"]` ).verifyVisibleElement( "have.text", - `cypress-${data.lastName}-azure-blob-storage` + `cypress-${data.dataSourceName}-azure-blob-storage` ); - deleteDatasource(`cypress-${data.lastName}-azure-blob-storage`); + deleteDatasource(`cypress-${data.dataSourceName}-azure-blob-storage`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/bigqueryHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/bigqueryHappyPath.cy.js index 018d1e180e..9a86f5b466 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/bigqueryHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/bigqueryHappyPath.cy.js @@ -12,12 +12,14 @@ import { commonText } from "Texts/common"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source BigQuery", () => { beforeEach(() => { cy.appUILogin(); cy.intercept("GET", "/api/v2/data_sources"); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on BigQuery connection form", () => { @@ -44,7 +46,11 @@ describe("Data source BigQuery", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", bigqueryText.bigQuery, data.lastName); + selectAndAddDataSource( + "databases", + bigqueryText.bigQuery, + data.dataSourceName + ); cy.get('[data-cy="label-private-key"]').verifyVisibleElement( "have.text", @@ -83,14 +89,18 @@ describe("Data source BigQuery", () => { bigqueryText.errorInvalidEmailId ); deleteDatasource( - `cypress-${String(data.lastName).toLowerCase()}-${String( + `cypress-${String(data.dataSourceName).toLowerCase()}-${String( bigqueryText.bigQuery ).toLowerCase()}` ); }); it("Should verify the functionality of BigQuery connection form.", () => { - selectAndAddDataSource("databases", bigqueryText.bigQuery, data.lastName); + selectAndAddDataSource( + "databases", + bigqueryText.bigQuery, + data.dataSourceName + ); fillDataSourceTextField( firestoreText.privateKey, @@ -112,9 +122,12 @@ describe("Data source BigQuery", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-bigquery-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-bigquery`); + `[data-cy="cypress-${data.dataSourceName}-bigquery-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-bigquery` + ); - deleteDatasource(`cypress-${data.lastName}-bigquery`); + deleteDatasource(`cypress-${data.dataSourceName}-bigquery`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/clickHouseHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/clickHouseHappyPath.cy.js index 79d7ee9f12..8ab779704f 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/clickHouseHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/clickHouseHappyPath.cy.js @@ -17,11 +17,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -45,7 +47,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "ClickHouse", data.lastName); + selectAndAddDataSource("databases", "ClickHouse", data.dataSourceName); // cy.get(postgreSqlSelector.dataSourceNameInputField).should( // //username,password,host,port,protocol,dbname,usepost, trimquery,gzip,debug,raw @@ -122,11 +124,11 @@ describe("Data sources", () => { cy.get('[data-cy="connection-alert-text"]', { timeout: 60000 }) .scrollIntoView() .verifyVisibleElement("have.text", "getaddrinfo ENOTFOUND undefined"); - deleteDatasource(`cypress-${data.lastName}-clickhouse`); + deleteDatasource(`cypress-${data.dataSourceName}-clickhouse`); }); it("Should verify the functionality of PostgreSQL connection form.", () => { - selectAndAddDataSource("databases", "ClickHouse", data.lastName); + selectAndAddDataSource("databases", "ClickHouse", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -162,8 +164,11 @@ describe("Data sources", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-clickhouse-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-clickhouse`); - deleteDatasource(`cypress-${data.lastName}-clickhouse`); + `[data-cy="cypress-${data.dataSourceName}-clickhouse-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-clickhouse` + ); + deleteDatasource(`cypress-${data.dataSourceName}-clickhouse`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/cosmosDbHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/cosmosDbHappyPath.cy.js index 17cab8912c..caa910dc53 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/cosmosDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/cosmosDbHappyPath.cy.js @@ -17,11 +17,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -44,7 +46,7 @@ describe("Data sources", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "CosmosDB", data.lastName); + selectAndAddDataSource("databases", "CosmosDB", data.dataSourceName); cy.get('[data-cy="label-end-point"]').verifyVisibleElement( "have.text", @@ -83,11 +85,11 @@ describe("Data sources", () => { "have.text", "Invalid URL" ); - deleteDatasource(`cypress-${data.lastName}-cosmosdb`); + deleteDatasource(`cypress-${data.dataSourceName}-cosmosdb`); }); it.only("Should verify the functionality of CosmosDB connection form.", () => { - selectAndAddDataSource("databases", "CosmosDB", data.lastName); + selectAndAddDataSource("databases", "CosmosDB", data.dataSourceName); fillDataSourceTextField( "End point", @@ -112,8 +114,11 @@ describe("Data sources", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-cosmosdb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-cosmosdb`); - deleteDatasource(`cypress-${data.lastName}-cosmosdb`); + `[data-cy="cypress-${data.dataSourceName}-cosmosdb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-cosmosdb` + ); + deleteDatasource(`cypress-${data.dataSourceName}-cosmosdb`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/couchDbHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/couchDbHappyPath.cy.js index 05675797e9..3c279a267c 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/couchDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/couchDbHappyPath.cy.js @@ -18,11 +18,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on CouchDB connection form", () => { @@ -46,7 +48,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "CouchDB", data.lastName); + selectAndAddDataSource("databases", "CouchDB", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -104,11 +106,11 @@ describe("Data sources", () => { "have.text", "Invalid URL" ); - deleteDatasource(`cypress-${data.lastName}-couchdb`); + deleteDatasource(`cypress-${data.dataSourceName}-couchdb`); }); it("Should verify the functionality of CouchDB connection form.", () => { - selectAndAddDataSource("databases", "CouchDB", data.lastName); + selectAndAddDataSource("databases", "CouchDB", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -145,8 +147,11 @@ describe("Data sources", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-couchdb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-couchdb`); - deleteDatasource(`cypress-${data.lastName}-couchdb`); + `[data-cy="cypress-${data.dataSourceName}-couchdb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-couchdb` + ); + deleteDatasource(`cypress-${data.dataSourceName}-couchdb`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/dynamoDbHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/dynamoDbHappyPath.cy.js index a62e9b75fb..80c63daa2e 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/dynamoDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/dynamoDbHappyPath.cy.js @@ -16,11 +16,13 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source DynamoDB", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on DynamoDB connection form", () => { @@ -44,7 +46,11 @@ describe("Data source DynamoDB", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", dynamoDbText.dynamoDb, data.lastName); + selectAndAddDataSource( + "databases", + dynamoDbText.dynamoDb, + data.dataSourceName + ); cy.get('[data-cy="label-region"]').verifyVisibleElement( "have.text", @@ -90,11 +96,15 @@ describe("Data source DynamoDB", () => { "have.text", dynamoDbText.errorMissingRegion ); - deleteDatasource(`cypress-${data.lastName}-dynamodb`); + deleteDatasource(`cypress-${data.dataSourceName}-dynamodb`); }); it("Should verify the functionality of DynamoDB connection form.", () => { - selectAndAddDataSource("databases", dynamoDbText.dynamoDb, data.lastName); + selectAndAddDataSource( + "databases", + dynamoDbText.dynamoDb, + data.dataSourceName + ); cy.get('[data-cy="label-region"]') .parent() @@ -147,9 +157,12 @@ describe("Data source DynamoDB", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-dynamodb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-dynamodb`); + `[data-cy="cypress-${data.dataSourceName}-dynamodb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-dynamodb` + ); - deleteDatasource(`cypress-${data.lastName}-dynamodb`); + deleteDatasource(`cypress-${data.dataSourceName}-dynamodb`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/elasticsearchHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/elasticsearchHappyPath.cy.js index ea9366bc7a..5996816931 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/elasticsearchHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/elasticsearchHappyPath.cy.js @@ -15,11 +15,10 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); - describe("Data source Elasticsearch", () => { beforeEach(() => { cy.appUILogin(); + data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on Elasticsearch connection form", () => { diff --git a/cypress-tests/cypress/e2e/editor/data-source/fireStoreHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/fireStoreHappyPath.cy.js index 9fad112cee..1a9eeb1c29 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/fireStoreHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/fireStoreHappyPath.cy.js @@ -14,11 +14,13 @@ import { selectAndAddDataSource, } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source Firestore", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on Firestore connection form", () => { @@ -41,7 +43,11 @@ describe("Data source Firestore", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", firestoreText.firestore, data.lastName); + selectAndAddDataSource( + "databases", + firestoreText.firestore, + data.dataSourceName + ); cy.get('[data-cy="label-private-key"]').verifyVisibleElement( "have.text", @@ -79,11 +85,15 @@ describe("Data source Firestore", () => { "have.text", firestoreText.errorGcpKeyCouldNotBeParsed ); - deleteDatasource(`cypress-${data.lastName}-firestore`); + deleteDatasource(`cypress-${data.dataSourceName}-firestore`); }); it("Should verify the functionality of Firestore connection form.", () => { - selectAndAddDataSource("databases", firestoreText.firestore, data.lastName); + selectAndAddDataSource( + "databases", + firestoreText.firestore, + data.dataSourceName + ); fillDataSourceTextField( firestoreText.privateKey, @@ -104,9 +114,12 @@ describe("Data source Firestore", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-firestore-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-firestore`); + `[data-cy="cypress-${data.dataSourceName}-firestore-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-firestore` + ); - deleteDatasource(`cypress-${data.lastName}-firestore`); + deleteDatasource(`cypress-${data.dataSourceName}-firestore`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/influxDbHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/influxDbHappyPath.cy.js index 0bbb1b79e2..53ec069652 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/influxDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/influxDbHappyPath.cy.js @@ -20,11 +20,13 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -48,7 +50,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "InfluxDB", data.lastName); + selectAndAddDataSource("databases", "InfluxDB", data.dataSourceName); cy.get('[data-cy="label-api-token"]').verifyVisibleElement( "have.text", @@ -97,11 +99,11 @@ describe("Data sources", () => { "have.text", "Invalid URL" ); - deleteDatasource(`cypress-${data.lastName}-influxdb`); + deleteDatasource(`cypress-${data.dataSourceName}-influxdb`); }); it("Should verify the functionality of PostgreSQL connection form.", () => { - selectAndAddDataSource("databases", "InfluxDB", data.lastName); + selectAndAddDataSource("databases", "InfluxDB", data.dataSourceName); fillDataSourceTextField( "API token", @@ -129,9 +131,12 @@ describe("Data sources", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-influxdb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-influxdb`); + `[data-cy="cypress-${data.dataSourceName}-influxdb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-influxdb` + ); - deleteDatasource(`cypress-${data.lastName}-influxdb`); + deleteDatasource(`cypress-${data.dataSourceName}-influxdb`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/mariaDbHappyPath.cy.skip.js b/cypress-tests/cypress/e2e/editor/data-source/mariaDbHappyPath.cy.skip.js index 3e0bba2e01..91b8baf933 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/mariaDbHappyPath.cy.skip.js +++ b/cypress-tests/cypress/e2e/editor/data-source/mariaDbHappyPath.cy.skip.js @@ -16,11 +16,13 @@ import { fake } from "Fixtures/fake"; import { closeDSModal, deleteDatasource } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -44,7 +46,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "MariaDB", data.lastName); + selectAndAddDataSource("databases", "MariaDB", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -106,11 +108,11 @@ describe("Data sources", () => { postgreSqlText.buttonTextSave ); // cy.get('[data-cy="connection-alert-text"]').should("be.visible") - deleteDatasource(`cypress-${data.lastName}-mariadb`); + deleteDatasource(`cypress-${data.dataSourceName}-mariadb`); }); it("Should verify the functionality of MariaDB connection form.", () => { - selectAndAddDataSource("databases", "MariaDB", data.lastName); + selectAndAddDataSource("databases", "MariaDB", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -161,9 +163,12 @@ describe("Data sources", () => { ); cy.get( - `[data-cy="cypress-${data.lastName}-mariadb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-mariadb`); + `[data-cy="cypress-${data.dataSourceName}-mariadb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-mariadb` + ); - deleteDatasource(`cypress-${data.lastName}-mariadb`); + deleteDatasource(`cypress-${data.dataSourceName}-mariadb`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/mongoDbHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/mongoDbHappyPath.cy.js index 6d76fcabf6..99e92df0c8 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/mongoDbHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/mongoDbHappyPath.cy.js @@ -24,11 +24,13 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source MongoDB", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on MongoDB connection form", () => { @@ -50,7 +52,11 @@ describe("Data source MongoDB", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", mongoDbText.mongoDb, data.lastName); + selectAndAddDataSource( + "databases", + mongoDbText.mongoDb, + data.dataSourceName + ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -144,11 +150,15 @@ describe("Data source MongoDB", () => { .verifyVisibleElement("have.text", postgreSqlText.buttonTextSave) .click(); - deleteDatasource(`cypress-${data.lastName}-mongodb`); + deleteDatasource(`cypress-${data.dataSourceName}-mongodb`); }); it("Should verify the functionality of MongoDB connection form.", () => { - selectAndAddDataSource("databases", mongoDbText.mongoDb, data.lastName); + selectAndAddDataSource( + "databases", + mongoDbText.mongoDb, + data.dataSourceName + ); cy.get('[data-cy="query-select-dropdown"]').type( mongoDbText.optionConnectUsingConnectionString @@ -174,10 +184,13 @@ describe("Data source MongoDB", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-mongodb-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-mongodb`); + `[data-cy="cypress-${data.dataSourceName}-mongodb-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-mongodb` + ); - deleteDatasource(`cypress-${data.lastName}-mongodb`); + deleteDatasource(`cypress-${data.dataSourceName}-mongodb`); }); it.skip("Should verify the queries of MongoDB.", () => { diff --git a/cypress-tests/cypress/e2e/editor/data-source/mysqlHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/mysqlHappyPath.cy.js index 88006ac4d0..1570b91ee2 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/mysqlHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/mysqlHappyPath.cy.js @@ -22,11 +22,13 @@ import { import { realHover } from "cypress-real-events/commands/realHover"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources MySql", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on MySQL connection form", () => { @@ -50,7 +52,7 @@ describe("Data sources MySql", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "MySQL", data.lastName); + selectAndAddDataSource("databases", "MySQL", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -101,11 +103,11 @@ describe("Data sources MySql", () => { postgreSqlText.buttonTextSave ); verifyCouldnotConnectWithAlert(mySqlText.errorConnectionRefused); - deleteDatasource(`cypress-${data.lastName}-mysql`); + deleteDatasource(`cypress-${data.dataSourceName}-mysql`); }); - it("Should verify the functionality of MySQL connection form.", () => { - selectAndAddDataSource("databases", "MySQL", data.lastName); + it.only("Should verify the functionality of MySQL connection form.", () => { + selectAndAddDataSource("databases", "MySQL", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -115,7 +117,7 @@ describe("Data sources MySql", () => { fillDataSourceTextField( postgreSqlText.labelPort, postgreSqlText.placeholderEnterPort, - "3318" + "3306" ); fillDataSourceTextField( postgreSqlText.labelDbName, @@ -134,6 +136,7 @@ describe("Data sources MySql", () => { ); cy.get(postgreSqlSelector.buttonTestConnection).click(); + cy.wait(500); verifyCouldnotConnectWithAlert(""); fillDataSourceTextField( postgreSqlText.labelDbName, @@ -146,6 +149,7 @@ describe("Data sources MySql", () => { "admin1" ); cy.get(postgreSqlSelector.buttonTestConnection).click(); + cy.wait(500); verifyCouldnotConnectWithAlert( "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client" ); @@ -158,6 +162,7 @@ describe("Data sources MySql", () => { cy.get(postgreSqlSelector.passwordTextField).type("testpassword"); cy.get(postgreSqlSelector.buttonTestConnection).click(); + cy.wait(500); verifyCouldnotConnectWithAlert( "ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'103.171.99.42' (using password: YES)" ); @@ -193,15 +198,15 @@ describe("Data sources MySql", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-mysql-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-mysql`); + `[data-cy="cypress-${data.dataSourceName}-mysql-button"]` + ).verifyVisibleElement("have.text", `cypress-${data.dataSourceName}-mysql`); - deleteDatasource(`cypress-${data.lastName}-mysql`); + deleteDatasource(`cypress-${data.dataSourceName}-mysql`); }); it.skip("Should verify elements of the Query section.", () => { cy.viewport(1200, 1300); - selectAndAddDataSource("databases", "MySQL", data.lastName); + selectAndAddDataSource("databases", "MySQL", data.dataSourceName); fillConnectionForm({ Host: Cypress.env("mysql_host"), Port: Cypress.env("mysql_port"), @@ -371,7 +376,7 @@ describe("Data sources MySql", () => { it.skip("Should verify CRUD operations on SQL Query.", () => { let dbName = "7mmplik"; - selectAndAddDataSource("databases", "MySQL", data.lastName); + selectAndAddDataSource("databases", "MySQL", data.dataSourceName); cy.clearAndType( postgreSqlSelector.dataSourceNameInputField, @@ -450,14 +455,14 @@ describe("Data sources MySql", () => { }); it.skip("Should verify bulk update", () => { - selectAndAddDataSource("databases", "MySQL", data.lastName); + selectAndAddDataSource("databases", "MySQL", data.dataSourceName); cy.clearAndType( postgreSqlSelector.dataSourceNameInputField, mySqlText.cypressMySql ); fillConnectionForm({ Host: Cypress.env("mysql_host"), - Port: "3318", + Port: "3306", "Database Name": "testdv", Username: Cypress.env("mysql_user"), Password: Cypress.env("mysql_password"), diff --git a/cypress-tests/cypress/e2e/editor/data-source/postgresHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/postgresHappyPath.cy.js index 952521dc97..4698deafa7 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/postgresHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/postgresHappyPath.cy.js @@ -16,11 +16,13 @@ import { import { deleteDatasource } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -49,7 +51,7 @@ describe("Data sources", () => { selectAndAddDataSource( "databases", postgreSqlText.postgreSQL, - data.lastName + data.dataSourceName ); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( @@ -108,14 +110,14 @@ describe("Data sources", () => { postgreSqlText.buttonTextSave ); cy.get('[data-cy="connection-alert-text"]').should("be.visible"); - deleteDatasource(`cypress-${data.lastName}-postgresql`); + deleteDatasource(`cypress-${data.dataSourceName}-postgresql`); }); it("Should verify the functionality of PostgreSQL connection form.", () => { selectAndAddDataSource( "databases", postgreSqlText.postgreSQL, - data.lastName + data.dataSourceName ); fillDataSourceTextField( @@ -162,17 +164,20 @@ describe("Data sources", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-postgresql-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-postgresql`); + `[data-cy="cypress-${data.dataSourceName}-postgresql-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-postgresql` + ); - deleteDatasource(`cypress-${data.lastName}-postgresql`); + deleteDatasource(`cypress-${data.dataSourceName}-postgresql`); }); it.skip("Should verify elements of the Query section.", () => { selectAndAddDataSource( "databases", postgreSqlText.postgreSQL, - data.lastName + data.dataSourceName ); fillConnectionForm( { @@ -367,7 +372,7 @@ describe("Data sources", () => { selectAndAddDataSource( "databases", postgreSqlText.postgreSQL, - data.lastName + data.dataSourceName ); cy.clearAndType( @@ -458,7 +463,7 @@ describe("Data sources", () => { selectAndAddDataSource( "databases", postgreSqlText.postgreSQL, - data.lastName + data.dataSourceName ); fillConnectionForm({ Host: Cypress.env("pg_host"), diff --git a/cypress-tests/cypress/e2e/editor/data-source/redisHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/redisHappyPath.cy.js index 112af1767f..ec3099b332 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/redisHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/redisHappyPath.cy.js @@ -15,11 +15,13 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source Redis", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connecti Redison form", () => { @@ -43,7 +45,7 @@ describe("Data source Redis", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", redisText.redis, data.lastName); + selectAndAddDataSource("databases", redisText.redis, data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", postgreSqlText.labelHost @@ -99,10 +101,10 @@ describe("Data source Redis", () => { commonSelectors.toastMessage, postgreSqlText.toastDSSaved ); - deleteDatasource(`cypress-${data.lastName}-redis`); + deleteDatasource(`cypress-${data.dataSourceName}-redis`); }); it("Should verify the functionality of Redis connection form.", () => { - selectAndAddDataSource("databases", redisText.redis, data.lastName); + selectAndAddDataSource("databases", redisText.redis, data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -201,9 +203,9 @@ describe("Data source Redis", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-redis-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-redis`); + `[data-cy="cypress-${data.dataSourceName}-redis-button"]` + ).verifyVisibleElement("have.text", `cypress-${data.dataSourceName}-redis`); - deleteDatasource(`cypress-${data.lastName}-redis`); + deleteDatasource(`cypress-${data.dataSourceName}-redis`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/rethinkDbHappyPath.cy.skip.js b/cypress-tests/cypress/e2e/editor/data-source/rethinkDbHappyPath.cy.skip.js index 6c64773619..fd1adba22e 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/rethinkDbHappyPath.cy.skip.js +++ b/cypress-tests/cypress/e2e/editor/data-source/rethinkDbHappyPath.cy.skip.js @@ -15,11 +15,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -43,7 +45,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "RethinkDB", data.lastName); + selectAndAddDataSource("databases", "RethinkDB", data.dataSourceName); cy.get('[data-cy="label-database"]').verifyVisibleElement( "have.text", @@ -101,7 +103,7 @@ describe("Data sources", () => { }); it("Should verify the functionality of RethinkDB connection form.", () => { - selectAndAddDataSource("databases", "RethinkDB", data.lastName); + selectAndAddDataSource("databases", "RethinkDB", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, diff --git a/cypress-tests/cypress/e2e/editor/data-source/s3HappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/s3HappyPath.cy.js index 036b7f69f0..1ce09d0e73 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/s3HappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/s3HappyPath.cy.js @@ -16,11 +16,13 @@ import { } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources AWS S3", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on AWS S3 connection form", () => { @@ -44,7 +46,7 @@ describe("Data sources AWS S3", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("cloudstorage", s3Text.awsS3, data.lastName); + selectAndAddDataSource("cloudstorage", s3Text.awsS3, data.dataSourceName); cy.get(s3Selector.accessKeyLabel).verifyVisibleElement( "have.text", s3Text.accessKey @@ -100,11 +102,11 @@ describe("Data sources AWS S3", () => { commonSelectors.toastMessage, postgreSqlText.toastDSSaved ); - deleteDatasource(`cypress-${data.lastName}-aws-s3`); + deleteDatasource(`cypress-${data.dataSourceName}-aws-s3`); }); it("Should verify the functionality of AWS S3 connection form.", () => { - selectAndAddDataSource("cloudstorage", s3Text.awsS3, data.lastName); + selectAndAddDataSource("cloudstorage", s3Text.awsS3, data.dataSourceName); fillDataSourceTextField( s3Text.accessKey, @@ -189,8 +191,11 @@ describe("Data sources AWS S3", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-aws-s3-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-aws-s3`); - deleteDatasource(`cypress-${data.lastName}-aws-s3`); + `[data-cy="cypress-${data.dataSourceName}-aws-s3-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-aws-s3` + ); + deleteDatasource(`cypress-${data.dataSourceName}-aws-s3`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/smtpHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/smtpHappyPath.cy.js index 569cf1f3f2..42f5e2ce43 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/smtpHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/smtpHappyPath.cy.js @@ -10,11 +10,13 @@ import { import { deleteDatasource, closeDSModal } from "Support/utils/dataSource"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data source SMTP", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on SMTP connection form", () => { @@ -37,7 +39,7 @@ describe("Data source SMTP", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("apis", "SMTP", data.lastName); + selectAndAddDataSource("apis", "SMTP", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -84,11 +86,11 @@ describe("Data source SMTP", () => { "have.text", "Invalid credentials" ); - deleteDatasource(`cypress-${data.lastName}-smtp`); + deleteDatasource(`cypress-${data.dataSourceName}-smtp`); }); it("Should verify the functionality of SMTP connection form.", () => { - selectAndAddDataSource("apis", "SMTP", data.lastName); + selectAndAddDataSource("apis", "SMTP", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -128,8 +130,8 @@ describe("Data source SMTP", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-smtp-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-smtp`); - deleteDatasource(`cypress-${data.lastName}-smtp`); + `[data-cy="cypress-${data.dataSourceName}-smtp-button"]` + ).verifyVisibleElement("have.text", `cypress-${data.dataSourceName}-smtp`); + deleteDatasource(`cypress-${data.dataSourceName}-smtp`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/snowflakeHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/snowflakeHappyPath.cy.js index ae8f830a92..1b72ece15c 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/snowflakeHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/snowflakeHappyPath.cy.js @@ -16,14 +16,15 @@ import { addWidgetsToAddUser, } from "Support/utils/postgreSql"; +const data = {}; describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); - const data = {}; - data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); - it("Should verify elements on connection form", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); closeDSModal(); @@ -44,7 +45,7 @@ describe("Data sources", () => { "have.text", postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "Snowflake", data.lastName); + selectAndAddDataSource("databases", "Snowflake", data.dataSourceName); cy.get(postgreSqlSelector.labelUserName).verifyVisibleElement( "have.text", @@ -105,11 +106,11 @@ describe("Data sources", () => { "have.text", "Invalid account. The specified value must be a valid subdomain string." ); - deleteDatasource(`cypress-${data.lastName}-snowflake`); + deleteDatasource(`cypress-${data.dataSourceName}-snowflake`); }); it.skip("Should verify the functionality of PostgreSQL connection form.", () => { - selectAndAddDataSource("databases", "Snowflake", data.lastName); + selectAndAddDataSource("databases", "Snowflake", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelUserName, @@ -151,9 +152,12 @@ describe("Data sources", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-snowflake-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-snowflake`); + `[data-cy="cypress-${data.dataSourceName}-snowflake-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-snowflake` + ); - deleteDatasource(`cypress-${data.lastName}-snowflake`); + deleteDatasource(`cypress-${data.dataSourceName}-snowflake`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/sqlServerHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/data-source/sqlServerHappyPath.cy.js index eb61362906..0395425888 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/sqlServerHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/data-source/sqlServerHappyPath.cy.js @@ -17,11 +17,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -45,7 +47,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "SQL Server", data.lastName); + selectAndAddDataSource("databases", "SQL Server", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -107,11 +109,11 @@ describe("Data sources", () => { "have.text", "Failed to connect to localhost:1433 - Could not connect (sequence)" ); - deleteDatasource(`cypress-${data.lastName}-sql-server`); + deleteDatasource(`cypress-${data.dataSourceName}-sql-server`); }); it("Should verify the functionality of SQL Server connection form.", () => { - selectAndAddDataSource("databases", "SQL Server", data.lastName); + selectAndAddDataSource("databases", "SQL Server", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -158,8 +160,11 @@ describe("Data sources", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-sql-server-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-sql-server`); - deleteDatasource(`cypress-${data.lastName}-sql-server`); + `[data-cy="cypress-${data.dataSourceName}-sql-server-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-sql-server` + ); + deleteDatasource(`cypress-${data.dataSourceName}-sql-server`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/data-source/typeSenseHappyPath.cy.skip.js b/cypress-tests/cypress/e2e/editor/data-source/typeSenseHappyPath.cy.skip.js index d21af92269..aaba0fb6ec 100644 --- a/cypress-tests/cypress/e2e/editor/data-source/typeSenseHappyPath.cy.skip.js +++ b/cypress-tests/cypress/e2e/editor/data-source/typeSenseHappyPath.cy.skip.js @@ -17,11 +17,13 @@ import { } from "Support/utils/postgreSql"; const data = {}; -data.lastName = fake.lastName.toLowerCase().replaceAll("[^A-Za-z]", ""); describe("Data sources", () => { beforeEach(() => { cy.appUILogin(); + data.dataSourceName = fake.lastName + .toLowerCase() + .replaceAll("[^A-Za-z]", ""); }); it("Should verify elements on connection form", () => { @@ -45,7 +47,7 @@ describe("Data sources", () => { postgreSqlText.allCloudStorage ); - selectAndAddDataSource("databases", "TypeSense", data.lastName); + selectAndAddDataSource("databases", "TypeSense", data.dataSourceName); cy.get(postgreSqlSelector.labelHost).verifyVisibleElement( "have.text", @@ -94,11 +96,11 @@ describe("Data sources", () => { "have.text", "Ensure that apiKey is set" ); - deleteDatasource(`cypress-${data.lastName}-typesense`); + deleteDatasource(`cypress-${data.dataSourceName}-typesense`); }); it("Should verify the functionality of TypeSense connection form.", () => { - selectAndAddDataSource("databases", "TypeSense", data.lastName); + selectAndAddDataSource("databases", "TypeSense", data.dataSourceName); fillDataSourceTextField( postgreSqlText.labelHost, @@ -130,9 +132,12 @@ describe("Data sources", () => { cy.get(commonSelectors.globalDataSourceIcon).click(); cy.get( - `[data-cy="cypress-${data.lastName}-typesense-button"]` - ).verifyVisibleElement("have.text", `cypress-${data.lastName}-typesense`); + `[data-cy="cypress-${data.dataSourceName}-typesense-button"]` + ).verifyVisibleElement( + "have.text", + `cypress-${data.dataSourceName}-typesense` + ); - deleteDatasource(`cypress-${data.lastName}-typesense`); + deleteDatasource(`cypress-${data.dataSourceName}-typesense`); }); }); diff --git a/cypress-tests/cypress/e2e/editor/globalSetingsHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/globalSetingsHappyPath.cy.js index 033365e6b1..d1fe99ce82 100644 --- a/cypress-tests/cypress/e2e/editor/globalSetingsHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/globalSetingsHappyPath.cy.js @@ -89,7 +89,8 @@ describe("Editor- Global Settings", () => { cy.get('[data-cy="modal-confirm-button"]').click(); cy.verifyToastMessage( commonSelectors.toastMessage, - "Application is on maintenance." + "Application is on maintenance.", + false ); cy.forceClickOnCanvas(); cy.wait(500); @@ -98,6 +99,7 @@ describe("Editor- Global Settings", () => { 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() .find('[data-cy="launch-button"]') diff --git a/cypress-tests/cypress/e2e/editor/inspectorHappypath.cy.js b/cypress-tests/cypress/e2e/editor/inspectorHappypath.cy.js index 4c3b69465f..c36bc260a4 100644 --- a/cypress-tests/cypress/e2e/editor/inspectorHappypath.cy.js +++ b/cypress-tests/cypress/e2e/editor/inspectorHappypath.cy.js @@ -3,7 +3,12 @@ import { verifyMultipleComponentValuesFromInspector, verifyComponentValueFromInspector, } from "Support/utils/commonWidget"; -import { verifyNodeData, openNode, verifyValue, deleteComponentFromInspector } from "Support/utils/inspector"; +import { + verifyNodeData, + openNode, + verifyValue, + deleteComponentFromInspector, +} from "Support/utils/inspector"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; import { addNewPage } from "Support/utils/multipage"; import { @@ -12,19 +17,16 @@ import { addSupportCSAData, } from "Support/utils/events"; import { multipageSelector } from "Selectors/multipage"; -import { - navigateToCreateNewVersionModal -} from "Support/utils/version"; +import { navigateToCreateNewVersionModal } from "Support/utils/version"; import { createNewVersion } from "Support/utils/exportImport"; - describe("Editor- Inspector", () => { let currentVersion = ""; let newVersion = []; let versionFrom = ""; beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-inspector-App`); cy.openApp(); }); @@ -94,7 +96,9 @@ describe("Editor- Inspector", () => { cy.get('[data-cy="button-add-query-param"]').click(); cy.wait(3000); cy.get("body").then(($body) => { - if ($body.find('[data-cy="query-param-key-input-field"]').length == 0) { + if ( + $body.find('[data-cy="event-query-param-key-input-field"]').length == 0 + ) { cy.get('[data-cy="button-add-query-param"]').click(); } }); @@ -189,6 +193,5 @@ describe("Editor- Inspector", () => { navigateToCreateNewVersionModal((currentVersion = "v1")); createNewVersion((newVersion = ["v2"]), (versionFrom = "v1")); cy.notVisible(commonWidgetSelector.draggableWidget("button1")); - }); }); diff --git a/cypress-tests/cypress/e2e/editor/multipage/multipageHappypath.cy.js b/cypress-tests/cypress/e2e/editor/multipage/multipageHappypath.cy.js index 102390388d..d84bc449c1 100644 --- a/cypress-tests/cypress/e2e/editor/multipage/multipageHappypath.cy.js +++ b/cypress-tests/cypress/e2e/editor/multipage/multipageHappypath.cy.js @@ -8,7 +8,7 @@ import { buttonText } from "Texts/button"; import { verifyControlComponentAction, randomString, -} from "Support/utils/textInput"; +} from "Support/utils/editor/textInput"; import { openAccordion, verifyAndModifyParameter, diff --git a/cypress-tests/cypress/e2e/editor/queries/chainingOfQueries.cy.js b/cypress-tests/cypress/e2e/editor/queries/chainingOfQueries.cy.js index 9f485b7c41..ad6dfe43fa 100644 --- a/cypress-tests/cypress/e2e/editor/queries/chainingOfQueries.cy.js +++ b/cypress-tests/cypress/e2e/editor/queries/chainingOfQueries.cy.js @@ -2,7 +2,7 @@ import { fake } from "Fixtures/fake"; import { commonSelectors, commonWidgetSelector } from "Selectors/common"; import { openEditorSidebar } from "Support/utils/commonWidget"; import { selectEvent } from "Support/utils/events"; -import { randomString } from "Support/utils/textInput"; +import { randomString } from "Support/utils/editor/textInput"; import { buttonText } from "Texts/button"; import { addSuccessNotification, chainQuery } from "Support/utils/queries"; @@ -12,7 +12,7 @@ import { resizeQueryPanel } from "Support/utils/dataSource"; describe("Chaining of queries", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-chaining-App`); cy.openApp(); cy.viewport(1800, 1800); cy.dragAndDropWidget("Button"); @@ -58,7 +58,7 @@ describe("Chaining of queries", () => { cy.apiCreateGDS( "http://localhost:3000/api/v2/data_sources", - `cypress-${dsName}-postgresql`, + `cypress-${dsName}-qc-postgresql`, "postgresql", [ { key: "host", value: Cypress.env("pg_host") }, @@ -76,9 +76,9 @@ describe("Chaining of queries", () => { mode: "sql", transformationLanguage: "javascript", enableTransformation: false, - query: `SELECT * FROM server_side_pagination`, + query: `SELECT * FROM pg_stat_activity;`, }, - `cypress-${dsName}-postgresql`, + `cypress-${dsName}-qc-postgresql`, "postgresql" ); cy.reload(); diff --git a/cypress-tests/cypress/e2e/editor/queries/runjsHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/queries/runjsHappyPath.cy.js index c8f4578f82..38a5919309 100644 --- a/cypress-tests/cypress/e2e/editor/queries/runjsHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/queries/runjsHappyPath.cy.js @@ -7,7 +7,7 @@ import { buttonText } from "Texts/button"; import { verifyControlComponentAction, randomString, -} from "Support/utils/textInput"; +} from "Support/utils/editor/textInput"; import { openAccordion, verifyAndModifyParameter, @@ -64,7 +64,7 @@ import { deleteDownloadsFolder } from "Support/utils/common"; describe("RunJS", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-runjs-App`); cy.openApp(); cy.viewport(1800, 1800); cy.dragAndDropWidget("Button"); @@ -201,6 +201,7 @@ describe("RunJS", () => { cy.get('[data-cy="sign-in-header"]').should("be.visible"); cy.apiLogin(); cy.openApp( + Cypress.env("workspaceId"), Cypress.env("appId"), '[data-cy="draggable-widget-modal1-launch-button"]' ); diff --git a/cypress-tests/cypress/e2e/editor/queries/runpyHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/queries/runpyHappyPath.cy.js index 20173913b3..471e4a83c7 100644 --- a/cypress-tests/cypress/e2e/editor/queries/runpyHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/queries/runpyHappyPath.cy.js @@ -7,7 +7,7 @@ import { buttonText } from "Texts/button"; import { verifyControlComponentAction, randomString, -} from "Support/utils/textInput"; +} from "Support/utils/editor/textInput"; import { openAccordion, verifyAndModifyParameter, @@ -63,7 +63,7 @@ import { verifyNodeData, openNode, verifyValue } from "Support/utils/inspector"; describe("runpy", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-runpy-App`); cy.openApp(); cy.viewport(1800, 1800); cy.dragAndDropWidget("Button"); diff --git a/cypress-tests/cypress/e2e/editor/widget/appTitle.cy.js b/cypress-tests/cypress/e2e/editor/widget/appTitle.cy.js index 904d85e4d7..34f303769f 100644 --- a/cypress-tests/cypress/e2e/editor/widget/appTitle.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/appTitle.cy.js @@ -6,7 +6,7 @@ import { buttonText } from "Texts/button"; import { verifyControlComponentAction, randomString, -} from "Support/utils/textInput"; +} from "Support/utils/editor/textInput"; import { openAccordion, verifyAndModifyParameter, @@ -44,17 +44,17 @@ describe("Editor title", () => { }); it("should verify titles", () => { cy.url().should("include", "/my-workspace"); - cy.title().should("eq", "ToolJet - Dashboard"); + cy.title().should("eq", "Dashboard | ToolJet"); cy.log(data.appName); cy.openApp(); cy.url().should("include", Cypress.env("appId")); - cy.title().should("eq", `${data.appName} - Tooljet`); + cy.title().should("eq", `${data.appName} | ToolJet`); cy.openInCurrentTab(commonWidgetSelector.previewButton); cy.url().should("include", `/applications/${Cypress.env("appId")}`); - cy.title().should("eq", `${data.appName}`); + cy.title().should("eq", `Preview - ${data.appName} | ToolJet`); cy.go("back"); cy.releaseApp(); cy.url().then((url) => cy.visit(`/applications/${url.split("/").pop()}`)); diff --git a/cypress-tests/cypress/e2e/editor/widget/buttonHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/buttonHappyPath.cy.js index 3ae3466e73..5213974aa9 100644 --- a/cypress-tests/cypress/e2e/editor/widget/buttonHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/buttonHappyPath.cy.js @@ -248,7 +248,9 @@ describe("Editor- Test Button widget", () => { buttonText.borderRadiusInput ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get( commonWidgetSelector.draggableWidget(buttonText.defaultWidgetName) ).should("have.css", "border-radius", "20px"); @@ -350,7 +352,7 @@ describe("Editor- Test Button widget", () => { cy.wait(500); cy.verifyToastMessage(commonSelectors.toastMessage, data.alertMessage); - cy.get(commonWidgetSelector.draggableWidget("textinput1")).should( + cy.get('[data-cy="input-textinput1"]').should( "have.value", data.customMessage ); @@ -400,9 +402,13 @@ describe("Editor- Test Button widget", () => { cy.get('[data-cy="real-canvas"]').click("topRight", { force: true }); cy.dragAndDropWidget(buttonText.defaultWidgetText, 500, 150); selectEvent("On click", "Control Component"); + cy.wait("@events"); selectCSA("button1", "Disable"); - cy.get('[data-cy="Value-fx-button"]').realClick(); - cy.get('[data-cy="Value-input-field"]').clearAndTypeOnCodeMirror(`{{true`); + cy.wait("@events"); + cy.get('[data-cy="event-Value-fx-button"]').realClick(); + cy.get('[data-cy="event-Value-input-field"]').clearAndTypeOnCodeMirror( + `{{true` + ); cy.get('[data-cy="real-canvas"]').click("topRight", { force: true }); cy.dragAndDropWidget(buttonText.defaultWidgetText, 500, 200); @@ -414,8 +420,10 @@ describe("Editor- Test Button widget", () => { selectEvent("On click", "Control Component"); selectCSA("button1", "Loading"); cy.wait(500); - cy.get('[data-cy="Value-fx-button"]').realClick(); - cy.get('[data-cy="Value-input-field"]').clearAndTypeOnCodeMirror(`{{true`); + cy.get('[data-cy="event-Value-fx-button"]').realClick(); + cy.get('[data-cy="event-Value-input-field"]').clearAndTypeOnCodeMirror( + `{{true` + ); cy.get(commonWidgetSelector.draggableWidget("textinput1")).type("testBtn"); cy.wait(500); @@ -444,8 +452,8 @@ describe("Editor- Test Button widget", () => { cy.apiDeleteApp(); }); it("Should verify deletion of button component from right side panel", () => { - cy.get(".col-2").click(); - cy.get(".list-item-popover-body > :nth-child(3)").click(); + cy.get('[data-cy="component-inspector-options"]').click(); + cy.get('[data-cy="component-inspector-delete-button"]').click(); cy.get('[data-cy="yes-button"]').click(); cy.verifyToastMessage( `[class=go3958317564]`, diff --git a/cypress-tests/cypress/e2e/editor/widget/componentDuplicationHappypath.cy.js b/cypress-tests/cypress/e2e/editor/widget/componentDuplicationHappypath.cy.js index 991b933518..9e56c5857e 100644 --- a/cypress-tests/cypress/e2e/editor/widget/componentDuplicationHappypath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/componentDuplicationHappypath.cy.js @@ -25,7 +25,9 @@ describe("Editor- component duplication", () => { data.boxShadowParam = fake.boxShadowParam; data.tooltipText = fake.randomSentence; }); - + afterEach(() => { + cy.apiDeleteApp(`${fake.companyName}-App`); + }); it("should verify duplication using copy and paste", () => { addBasicData(data); cy.forceClickOnCanvas(); diff --git a/cypress-tests/cypress/e2e/editor/widget/csa.cy.js b/cypress-tests/cypress/e2e/editor/widget/csa.cy.js index 6811fb273c..08a529348e 100644 --- a/cypress-tests/cypress/e2e/editor/widget/csa.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/csa.cy.js @@ -190,7 +190,7 @@ describe("Editor- CSA", () => { cy.dragAndDropWidget("Button", 500, 200); selectEvent("On click", "Control Component"); selectCSA("icon1", "Set Visibility"); - cy.get('[data-cy="Value-toggle-button"]') + cy.get('[data-cy="event-Value-toggle-button"]') .should("be.visible") .and("be.checked"); @@ -198,8 +198,10 @@ describe("Editor- CSA", () => { cy.dragAndDropWidget("Button", 500, 300); selectEvent("On click", "Control Component"); selectCSA("icon1", "Set Visibility"); - cy.get('[data-cy="Value-fx-button"]').click(); - cy.get('[data-cy="Value-input-field"]').clearAndTypeOnCodeMirror("{{false"); + cy.get('[data-cy="event-Value-fx-button"]').click(); + cy.get('[data-cy="event-Value-input-field"]').clearAndTypeOnCodeMirror( + "{{false" + ); // cy.get('[data-cy="Value-toggle-button"]') // .should("be.visible") // .and("not.be.checked"); diff --git a/cypress-tests/cypress/e2e/editor/widget/datePickerHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/datePickerHappyPath.cy.js index 26960868b8..ca08a84bb1 100644 --- a/cypress-tests/cypress/e2e/editor/widget/datePickerHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/datePickerHappyPath.cy.js @@ -33,7 +33,7 @@ import { describe("Date Picker widget", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(); + cy.apiCreateApp(`${fake.companyName}-datepicker-App`); cy.openApp(); cy.dragAndDropWidget("Date Picker"); }); @@ -60,21 +60,27 @@ describe("Date Picker widget", () => { verifyAndModifyParameter(datePickerText.labelDefaultValue, data.date); verifyComponentValueFromInspector(data.widgetName, data.date); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); verifyDate(data.widgetName, data.date); data.date = randomDateOrTime(); selectAndVerifyDate(data.widgetName, data.date); openEditorSidebar(data.widgetName); verifyAndModifyParameter(datePickerText.labelformat, "DD/MM/YY"); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); verifyDate(data.widgetName, data.date, "DD/MM/YY"); verifyComponentValueFromInspector(data.widgetName, data.date); cy.get(commonSelectors.canvas).click({ force: true }); openEditorSidebar(data.widgetName); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); // verifyDate(data.widgetName, ""); openEditorSidebar(data.widgetName); verifyAndModifyToggleFx( @@ -90,7 +96,9 @@ describe("Date Picker widget", () => { ); openEditorSidebar(data.widgetName); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); verifyDate(data.widgetName, datePickerText.defaultTime, "hh:mm A"); selectAndVerifyTime(data.widgetName, data.randomTime); verifyAndModifyToggleFx( @@ -103,7 +111,9 @@ describe("Date Picker widget", () => { "{{", "[05-01]}}", ]); //WIP - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); openEditorSidebar(data.widgetName); openAccordion(commonWidgetText.accordionProperties, [ @@ -124,7 +134,9 @@ describe("Date Picker widget", () => { datePickerText.noEventMessage ); addDefaultEventHandler(data.alertMessage); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); data.date = randomDateOrTime(); selectAndVerifyDate(data.widgetName, data.date, "DD/MM/YY"); cy.verifyToastMessage(commonSelectors.toastMessage, data.alertMessage); @@ -202,7 +214,9 @@ describe("Date Picker widget", () => { commonWidgetText.parameterBorderRadius, commonWidgetText.borderRadiusInput ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get(commonWidgetSelector.draggableWidget(datePickerText.datepicker1)) .find("input") .should("have.css", "border-radius", "20px"); diff --git a/cypress-tests/cypress/e2e/editor/widget/listViewHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/listViewHappyPath.cy.js index fe21f3809d..112aa8d744 100644 --- a/cypress-tests/cypress/e2e/editor/widget/listViewHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/listViewHappyPath.cy.js @@ -35,7 +35,7 @@ import { describe("List view widget", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-Listview-App`); cy.openApp(); cy.viewport(1200, 1200); cy.dragAndDropWidget("List View", 50, 500); @@ -62,7 +62,7 @@ describe("List view widget", () => { deleteInnerWidget(data.widgetName, commonWidgetText.button1); deleteInnerWidget(data.widgetName, commonWidgetText.image1); - dropWidgetToListview("Text", 50, 50, data.widgetName); + dropWidgetToListview("Text", 100, 50, data.widgetName); dropWidgetToListview("Text Input", 250, 50, data.widgetName); addDataToListViewInputs( @@ -85,6 +85,7 @@ describe("List view widget", () => { cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.reload(); + cy.waitForAppLoad(); cy.wait(2500); cy.get( @@ -92,7 +93,9 @@ describe("List view widget", () => { ) .realHover() .realClick(); - verifyAndModifyParameter("Text", codeMirrorInputLabel("listItem.name")); + cy.get( + '[data-cy="textcomponenttextinput-input-field"] ' + ).clearAndTypeOnCodeMirror(codeMirrorInputLabel("listItem.name")); cy.forceClickOnCanvas(); cy.get( `${commonWidgetSelector.draggableWidget( @@ -114,7 +117,8 @@ describe("List view widget", () => { data.widgetName, commonWidgetText.textinput1, "value", - data.marks + data.marks, + true ); verifyMultipleComponentValuesFromInspector( @@ -131,12 +135,14 @@ describe("List view widget", () => { cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.reload(); + cy.waitForAppLoad(); cy.wait(2500); cy.get(`${commonWidgetSelector.draggableWidget(data.widgetName)}:eq(0)`) .realHover() .click("topRight", { force: true }); + openEditorSidebar(data.widgetName); verifyAndModifyParameter( listviewText.showBottomBorder, codeMirrorInputLabel("false") @@ -163,7 +169,9 @@ describe("List view widget", () => { `components.${data.widgetName}.selectedRow.${commonWidgetText.textinput1}.value` ) ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.get(`[data-cy=${data.widgetName.toLowerCase()}-row-1]`).click(); @@ -230,12 +238,11 @@ describe("List view widget", () => { ).should("have.attr", "data-disabled", "true"); cy.get("[data-cy='disable-toggle-button']").click(); - cy.get("[data-cy='border-radius-fx-button']:eq(0)").click(); - verifyAndModifyParameter( - commonWidgetText.parameterBorderRadius, - commonWidgetText.borderRadiusInput - ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + // cy.get("[data-cy='border-radius-fx-button']:eq(0)").click(); + cy.clearAndType('[data-cy="border-radius-input-field"]:eq(0)', "20"); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get( commonWidgetSelector.draggableWidget(listviewText.defaultWidgetName) ).should("have.css", "border-radius", "20px"); @@ -247,10 +254,11 @@ describe("List view widget", () => { verifyAndModifyToggleFx( commonWidgetText.parameterBoxShadow, "0px 0px 0px 0px #00000040", + false, false ); - cy.get('[data-cy="border-radius-fx-button"] > svg').click(); + // cy.get('[data-cy="border-radius-fx-button"] > svg').click(); cy.get(commonWidgetSelector.boxShadowColorPicker).click(); fillBoxShadowParams( @@ -299,13 +307,16 @@ describe("List view widget", () => { cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.reload(); + cy.waitForAppLoad(); cy.wait(3500); cy.get( `${commonWidgetSelector.draggableWidget(commonWidgetText.text1)}:eq(0)` ).click(); - verifyAndModifyParameter("Text", codeMirrorInputLabel("listItem.name")); + cy.get( + '[data-cy="textcomponenttextinput-input-field"] ' + ).clearAndTypeOnCodeMirror(codeMirrorInputLabel("listItem.name")); cy.forceClickOnCanvas(); cy.get( `${commonWidgetSelector.draggableWidget( @@ -326,12 +337,14 @@ describe("List view widget", () => { cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.reload(); + cy.waitForAppLoad(); cy.wait(2500); cy.get( `${commonWidgetSelector.draggableWidget(data.widgetName)}:eq(0)` ).click(); + openEditorSidebar(data.widgetName); verifyAndModifyParameter( "Show bottom border", codeMirrorInputLabel("false") @@ -349,7 +362,8 @@ describe("List view widget", () => { cy.forceClickOnCanvas(); cy.waitForAutoSave(); cy.reload(); - cy.wait(2500); + cy.waitForAppLoad(); + cy.wait(3500); openEditorSidebar(data.widgetName); openAccordion(commonWidgetText.accordionGenaral); @@ -375,13 +389,12 @@ describe("List view widget", () => { ) ).click(); - cy.get("[data-cy='border-radius-fx-button']:eq(0)").click(); - verifyAndModifyParameter( - commonWidgetText.parameterBorderRadius, - commonWidgetText.borderRadiusInput - ); + // cy.get("[data-cy='border-radius-fx-button']:eq(0)").click(); + cy.clearAndType('[data-cy="border-radius-input-field"]:eq(0)', "20"); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get( commonWidgetSelector.draggableWidget(listviewText.defaultWidgetName) ).should("have.css", "border-radius", "20px"); @@ -393,6 +406,7 @@ describe("List view widget", () => { verifyAndModifyToggleFx( commonWidgetText.parameterBoxShadow, "0px 0px 0px 0px #00000040", + false, false ); diff --git a/cypress-tests/cypress/e2e/editor/widget/modalHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/modalHappyPath.cy.js index 47d0af1451..fdcfe8df6d 100644 --- a/cypress-tests/cypress/e2e/editor/widget/modalHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/modalHappyPath.cy.js @@ -41,7 +41,7 @@ import { describe("Modal", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(); + cy.apiCreateApp(`${fake.companyName}-Modal-App`); cy.openApp(); cy.dragAndDropWidget("Modal"); }); @@ -67,11 +67,11 @@ describe("Modal", () => { cy.get('[data-cy="modal-close-button"]').click(); cy.notVisible('[data-cy="modal-title"]'); - openEditorSidebar("modal1", ["Options", "Properties", "Layout"]); + openEditorSidebar("modal1", ["Options", "Properties", "Devices"]); editAndVerifyWidgetName(data.widgetName, [ "Options", "Properties", - "Layout", + "Devices", ]); verifyComponentFromInspector(data.widgetName); @@ -227,9 +227,9 @@ describe("Modal", () => { commonWidgetText.codeMirrorLabelTrue ); cy.get('[data-cy="modal-close-button"]').click(); - cy.get(commonWidgetSelector.draggableWidget("modal1")).should( - "not.be.visible" - ); + cy.get(commonWidgetSelector.draggableWidget("modal1")) + .find("button") + .should("not.be.visible"); cy.get(commonWidgetSelector.parameterTogglebutton("Visibility")).click(); verifyAndModifyToggleFx( diff --git a/cypress-tests/cypress/e2e/editor/widget/multiselectHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/multiselectHappyPath.cy.js index 4b65c48648..369adec510 100644 --- a/cypress-tests/cypress/e2e/editor/widget/multiselectHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/multiselectHappyPath.cy.js @@ -41,7 +41,7 @@ import { describe("Multiselect widget", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(); + cy.apiCreateApp(`${fake.companyName}-Multiselect-App`); cy.openApp(); cy.dragAndDropWidget(multiselectText.multiselect); }); @@ -66,7 +66,9 @@ describe("Multiselect widget", () => { "General", ]); verifyAndModifyParameter(commonWidgetText.parameterLabel, data.label); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get(multiselectSelector.multiselectLabel(data.widgetName)).should( "have.text", data.label @@ -77,7 +79,9 @@ describe("Multiselect widget", () => { commonWidgetText.labelDefaultValue, codeMirrorInputLabel("[1,2,3]") ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); verifyMultiselectHeader( data.widgetName, multiselectText.labelAllItemsSelected @@ -147,7 +151,9 @@ describe("Multiselect widget", () => { multiselectText.noEventsMessage ); addDefaultEventHandler(data.alertMessage); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); selectFromMultiSelect(data.widgetName, ["", "", "true"]); cy.verifyToastMessage(commonSelectors.toastMessage, data.alertMessage); @@ -214,7 +220,9 @@ describe("Multiselect widget", () => { commonWidgetText.parameterBorderRadius, commonWidgetText.borderRadiusInput ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get( commonWidgetSelector.draggableWidget(multiselectText.defaultWidgetName) ) @@ -363,7 +371,7 @@ describe("Multiselect widget", () => { ); }); - it.only("should verify CSA", () => { + it("should verify CSA", () => { cy.get('[data-cy="real-canvas"]').click("topRight", { force: true }); cy.dragAndDropWidget("Number input", 600, 50); selectEvent("On change", "Control Component"); diff --git a/cypress-tests/cypress/e2e/editor/widget/numberInputHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/numberInputHappyPath.cy.js index 8ccf6ca3d4..ed8db74686 100644 --- a/cypress-tests/cypress/e2e/editor/widget/numberInputHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/numberInputHappyPath.cy.js @@ -44,7 +44,7 @@ describe("Number Input", () => { cy.apiDeleteApp(); }); - itß("should verify the properties of the number input widget", () => { + it("should verify the properties of the number input widget", () => { const data = {}; data.widgetName = fake.widgetName; data.tooltipText = fake.randomSentence; @@ -239,10 +239,7 @@ describe("Number Input", () => { cy.clearAndType(commonWidgetSelector.draggableWidget(data.widgetName), "1"); cy.get( commonWidgetSelector.validationFeedbackMessage(data.widgetName) - ).verifyVisibleElement( - "have.text", - `Minimum value is ${data.minimumLength}` - ); + ).verifyVisibleElement("have.text", `Minimum value is 2`); cy.clearAndType( commonWidgetSelector.draggableWidget(data.widgetName), "13" @@ -315,7 +312,7 @@ describe("Number Input", () => { cy.get('[data-cy="togglr-button-left"]').click(); verifyAlignment(numberInputText.defaultWidgetName, "sideLeft"); addCustomWidthOfLabel("50"); - verifyCustomWidthOfLabel(numberInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(numberInputText.defaultWidgetName, "35"); selectColourFromColourPicker( "Text", data.labelColor, @@ -331,15 +328,15 @@ describe("Number Input", () => { ); cy.openInCurrentTab(commonWidgetSelector.previewButton); + cy.wait(3500); verifyWidgetColorCss( `[data-cy="label-${numberInputText.defaultWidgetName}"]>label`, "color", data.labelColor, true ); - verifyAlignment(numberInputText.defaultWidgetName, "sideLeft"); - verifyCustomWidthOfLabel(numberInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(numberInputText.defaultWidgetName, "35"); verifyInputFieldColors("numberinput1", data); verifyBoxShadowCss( @@ -364,6 +361,7 @@ describe("Number Input", () => { verifyCSA(data); cy.openInCurrentTab(commonWidgetSelector.previewButton); + cy.wait(3500); verifyCSA(data); }); }); diff --git a/cypress-tests/cypress/e2e/editor/widget/passwordInputHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/passwordInputHappyPath.cy.js index b1848c2f28..e0a5bd44ee 100644 --- a/cypress-tests/cypress/e2e/editor/widget/passwordInputHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/passwordInputHappyPath.cy.js @@ -311,7 +311,7 @@ describe("Password Input", () => { cy.get('[data-cy="togglr-button-left"]').click(); verifyAlignment(passwordInputText.defaultWidgetName, "sideLeft"); addCustomWidthOfLabel("50"); - verifyCustomWidthOfLabel(passwordInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(passwordInputText.defaultWidgetName, "35"); selectColourFromColourPicker( "Text", data.labelColor, @@ -335,7 +335,7 @@ describe("Password Input", () => { ); verifyAlignment(passwordInputText.defaultWidgetName, "sideLeft"); - verifyCustomWidthOfLabel(passwordInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(passwordInputText.defaultWidgetName, "35"); verifyInputFieldColors("passwordinput1", data); verifyBoxShadowCss( diff --git a/cypress-tests/cypress/e2e/editor/widget/tableRegression.cy.js b/cypress-tests/cypress/e2e/editor/widget/tableRegression.cy.js index 4dfcc8dbee..ca9d4321e4 100644 --- a/cypress-tests/cypress/e2e/editor/widget/tableRegression.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/tableRegression.cy.js @@ -57,7 +57,7 @@ import { waitForQueryAction } from "Support/utils/queries"; describe("Table", () => { beforeEach(() => { cy.apiLogin(); - cy.apiCreateApp(`${fake.companyName}-App`); + cy.apiCreateApp(`${fake.companyName}-table-App`); cy.openApp(); deleteDownloadsFolder(); cy.viewport(1400, 2200); @@ -372,6 +372,7 @@ describe("Table", () => { deleteAndVerifyColumn("id"); deleteAndVerifyColumn("name"); deleteAndVerifyColumn("email"); + deleteAndVerifyColumn("fake-link"); cy.wait(500); addAndOpenColumnOption("Fake-String", `string`); selectDropdownOption('[data-cy="input-overflow"] >>:eq(0)', `wrap`); @@ -388,10 +389,13 @@ describe("Table", () => { .eq(0) .should("have.css", "background-color", "rgb(255, 255, 0)", { timeout: 10000, - }) + }); + cy.get(tableSelector.column(0)) + .eq(0) + .find(".align-items-center") .last() - .should("have.css", "color", "rgb(62, 82, 91)") - .and("have.text", "Sarah"); + .should("have.text", "Sarah") + .and("have.css", "color", "rgb(255, 0, 0)"); cy.get('[data-cy="make-editable-toggle-button"]').click(); cy.get('[data-cy="header-validation"]').verifyVisibleElement( @@ -678,7 +682,9 @@ describe("Table", () => { commonWidgetText.borderRadiusInput ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); openEditorSidebar(tableText.defaultWidgetName); openAccordion("Columns"); deleteAndVerifyColumn("email"); @@ -698,7 +704,9 @@ describe("Table", () => { "Border radius", commonWidgetText.borderRadiusInput ); - cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click(); + cy.get(commonWidgetSelector.buttonCloseEditorSideBar).click({ + force: true, + }); cy.get( commonWidgetSelector.draggableWidget(tableText.defaultWidgetName) @@ -712,7 +720,8 @@ describe("Table", () => { commonWidgetText.parameterBoxShadow, commonWidgetText.boxShadowDefaultValue, false, - "0px 0px 0px 0px " + "0px 0px 0px 0px ", + false ); cy.get(commonWidgetSelector.boxShadowColorPicker).click(); @@ -737,6 +746,7 @@ describe("Table", () => { "have.text", "Table type" ); + cy.get('[data-cy="dropdown-table-type"]').realHover(); cy.get('[data-cy="table-type-fx-button"] > svg').click(); cy.get('[data-cy="table-type-input-field"]').clearAndTypeOnCodeMirror( `randomText` @@ -1095,7 +1105,7 @@ describe("Table", () => { cy.get(".tooltip-inner").invoke("hide"); verifyNodeData("components", "Object", "9 entries "); openNode("components"); - verifyNodeData(tableText.defaultWidgetName, "Object", "23 entries "); + verifyNodeData(tableText.defaultWidgetName, "Object", "27 entries "); openNode(tableText.defaultWidgetName); verifyNodeData("newRows", "Array", "0 item "); @@ -1232,7 +1242,10 @@ describe("Table", () => { cy.get('[data-cy="inspector-close-icon"]').click(); cy.dragAndDropWidget("Text", 800, 200); openEditorSidebar(commonWidgetText.text1); - verifyAndModifyParameter("Text", "Column Email"); + cy.get( + '[data-cy="textcomponenttextinput-input-field"]' + ).clearAndTypeOnCodeMirror("Column Email"); + // verifyAndModifyParameter("Text", "Column Email"); cy.get('[data-cy="inspector-close-icon"]').click(); cy.get(`[data-cy="draggable-widget-${commonWidgetText.text1}"]`).should( "have.text", diff --git a/cypress-tests/cypress/e2e/editor/widget/textHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/textHappyPath.cy.js index 99f98e76c8..1e46dc6494 100644 --- a/cypress-tests/cypress/e2e/editor/widget/textHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/textHappyPath.cy.js @@ -19,14 +19,14 @@ import { selectCSA, selectEvent, } from "Support/utils/events"; -import { randomString } from "Support/utils/textInput"; +import { randomString } from "Support/utils/editor/textInput"; import { buttonText } from "Texts/button"; describe("Text Input", () => { const data = {}; beforeEach(() => { cy.viewport(1200, 1200); - data.appName = `${fake.companyName}-text-App1`; + data.appName = `${fake.companyName}-text-App`; cy.apiLogin(); cy.apiCreateApp(data.appName); cy.openApp(); @@ -56,7 +56,7 @@ describe("Text Input", () => { ).verifyVisibleElement("have.text", "Cypress testing text component"); }); - it.only("should verify styles of text component", () => { + it("should verify styles of text component", () => { cy.get(commonWidgetSelector.buttonStylesEditorSideBar).click(); selectFromSidebarDropdown("Weight", "bolder"); selectFromSidebarDropdown("Font variant", "initial"); @@ -90,7 +90,7 @@ describe("Text Input", () => { it("should verify preview of text component", () => {}); - it("should verify CSA", () => { + it.only("should verify CSA", () => { const data = {}; data.customText = randomString(12); @@ -120,13 +120,13 @@ describe("Text Input", () => { "not.be.visible" ); }); - it("should verify expossed values", () => { + it.only("should verify expossed values", () => { cy.get(commonWidgetSelector.sidebarinspector).click(); verifyNodeData("components", "Object", "1 entry "); openNode("components"); openNode("text1"); - verifyValue("text", "String", `"Hello World👋"`); + verifyValue("text", "String", `"Hello The👋"`); verifyValue("isVisible", "Boolean", "true"); verifyValue("isLoading", "Boolean", "false"); verifyValue("isDisabled", "Boolean", "false"); @@ -134,8 +134,8 @@ describe("Text Input", () => { verifyfunctions("clear", "Function"); verifyfunctions("setText", "Function"); verifyfunctions("visibility", "Function"); - verifyfunctions("setDisabled", "Function"); + verifyfunctions("setDisable", "Function"); verifyfunctions("setVisibility", "Function"); - verifyfunctions("setLoadingState", "Function"); + verifyfunctions("setLoading", "Function"); }); }); diff --git a/cypress-tests/cypress/e2e/editor/widget/textInputHappyPath.cy.js b/cypress-tests/cypress/e2e/editor/widget/textInputHappyPath.cy.js index 781d6af318..ffba1b68d6 100644 --- a/cypress-tests/cypress/e2e/editor/widget/textInputHappyPath.cy.js +++ b/cypress-tests/cypress/e2e/editor/widget/textInputHappyPath.cy.js @@ -111,7 +111,9 @@ describe("Text Input", () => { openEditorSidebar(data.widgetName); openAccordion(commonWidgetText.accordionEvents, ["Validation", "Devices"]); addDefaultEventHandler(data.customText); + cy.wait(1000); cy.get(commonWidgetSelector.eventSelection).type("On Enter Pressed{Enter}"); + cy.wait("@events"); cy.clearAndType( commonWidgetSelector.draggableWidget(data.widgetName), @@ -268,7 +270,7 @@ describe("Text Input", () => { data.errorTextColor = fake.randomRgba; data.iconColor = fake.randomRgba; data.labelColor = fake.randomRgba; - ata.widgetName = textInputText.defaultWidgetName; + data.widgetName = textInputText.defaultWidgetName; openEditorSidebar(textInputText.defaultWidgetName); cy.get(commonWidgetSelector.buttonStylesEditorSideBar).click(); @@ -311,7 +313,7 @@ describe("Text Input", () => { cy.get('[data-cy="togglr-button-left"]').click(); verifyAlignment(textInputText.defaultWidgetName, "sideLeft"); addCustomWidthOfLabel("50"); - verifyCustomWidthOfLabel(textInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(textInputText.defaultWidgetName, "35"); selectColourFromColourPicker( "Text", data.labelColor, @@ -335,7 +337,7 @@ describe("Text Input", () => { ); verifyAlignment(textInputText.defaultWidgetName, "sideLeft"); - verifyCustomWidthOfLabel(textInputText.defaultWidgetName, "50"); + verifyCustomWidthOfLabel(textInputText.defaultWidgetName, "35"); verifyInputFieldColors("textinput1", data); verifyBoxShadowCss( diff --git a/cypress-tests/cypress/e2e/exportImport/export.cy.js b/cypress-tests/cypress/e2e/exportImport/export.cy.js index 697af980e3..62df170e82 100644 --- a/cypress-tests/cypress/e2e/exportImport/export.cy.js +++ b/cypress-tests/cypress/e2e/exportImport/export.cy.js @@ -25,11 +25,12 @@ describe("App Export Functionality", () => { let currentVersion = ""; let otherVersions = []; beforeEach(() => { - cy.appUILogin(); + cy.apiLogin(); }); it("Verify the elements of export dialog box", () => { - cy.createApp(data.appName1); + cy.apiCreateApp(data.appName1); + cy.openApp(); cy.dragAndDropWidget(buttonText.defaultWidgetText); cy.get(appVersionSelectors.appVersionLabel).should("be.visible"); cy.renameApp(data.appName1); @@ -55,6 +56,7 @@ describe("App Export Functionality", () => { }); it("Verify 'Export app' functionality of an application", () => { + cy.visit("/"); cy.get(commonSelectors.appHeaderLable).should("be.visible"); selectAppCardOption( diff --git a/cypress-tests/cypress/e2e/exportImport/import.cy.js b/cypress-tests/cypress/e2e/exportImport/import.cy.js index 37efdc6b00..a0c07714a4 100644 --- a/cypress-tests/cypress/e2e/exportImport/import.cy.js +++ b/cypress-tests/cypress/e2e/exportImport/import.cy.js @@ -28,7 +28,7 @@ describe("App Import Functionality", () => { let exportedFilePath; beforeEach(() => { - cy.appUILogin(); + cy.apiLogin(); }); before(() => { cy.fixture("templates/test-app.json").then((app) => { @@ -39,6 +39,7 @@ describe("App Import Functionality", () => { }); }); it("Verify the Import functionality of an Application", () => { + cy.visit("/"); cy.get("body").then(($title) => { if ($title.text().includes(commonText.welcomeTooljetWorkspace)) { cy.get(dashboardSelector.importAppButton).click(); @@ -73,6 +74,7 @@ describe("App Import Functionality", () => { .and("have.text", importText.appImportedToastMessage); cy.get(".driver-close-btn").click(); + cy.wait(500); cy.get(commonSelectors.appNameInput).verifyVisibleElement( "contain.value", appData.name.toLowerCase() diff --git a/cypress-tests/cypress/support/utils/button.js b/cypress-tests/cypress/support/utils/button.js index 449c3e6042..9f44e44a3f 100644 --- a/cypress-tests/cypress/support/utils/button.js +++ b/cypress-tests/cypress/support/utils/button.js @@ -105,10 +105,8 @@ export const verifyBasicData = (widgetName, data) => { cy.get(commonWidgetSelector.draggableWidget(widgetName)).click({ force: true, }); - cy.wait(500); - cy.verifyToastMessage(commonSelectors.toastMessage, data.alertMessage); - cy.get(commonWidgetSelector.draggableWidget("textinput1")).should( + cy.get(`[data-cy='input-textinput1']`).should( "have.value", data.customMessage ); diff --git a/cypress-tests/cypress/support/utils/commonWidget.js b/cypress-tests/cypress/support/utils/commonWidget.js index 8eb5f9a258..830b4e2c65 100644 --- a/cypress-tests/cypress/support/utils/commonWidget.js +++ b/cypress-tests/cypress/support/utils/commonWidget.js @@ -40,13 +40,16 @@ export const openEditorSidebar = (widgetName = "") => { export const verifyAndModifyToggleFx = ( paramName, defaultValue, - toggleModification = true + toggleModification = true, + hiddenFx = true ) => { cy.get(commonWidgetSelector.parameterLabel(paramName)).should( "have.text", paramName ); - cy.get(commonWidgetSelector.parameterTogglebutton(paramName)).realHover(); + if (hiddenFx) { + cy.get(commonWidgetSelector.parameterTogglebutton(paramName)).realHover(); + } cy.get(commonWidgetSelector.parameterFxButton(paramName, " > svg")).click(); if (defaultValue) cy.get(commonWidgetSelector.parameterInputField(paramName)) @@ -61,11 +64,14 @@ export const addDefaultEventHandler = (message) => { cy.get(commonWidgetSelector.addEventHandlerLink) .should("contain.text", commonWidgetText.addEventHandlerLink) .click(); + cy.intercept("PUT", "events").as("events"); cy.get(commonWidgetSelector.eventHandlerCard).click(); + cy.wait(1000); cy.get(commonWidgetSelector.alertMessageInputField) .find('[data-cy*="-input-field"]') .eq(0) .clearAndTypeOnCodeMirror(message); + cy.get('[data-cy="run-only-if-input-field"]').click({ force: true }); }; export const addAndVerifyTooltip = (widgetSelector, message) => { @@ -94,6 +100,7 @@ export const verifyComponentValueFromInspector = ( value, openStatus = "closed" ) => { + cy.wait(3000); cy.get(commonWidgetSelector.sidebarinspector).click(); if (openStatus == "closed") { cy.get(commonWidgetSelector.inspectorNodeComponents).click(); @@ -359,7 +366,9 @@ export const addTextWidgetToVerifyValue = (customfunction) => { cy.forceClickOnCanvas(); cy.dragAndDropWidget("Text", 600, 80); openEditorSidebar("text1"); - verifyAndModifyParameter("Text", codeMirrorInputLabel(customfunction)); + cy.get( + '[data-cy="textcomponenttextinput-input-field"] ' + ).clearAndTypeOnCodeMirror(codeMirrorInputLabel(customfunction)); cy.forceClickOnCanvas(); cy.waitForAutoSave(); }; diff --git a/cypress-tests/cypress/support/utils/editor/passwordNumberInput.js b/cypress-tests/cypress/support/utils/editor/passwordNumberInput.js index 77ce9e6c47..0e19f58f93 100644 --- a/cypress-tests/cypress/support/utils/editor/passwordNumberInput.js +++ b/cypress-tests/cypress/support/utils/editor/passwordNumberInput.js @@ -41,10 +41,13 @@ export const randomString = (length) => { }; export const verifyCSA = (data) => { - cy.clearAndType( - commonWidgetSelector.draggableWidget("textinput1"), - data.customText - ); + cy.get(commonWidgetSelector.draggableWidget("textinput1")).click({ + force: true, + }); + cy.get(commonWidgetSelector.draggableWidget("textinput1")) + .find("input") + .clear() + .type(data.customText); cy.get( commonWidgetSelector.draggableWidget(data.widgetName) ).verifyVisibleElement("have.value", data.customText); diff --git a/cypress-tests/cypress/support/utils/events.js b/cypress-tests/cypress/support/utils/events.js index f9200993aa..5441d82bde 100644 --- a/cypress-tests/cypress/support/utils/events.js +++ b/cypress-tests/cypress/support/utils/events.js @@ -35,7 +35,6 @@ export const selectCSA = ( .type(`{selectAll}{backspace}${componentAction}{enter}`); cy.wait("@events"); cy.get('[data-cy="debounce-input-field"]') - .eq(1) .click() .type(`{selectAll}{backspace}${debounce}{enter}`); cy.wait("@events"); diff --git a/cypress-tests/cypress/support/utils/listviewWidget.js b/cypress-tests/cypress/support/utils/listviewWidget.js index 925db7186a..3d00e1eb54 100644 --- a/cypress-tests/cypress/support/utils/listviewWidget.js +++ b/cypress-tests/cypress/support/utils/listviewWidget.js @@ -84,11 +84,21 @@ export const addDataToListViewInputs = (listviewName, childName, data) => { }); }; -export const verifyValuesOnList = (listviewName, childName, type, value) => { +export const verifyValuesOnList = ( + listviewName, + childName, + type, + value, + isChild = false +) => { cy.get(commonWidgetSelector.draggableWidget(listviewName)).within(() => { cy.get(commonWidgetSelector.draggableWidget(childName)).each( ($element, i) => { - cy.wrap($element).should(`have.${type}`, value[i]); + if (isChild) { + cy.wrap($element).find("input").should(`have.${type}`, value[i]); + } else { + cy.wrap($element).should(`have.${type}`, value[i]); + } } ); }); diff --git a/cypress-tests/cypress/support/utils/modal.js b/cypress-tests/cypress/support/utils/modal.js index cf1a368d84..b11c9f816a 100644 --- a/cypress-tests/cypress/support/utils/modal.js +++ b/cypress-tests/cypress/support/utils/modal.js @@ -52,6 +52,7 @@ export const addAndVerifyColor = ( }; export const typeOnFx = (fx, data) => { + cy.get(commonWidgetSelector.parameterTogglebutton(fx)).realHover(); cy.get(commonWidgetSelector.parameterFxButton(fx)).eq(0).realClick(); cy.get(commonWidgetSelector.parameterInputField(fx)).clearAndTypeOnCodeMirror( data diff --git a/cypress-tests/cypress/support/utils/table.js b/cypress-tests/cypress/support/utils/table.js index 44f55467a3..ca97625214 100644 --- a/cypress-tests/cypress/support/utils/table.js +++ b/cypress-tests/cypress/support/utils/table.js @@ -136,12 +136,16 @@ export const verifyAndModifyToggleFx = ( paramName, defaultValue, toggleModification = true, - helper = "" + helper = "", + hiddenFx = true ) => { cy.get(`[data-cy="label-${cyParamName(paramName)}"]`).should( "have.text", paramName ); + if (hiddenFx) { + cy.get(commonWidgetSelector.parameterTogglebutton(paramName)).realHover(); + } cy.get(commonWidgetSelector.parameterFxButton(paramName, "> svg")) .scrollIntoView() .click(); diff --git a/docs/docs/Enterprise/audit_logs.md b/docs/docs/Enterprise/audit_logs.md index 5681e15ae9..061bb49d38 100644 --- a/docs/docs/Enterprise/audit_logs.md +++ b/docs/docs/Enterprise/audit_logs.md @@ -96,6 +96,8 @@ The dropdown will display all the apps associated with your account. Select an a The file will contain all the data from audit logs. The log file can be created by specifying the path in the [environment variables](/docs/setup/env-vars). The log file is rotated on a daily basis and is updated dynamically every time a new audit log is generated. +Learn more about **setting up the log file generation** [here](/docs/how-to/setup-rsyslog). + #### Log Rotation The log file is configured to rotate on a daily basis. This means that a new log file will be created every day, ensuring efficient management and organization of audit data. diff --git a/docs/docs/Enterprise/white-label.md b/docs/docs/Enterprise/white-label.md index 3199b55b72..9f1d7b95ad 100644 --- a/docs/docs/Enterprise/white-label.md +++ b/docs/docs/Enterprise/white-label.md @@ -11,27 +11,21 @@ With this feature, you gain the ability to rebrand the following key elements: - **Application Logo**: This includes the logo displayed on the login screen, dashboard, and app-editor. -
- -ToolJet - Enterprise - White label - -
+
+ ToolJet - Enterprise - White label +
- **Favicon**: The small icon associated with your application. -
- -ToolJet - Enterprise - White label - -
+
+ ToolJet - Enterprise - White label +
- **Page Title**: This is the text displayed next to the Favicon. -
- -ToolJet - Enterprise - White label - -
+
+ ToolJet - Enterprise - White label +
## Configuration @@ -42,7 +36,22 @@ To enable white labelling, you'll need to go to the **Settings** from the Dashbo - **Page Title**: Enter the text you want to display as your application's title. Preferred title length are 50-60 characters.
+ ToolJet - Enterprise - White label +
-ToolJet - Enterprise - White label +
+ +## ToolJet Cloud + +If you are using ToolJet Cloud, you can enable white labelling by going to the **Settings** from the Dashboard and clicking on the `White labelling` tab. On the White labelling page, you'll be able to configure the following: + +- **Application Logo**: Add the URL of the image you want to use as your application logo. Preferred dimensions of the logo are: width `130px` and height `26px`. +- **Page Title**: Enter the text you want to display as your application's title. Preferred title length are 50-60 characters. +- **Favicon**: Enter the URL of the image you want to use as your application's favicon. Preferred dimensions of the favicon are: width `32px` and height `32px` or `16px` and height `16px`. + +
+ Whitelabel Cloud +
+ +
- \ No newline at end of file diff --git a/docs/docs/app-builder/import-export-apps.md b/docs/docs/app-builder/import-export-apps.md new file mode 100644 index 0000000000..adc4eb923e --- /dev/null +++ b/docs/docs/app-builder/import-export-apps.md @@ -0,0 +1,46 @@ +--- +id: importing-exporting-applications +title: Importing and Exporting Applications +--- + +This documentation explains the process of exporting and importing applications in ToolJet. + +
+ +## 1. Exporting Applications + +- Navigate to the dashboard. +- Click on the settings icon located in the top right corner of the application. +- Click on the **Export app** button. + +
+ Export App Button +
+ +- If you select `Export All`, all the versions of the application will be exported in JSON format. If you select `Export selected version`, only the selected version will be exported in JSON format. +- Ticking the `Export ToolJet table schema` checkbox will also export the related ToolJet Database table schemas with your application. In this case, when you import the application in a workspace, the related ToolJet Database tables will also be created. + +
+ Export App Options +
+ +
+ +
+ +## 2. Importing Applications + +- Navigate to the dashboard. +- Click on the ellipses on the **Create new app** button and select `Import`. + +
+ Import App Button +
+ +- After clicking on `Import`, choose the relevant JSON file that you previously downloaded during the application export process. + +
+ Select App To Import +
+ +
\ No newline at end of file diff --git a/docs/docs/contributing-guide/marketplace/marketplace-setup.md b/docs/docs/contributing-guide/marketplace/marketplace-setup.md index 4585f13e01..a8f592845c 100644 --- a/docs/docs/contributing-guide/marketplace/marketplace-setup.md +++ b/docs/docs/contributing-guide/marketplace/marketplace-setup.md @@ -48,7 +48,7 @@ The use of this environment variable facilitates plugin development by enabling Please note that the marketplace is not enabled by default. After updating the variable, restart your ToolJet instance. -For information on running ToolJet on your local machine, please refer to the instructions provided **[here](/docs/category/contributing-guide)**. You can access the marketplace by navigating to the **'/integrations'** route. +For information on running ToolJet on your local machine, please refer to the instructions provided **[here](/docs/contributing-guide/setup/architecture)**. You can access the marketplace by navigating to the **'/integrations'** route. ### Step 3: Installation of tooljet-cli diff --git a/docs/docs/contributing-guide/setup/macos.md b/docs/docs/contributing-guide/setup/macos.md index fa45e3b5e1..a42a7ccbf9 100644 --- a/docs/docs/contributing-guide/setup/macos.md +++ b/docs/docs/contributing-guide/setup/macos.md @@ -17,14 +17,14 @@ Follow these steps to setup and run ToolJet on macOS for development purposes. O ```bash /bin/bash -c "(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` - 1.2 Install Node.js ( version: v18.18.2 ) and npm (version: v9.8.2) + 1.2 Install Node.js ( version: v18.18.2 ) and npm (version: v9.8.1) ```bash brew install nvm export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh nvm install 18.18.2 nvm use 18.18.2 - npm install -g npm@9.8.2 + npm install -g npm@9.8.1 ``` 1.3 Install Postgres diff --git a/docs/docs/data-sources/airtable.md b/docs/docs/data-sources/airtable.md index ec9b54b6d2..bd18a51bf9 100644 --- a/docs/docs/data-sources/airtable.md +++ b/docs/docs/data-sources/airtable.md @@ -5,9 +5,13 @@ title: Airtable # Airtable -ToolJet can connect to your Airtable account to read and write data.Airtable Personal Access Token is required to connect to the Airtable data source on ToolJet. You can generate the PAT by visiting [Developer Hub from your Airtable profile](https://support.airtable.com/docs/creating-and-using-api-keys-and-access-tokens#understanding-personal-access-token-basic-actions). +ToolJet can connect to your Airtable account to read and write data. **Personal Access Token** is required to connect to the Airtable data source on ToolJet. You can generate the Personal Access Token by visiting [Developer Hub from your Airtable profile](https://support.airtable.com/docs/creating-and-using-api-keys-and-access-tokens#understanding-personal-access-token-basic-actions). -irtable record +
+ Airtable Data Source Connection +
+ +
:::info Airtable API has a rate limit, and at the time of writing this documentation, the limit is five(5) requests per second per base. You can read more about rate limits here **[Airtable API](https://airtable.com/api)**. @@ -15,27 +19,27 @@ Airtable API has a rate limit, and at the time of writing this documentation, th ## Supported Operations -- **[Listing records](#listing-records)** -- **[Retrieving a record](#retrieving-a-record)** -- **[Creating a record](#creating-a-record)** -- **[Updating a record](#updating-a-record)** -- **[Deleting a record](#deleting-a-record)** +- **[List records](#list-records)** +- **[Retrieve record](#retrieve-record)** +- **[Create record](#create-record)** +- **[Update record](#update-record)** +- **[Delete record](#delete-record)** -### Listing records +### List records -This query lists all the records in a table. The results are paginated and each page can have up to 100 records. +This operation returns a list of records from the specified table. #### Required parameters: -- **Base ID:** To find the Base ID, first visit **airtable.com/api**. Select from the list of bases the base whose ID you'd like to find out. Example Base ID: `appDT3UCPffPiSmFd` -- **Table name:** Enter the table name whose data you want to fetch. +- **Base ID:** To find the Base ID, first visit **airtable.com/api**. Then select the base you want to connect to. The Base ID will be mentioned in the API documentation. Example Base ID: `appDT3UCPffPiSmFd` + +- **Table name:** The name of the table from which you want to fetch the records. #### Optional parameters: -- **Page size:** The number of records returned in each request. Must be less than or equal to 100. Default is 100. -- **offset:** If there are more records, the response will contain an offset. To fetch the next page of records, include offset in the next request's parameters. +- **Page size:** The number of records returned in each request. Default is 100 records. -List airtable record +- **offset:** The offset value is used to fetch the next set of records. The offset value is returned in the response of the previous request. Example response from Airtable: @@ -71,15 +75,16 @@ Example response from Airtable: } ``` -### Retrieving a record +### Retrieve record #### Required parameters: -- **Base ID** -- **Table name** -- **Record ID** +- **Base ID**: To find the Base ID, first visit **airtable.com/api**. Then select the base you want to connect to. The Base ID will be mentioned in the API documentation. Example Base ID: `appDT3UCPffPiSmFd` + +- **Table name**: The name of the table from which you want to fetch the records. + +- **Record ID**: The ID of the record you want to retrieve. -Retrieve airtable record Example response from Airtable: @@ -94,42 +99,36 @@ Example response from Airtable: } ``` -### Creating a record +### Create record #### Required parameters: -- **Base ID** -- **Table name** -- **Records** +- **Base ID**: To find the Base ID, first visit **airtable.com/api**. Then select the base you want to connect to. The Base ID will be mentioned in the API documentation. Example Base ID: `appDT3UCPffPiSmFd` -Create airtable record +- **Table name**: The name of the table from which you want to fetch the records. -#### Example Records: +- **Records**: The records you want to create. The records should be in the form of an array of objects. Each object should have a `fields` key, which contains the fields of the record. The field names should be the same as the field names in the Airtable table. -```json -[ - { - "fields": { - "Notes": "sdfdsf", - "Name": "dsfdsf" + **Example creating two records:** + + ```json title="Records" + [ + { + "fields": { + "Notes": "sdfdsf", + "Name": "dsfdsf" + } + }, + { + "fields": { + "Notes": "note1", + "Name": "dsfdsf" + } } - }, - { - "fields": { - "Notes": "note1", - "Name": "dsfdsf" - } - } -] -``` + ] + ``` -Click on the `run` button to run the query. - -:::info -NOTE: Query must be saved before running. -::: - -Example response from Airtable: +Query returns the following response when the records are created successfully: ```json { @@ -154,31 +153,28 @@ Example response from Airtable: } ``` -### Updating a record +### Update record #### Required parameters: -- **Base ID** -- **Table name** -- **Record ID** +- **Base ID**: To find the Base ID, first visit **airtable.com/api**. Then select the base you want to connect to. The Base ID will be mentioned in the API documentation. Example Base ID: `appDT3UCPffPiSmFd` -Update airtable record +- **Table name**: The name of the table from which you want to fetch the records. -#### Example body: +- **Record ID**: The ID of the record you want to update. -
+- **Body**: The fields you want to update. The fields should be in the form of an object. The field names should be the same as the field names in the Airtable table. -Airtable update body + **Example updating a record:** + + ```json title="Body" + { + "Notes": "Example Notes", + "Name": "change" + } + ``` -
- -Click on the `run` button to run the query. - -:::info -NOTE: Query must be saved before running. -::: - -Example response from Airtable: +Query returns the following response when the record is updated successfully: ```json { @@ -191,7 +187,7 @@ Example response from Airtable: } ``` -### Deleting a record +### Delete record #### Required parameters: @@ -199,15 +195,7 @@ Example response from Airtable: - **Table name** - **Record ID** -Delete airtable record - -Click on the `run` button to run the query. - -:::info -NOTE: Query must be saved before running. -::: - -Example response from Airtable: +Query returns the following response when the record is deleted successfully: ```json { diff --git a/docs/docs/data-sources/smtp.md b/docs/docs/data-sources/smtp.md index 9f09a14ac4..83e5724cca 100644 --- a/docs/docs/data-sources/smtp.md +++ b/docs/docs/data-sources/smtp.md @@ -48,10 +48,10 @@ To create a query for sending an email, follow these steps: - **Body** : You can enter the body text of the email in either raw text or html format, in their respective fields. - **Attachments** : You can add attachments to an SMTP query by referencing the file from the File Picker component in the attachments field. -For instance, you can set the `Attachments` field value to `{{ components.filepicker1.file }}` or pass an array of `{{ name: 'filename.jpg', dataURL: '......' }}` objects to include attachments. +For instance, you can set the `Attachments` field value to `{{ components.filepicker1.file }}` or pass an object `{{ name: 'filename.jpg', dataURL: '......' }}` to include attachments.
smtp connect -
\ No newline at end of file + diff --git a/docs/docs/getting-started/quickstart-guide.md b/docs/docs/getting-started/quickstart-guide.md index 6017863057..a8221cf576 100644 --- a/docs/docs/getting-started/quickstart-guide.md +++ b/docs/docs/getting-started/quickstart-guide.md @@ -79,11 +79,11 @@ Now, create a new table in **[ToolJet’s Database](/docs/tooljet-database/)** t ### 3. Integrate Data To display employees in the application, we first need to fetch data from the database using a query: -- Click on the Add button in the **[Query Panel](/docs/app-builder/query-panel/)**, select ToolJet Database -- Rename the query to `getEmployees` -- Choose `employees` as Table name, List rows as Operations -- Toggle Run this query on application load? to automatically run the query when the app starts -- Click on Run to fetch data +- Click on the Add button in the **[Query Panel](/docs/app-builder/query-panel/)**, select ToolJet Database. +- Rename the query to `getEmployees`. +- Choose `employees` as Table name, List rows as Operations. +- Toggle Run this query on application load? to automatically run the query when the app starts. +- Click on Run to fetch data.