From 9fbf9d3403e5d30fcaf352239a8665c95abc3d62 Mon Sep 17 00:00:00 2001 From: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Date: Tue, 30 Aug 2022 11:02:31 +0100 Subject: [PATCH] fix: TreeWidgets issues --- README.md | 5 +- .../Application/PgAdmin_spec.js | 3 + .../Binding/Widget_loading_spec.js | 1 + ...xplorer_CopyQuery_RenameDatasource_spec.js | 1 + .../Entity_Explorer_Query_Datasource_spec.js | 1 + .../GitDiscardChange/DiscardChanges_spec.js | 3 + .../Theme_MultiSelectWidget_spec.js | 32 +++-- ...eCheck_Spec.ts => AllInputWidgets_spec.ts} | 1 + .../CurrencyInput/CurrencyInput_spec.js | 12 -- .../Widgets/PhoneInput/Phone_input_spec.js | 12 -- .../Widgets/TableV2/TableV2Filter_Spec.ts | 1 - .../Datasources/ArangoDataSourceStub_spec.js | 14 +- .../Datasources/DatasourceForm_spec.js | 6 +- .../Datasources/MongoDatasource_spec.js | 2 + .../Datasources/MsSQLDataSourceStub_spec.js | 3 + .../Datasources/MySQLDataSourceStub_spec.js | 3 + .../Datasources/MySQLNoiseTest_spec.js | 1 + .../ServerSideTests/Datasources/MySQL_spec.js | 2 + .../Datasources/PostgresDatasource_spec.js | 2 + .../RedshiftDataSourceStub_spec.js | 3 + .../Datasources/SMTPDatasource_spec.js | 3 +- .../GenerateCRUD/MySQL_Spec.ts | 2 +- .../GenerateCRUD/Postgres_Spec.ts | 3 +- .../Params/ExecutionParams_spec.js | 1 + .../ServerSideTests/QueryPane/Mongo_Spec.js | 2 +- .../UpgradeAppsmith/UpgradeAppsimth_spec.js | 4 +- .../cypress/support/Pages/AggregateHelper.ts | 13 -- .../cypress/support/Pages/DataSources.ts | 9 +- .../cypress/support/Pages/PropertyPane.ts | 14 +- app/client/cypress/support/Pages/Table.ts | 12 +- .../cypress/support/dataSourceCommands.js | 1 + app/client/package.json | 2 +- .../propertyControls/DropDownControl.tsx | 3 - app/client/src/pages/Applications/index.tsx | 62 ++++---- app/client/src/pages/common/PageWrapper.tsx | 2 +- .../MultiSelectTreeWidget/widget/derived.js | 35 +++++ .../widget/derived.test.ts | 130 +++++++++++++++++ .../MultiSelectTreeWidget/widget/index.tsx | 58 +++----- .../widget/parseDerivedProperties.ts | 36 +++++ .../component/index.tsx | 8 +- .../SingleSelectTreeWidget/widget/derived.js | 49 +++++++ .../widget/derived.test.ts | 132 ++++++++++++++++++ .../SingleSelectTreeWidget/widget/index.tsx | 67 +++------ .../widget/parseDerivedProperties.ts | 35 +++++ app/client/src/widgets/WidgetUtils.ts | 24 ++++ app/client/yarn.lock | 8 +- .../server/helpers/CollectionUtils.java | 27 ---- .../server/migrations/DatabaseChangelog2.java | 9 +- .../migrations/MigrationHelperMethods.java | 25 ---- .../services/ce/WorkspaceServiceCEImpl.java | 3 +- 50 files changed, 614 insertions(+), 273 deletions(-) rename app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/{InputTruncateCheck_Spec.ts => AllInputWidgets_spec.ts} (99%) create mode 100644 app/client/src/widgets/MultiSelectTreeWidget/widget/derived.js create mode 100644 app/client/src/widgets/MultiSelectTreeWidget/widget/derived.test.ts create mode 100644 app/client/src/widgets/MultiSelectTreeWidget/widget/parseDerivedProperties.ts create mode 100644 app/client/src/widgets/SingleSelectTreeWidget/widget/derived.js create mode 100644 app/client/src/widgets/SingleSelectTreeWidget/widget/derived.test.ts create mode 100644 app/client/src/widgets/SingleSelectTreeWidget/widget/parseDerivedProperties.ts diff --git a/README.md b/README.md index 3d9a8395877..9bab9b38835 100644 --- a/README.md +++ b/README.md @@ -188,10 +188,10 @@ Lets build great software together. [![somangshu](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11089579?v=4&w=50&h=50&mask=circle)](https://github.com/somangshu) [![ApekshaBhosale](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7846888?v=4&w=50&h=50&mask=circle)](https://github.com/ApekshaBhosale) [![sidhantgoel](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/3933675?v=4&w=50&h=50&mask=circle)](https://github.com/sidhantgoel) -[![Aishwarya-U-R](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/91450662?v=4&w=50&h=50&mask=circle)](https://github.com/Aishwarya-U-R) [![Irongade](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/37867493?v=4&w=50&h=50&mask=circle)](https://github.com/Irongade) -[![ankitakinger](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/28362912?v=4&w=50&h=50&mask=circle)](https://github.com/ankitakinger) +[![Aishwarya-U-R](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/91450662?v=4&w=50&h=50&mask=circle)](https://github.com/Aishwarya-U-R) [![rahulramesha](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/71900764?v=4&w=50&h=50&mask=circle)](https://github.com/rahulramesha) +[![ankitakinger](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/28362912?v=4&w=50&h=50&mask=circle)](https://github.com/ankitakinger) [![SatishGandham](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/441914?v=4&w=50&h=50&mask=circle)](https://github.com/SatishGandham) [![yatinappsmith](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/84702014?v=4&w=50&h=50&mask=circle)](https://github.com/yatinappsmith) [![marks0351](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/35134347?v=4&w=50&h=50&mask=circle)](https://github.com/marks0351) @@ -250,6 +250,7 @@ Lets build great software together. [![ramsaptami](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/79509062?v=4&w=50&h=50&mask=circle)](https://github.com/ramsaptami) [![AnandiKulkarni](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/80756091?v=4&w=50&h=50&mask=circle)](https://github.com/AnandiKulkarni) [![momcilo-appsmith](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/81744497?v=4&w=50&h=50&mask=circle)](https://github.com/momcilo-appsmith) +[![vivekverma2312](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/83569920?v=4&w=50&h=50&mask=circle)](https://github.com/vivekverma2312) [![UXFalcon](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/90375262?v=4&w=50&h=50&mask=circle)](https://github.com/UXFalcon) [![shwetha-ramesh](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/92293815?v=4&w=50&h=50&mask=circle)](https://github.com/shwetha-ramesh) [![vasanth-appsmith](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/92305123?v=4&w=50&h=50&mask=circle)](https://github.com/vasanth-appsmith) diff --git a/app/client/cypress/integration/Smoke_TestSuite/Application/PgAdmin_spec.js b/app/client/cypress/integration/Smoke_TestSuite/Application/PgAdmin_spec.js index aad547b7a1b..7c4ca572a5a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/Application/PgAdmin_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/Application/PgAdmin_spec.js @@ -22,6 +22,9 @@ describe("PgAdmin Clone App", function() { // authenticating datasource cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + + cy.getPluginFormsAndCreateDatasource(); + cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Widget_loading_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Widget_loading_spec.js index 9258c805b68..f089accaeae 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Widget_loading_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/Widget_loading_spec.js @@ -19,6 +19,7 @@ describe("Binding the multiple widgets and validating default data", function() it("1. Create a postgres datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); cy.get("@createDatasource").then((httpResponse) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js index a8332708ccc..56934298f15 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js @@ -28,6 +28,7 @@ describe("Entity explorer tests related to copy query", function() { cy.wait(2000); cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js index 1142d6b306d..75eafebe86b 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js @@ -31,6 +31,7 @@ describe("Entity explorer tests related to query and datasource", function() { cy.wait(2000); cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); // checking that conflicting names are not allowed diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitDiscardChange/DiscardChanges_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitDiscardChange/DiscardChanges_spec.js index 30dd7844222..62ee8ca2051 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitDiscardChange/DiscardChanges_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitDiscardChange/DiscardChanges_spec.js @@ -17,6 +17,9 @@ describe("Git discard changes:", function() { // Create new postgres datasource cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + + cy.getPluginFormsAndCreateDatasource(); + cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js index f01675ae242..6cb76528e62 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js @@ -1,12 +1,10 @@ const commonlocators = require("../../../../locators/commonlocators.json"); const explorer = require("../../../../locators/explorerlocators.json"); const themelocator = require("../../../../locators/ThemeLocators.json"); -import { ObjectsRegistry } from "../../../../support/Objects/Registry"; let themeBackgroudColor; let themeFont; let themeColour; -let propPane = ObjectsRegistry.PropertyPane; describe("Theme validation usecase for multi-select widget", function() { it("Drag and drop multi-select widget and validate Default font and list of font validation + Bug 15007", function() { @@ -25,7 +23,7 @@ describe("Theme validation usecase for multi-select widget", function() { "response.body.responseMeta.status", 200, ); - cy.wait(1000); + cy.wait(3000); cy.get(themelocator.canvas).click({ force: true }); cy.wait(2000); @@ -43,7 +41,7 @@ describe("Theme validation usecase for multi-select widget", function() { "response.body.responseMeta.status", 200, ); - cy.wait(1000); + cy.wait(3000); cy.contains("Border").click({ force: true }); //Shadow validation @@ -61,7 +59,7 @@ describe("Theme validation usecase for multi-select widget", function() { "response.body.responseMeta.status", 200, ); - cy.wait(1000); + cy.wait(5000); cy.contains("Shadow").click({ force: true }); //Font @@ -95,17 +93,27 @@ describe("Theme validation usecase for multi-select widget", function() { .text(); }); }); - cy.contains("Font").click({ force: true }); + //cy.contains("Font").click({ force: true }); //Color - cy.wait(1000); - propPane.ChangeColor("purple", "Primary"); + cy.wait(3000); + cy.get(themelocator.inputColor) + .clear() + .wait(200) + .click() + .type("purple"); cy.get(themelocator.inputColor).should("have.value", "purple"); - cy.wait(1000); - - propPane.ChangeColor("brown", "Background"); + cy.get(themelocator.color) + .eq(1) + .click({ force: true }); + cy.wait(2000); + cy.get(themelocator.inputColor) + .clear() + .wait(200) + .click() + .type("brown"); cy.get(themelocator.inputColor).should("have.value", "brown"); - cy.wait(1000); + cy.wait(2000); cy.contains("Color").click({ force: true }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/InputTruncateCheck_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/AllInputWidgets_spec.ts similarity index 99% rename from app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/InputTruncateCheck_Spec.ts rename to app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/AllInputWidgets_spec.ts index 9690a14ff6f..2e410a59c68 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/InputTruncateCheck_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/AllInputWidgets_spec.ts @@ -2,6 +2,7 @@ import { WIDGET, PROPERTY_SELECTOR, getWidgetSelector, + getWidgetInputSelector, } from "../../../../locators/WidgetLocators"; import { ObjectsRegistry } from "../../../../support/Objects/Registry"; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/CurrencyInput/CurrencyInput_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/CurrencyInput/CurrencyInput_spec.js index 0592c976318..25c638890f1 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/CurrencyInput/CurrencyInput_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/CurrencyInput/CurrencyInput_spec.js @@ -280,16 +280,4 @@ describe("Currency widget - ", () => { cy.get(themelocators.popover).should("not.exist"); }); }); - - it("Currency change dropdown should not close unexpectedly", function() { - cy.openPropertyPane(widgetName); - - // Select the Currency dropdown option from property pane - // and enter a value that has space and returns 0 results - cy.get(".t--property-control-currency").click(); - cy.get(".t--search-input input").type("gdp gdp"); - - // assert that the dropdown is still option - cy.get(".t--search-input input").should("be.visible"); - }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/PhoneInput/Phone_input_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/PhoneInput/Phone_input_spec.js index ae8b5898061..72a8613a076 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/PhoneInput/Phone_input_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/PhoneInput/Phone_input_spec.js @@ -128,16 +128,4 @@ describe("Phone input widget - ", () => { // Check if isDirty is set to false cy.get(".t--widget-textwidget").should("contain", "false"); }); - - it("Currency change dropdown should not close unexpectedly", function() { - cy.openPropertyPane(widgetName); - - // Select the Currency dropdown option from property pane - // and enter a value that has space and returns 0 results - cy.get(".t--property-control-defaultcountrycode").click(); - cy.get(".t--search-input input").type("AFDB (+93)"); - - // assert that the dropdown is still option - cy.get(".t--search-input input").should("be.visible"); - }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/TableV2/TableV2Filter_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/TableV2/TableV2Filter_Spec.ts index 3f74ffcdccb..e6e2913d7ae 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/TableV2/TableV2Filter_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/TableV2/TableV2Filter_Spec.ts @@ -643,7 +643,6 @@ describe("Verify various Table_Filter combinations", function() { it("30. Import TableFilter application & verify all filters for same FirstName (one word column) + Bug 13334", () => { deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); homePage.NavigateToHome(); homePage.ImportApp("Table/TableFilterImportApp.json"); homePage.AssertImportToast(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ArangoDataSourceStub_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ArangoDataSourceStub_spec.js index 61627958a15..237da5e2d5f 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ArangoDataSourceStub_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ArangoDataSourceStub_spec.js @@ -14,9 +14,10 @@ describe("Arango datasource test cases", function() { }); it("1. Create, test, save then delete a Arango datasource", function() { - dataSources.NavigateToDSCreateNew(); - dataSources.CreatePlugIn("ArangoDB"); - agHelper.RenameWithInPane("ArangoWithnoTrailing", false); + cy.NavigateToDatasourceEditor(); + cy.get(datasource.ArangoDB).click(); + cy.getPluginFormsAndCreateDatasource(); + cy.renameDatasource("ArangoWithnoTrailing"); cy.fillArangoDBDatasourceForm(); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; @@ -29,9 +30,10 @@ describe("Arango datasource test cases", function() { }); it("2. Create with trailing white spaces in host address and database name, test, save then delete a Arango datasource", function() { - dataSources.NavigateToDSCreateNew(); - dataSources.CreatePlugIn("ArangoDB"); - agHelper.RenameWithInPane("ArangoWithTrailing", false); + cy.NavigateToDatasourceEditor(); + cy.get(datasource.ArangoDB).click(); + cy.getPluginFormsAndCreateDatasource(); + cy.renameDatasource("ArangoWithTrailing"); cy.fillArangoDBDatasourceForm(true); cy.intercept("POST", "/api/v1/datasources/test", { fixture: "testAction.json", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js index bed8c80f1bd..e2bf852f64d 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js @@ -10,7 +10,7 @@ describe("Datasource form related tests", function() { it("1. Check whether the delete button has the right color", function() { cy.NavigateToAPI_Panel(); - cy.CreateAPI(); //Not giving name to enable for cypress re-attempt + cy.CreateAPI("Testapi"); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); cy.get(".t--store-as-datasource") @@ -31,11 +31,11 @@ describe("Datasource form related tests", function() { it("3. Check if saved api as a datasource does not fail on cloning", function() { cy.NavigateToAPI_Panel(); cy.get(".t--entity-name") - .contains("Api") + .contains("Testapi") .trigger("mouseover"); cy.hoverAndClickParticularIndex(1); cy.get('.single-select:contains("Copy to page")').click(); cy.get('.single-select:contains("Page1")').click({ force: true }); - cy.validateToastMessage("action copied to page Page1 successfully"); + cy.validateToastMessage("Testapi action copied to page Page1 successfully"); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MongoDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MongoDatasource_spec.js index a850dd88ce8..ba742b37f8d 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MongoDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MongoDatasource_spec.js @@ -8,6 +8,7 @@ describe("Create, test, save then delete a mongo datasource", function() { it("Create, test, save then delete a mongo datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MongoDB).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMongoDatasourceForm(); cy.testSaveDeleteDatasource(); }); @@ -15,6 +16,7 @@ describe("Create, test, save then delete a mongo datasource", function() { it("Create with trailing white spaces in host address and database name, test, save then delete a mongo datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MongoDB).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMongoDatasourceForm(true); //fills form with trailing white spaces cy.testSaveDeleteDatasource(); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MsSQLDataSourceStub_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MsSQLDataSourceStub_spec.js index 912d2e261e2..e1cd7da4f10 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MsSQLDataSourceStub_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MsSQLDataSourceStub_spec.js @@ -11,6 +11,8 @@ describe("MsSQL datasource test cases", function() { it("1. Create, test, save then delete a MsSQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MsSQL).click(); + cy.getPluginFormsAndCreateDatasource(); + cy.fillMsSQLDatasourceForm(); cy.generateUUID().then((UUID) => { datasourceName = `MsSQL MOCKDS ${UUID}`; @@ -29,6 +31,7 @@ describe("MsSQL datasource test cases", function() { it("2. Create with trailing white spaces in host address and database name, test, save then delete a MsSQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MsSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMsSQLDatasourceForm(true); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLDataSourceStub_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLDataSourceStub_spec.js index ef116ea37ea..110bf5c10b9 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLDataSourceStub_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLDataSourceStub_spec.js @@ -12,6 +12,8 @@ describe("MySQL datasource test cases", function() { it("1. Create, test, save then delete a MySQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MySQL).click(); + cy.getPluginFormsAndCreateDatasource(); + cy.fillMySQLDatasourceForm(); cy.generateUUID().then((UUID) => { datasourceName = `MySQL MOCKDS ${UUID}`; @@ -30,6 +32,7 @@ describe("MySQL datasource test cases", function() { it("2. Create with trailing white spaces in host address and database name, test, save then delete a MySQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MySQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMySQLDatasourceForm(true); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLNoiseTest_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLNoiseTest_spec.js index 93d458b224e..3421c9e9479 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLNoiseTest_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQLNoiseTest_spec.js @@ -20,6 +20,7 @@ describe("MySQL noise test", function() { .type(datasourceName, { force: true }) .should("have.value", datasourceName) .blur(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMySQLDatasourceForm(); cy.testSaveDatasource(); cy.NavigateToActiveDSQueryPane(datasourceName); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQL_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQL_spec.js index 876d0239620..18eef7944b4 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQL_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/MySQL_spec.js @@ -12,6 +12,7 @@ describe("MySQL datasource test cases", function() { it("1. Create, test, save then delete a MySQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MySQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMySQLDatasourceForm(); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; @@ -22,6 +23,7 @@ describe("MySQL datasource test cases", function() { it("2. Create with trailing white spaces in host address and database name, test, save then delete a MySQL datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MySQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMySQLDatasourceForm(true); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/PostgresDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/PostgresDatasource_spec.js index f938e16ade3..2755e79bff7 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/PostgresDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/PostgresDatasource_spec.js @@ -12,6 +12,7 @@ describe("Postgres datasource test cases", function() { it("1. Create, test, save then delete a postgres datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; @@ -22,6 +23,7 @@ describe("Postgres datasource test cases", function() { it("2. Create with trailing white spaces in host address and database name, test, save then delete a postgres datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(true); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RedshiftDataSourceStub_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RedshiftDataSourceStub_spec.js index 7643ed7094d..7355fa32687 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RedshiftDataSourceStub_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RedshiftDataSourceStub_spec.js @@ -12,6 +12,8 @@ describe("Redshift datasource test cases", function() { it("1. Create, test, save then delete a Redshift datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.Redshift).click(); + cy.getPluginFormsAndCreateDatasource(); + cy.fillRedshiftDatasourceForm(); cy.generateUUID().then((UUID) => { datasourceName = `Redshift MOCKDS ${UUID}`; @@ -30,6 +32,7 @@ describe("Redshift datasource test cases", function() { it("2. Create with trailing white spaces in host address and database name, test, save then delete a Redshift datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.Redshift).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillRedshiftDatasourceForm(true); cy.get("@createDatasource").then((httpResponse) => { datasourceName = httpResponse.response.body.data.name; diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/SMTPDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/SMTPDatasource_spec.js index 1ef4825a81e..5d2328de23e 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/SMTPDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/SMTPDatasource_spec.js @@ -26,6 +26,7 @@ describe("SMTP datasource test cases using ted", function() { .should("have.value", SMTPDatasourceName) .blur(); + cy.getPluginFormsAndCreateDatasource(); cy.fillSMTPDatasourceForm(); cy.testSaveDatasource(); cy.NavigateToActiveDSQueryPane(SMTPDatasourceName); @@ -110,7 +111,7 @@ describe("SMTP datasource test cases using ted", function() { cy.get(".bp3-spinner").should("have.length", 1); //eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); - cy.get("button").contains("1 files selected"); + cy.get("button").contains("1 files selected"); cy.xpath( "//span[text()='Run query' and @class='bp3-button-text']", ).click(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts index 58a4418fe27..2479c3d3427 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts @@ -608,7 +608,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { //Validating loaded table agHelper.AssertElementExist(dataSources._selectedRow); - table.ReadTableRowColumnData(0, 0, 4000).then(($cellData) => { + table.ReadTableRowColumnData(0, 0, 2500).then(($cellData) => { expect($cellData).to.eq(col1Text); }); table.ReadTableRowColumnData(0, 1, 200).then(($cellData) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts index e8eeddfe9d3..5e3f0733367 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts @@ -766,8 +766,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { ) { agHelper.ClickButton("Update"); //Update does not work, Bug 14063 agHelper.AssertElementAbsence(locator._toastMsg); //Validating fix for Bug 14063 - for common table columns - //agHelper.Sleep(2000); //for update to reflect! - agHelper.WaitUntilEleDisappear(locator._spinner); + agHelper.Sleep(2000); //for update to reflect! agHelper.ValidateNetworkStatus("@postExecute", 200); agHelper.ValidateNetworkStatus("@postExecute", 200); table.AssertSelectedRow(rowIndex); //Validate Primary key column selection diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/ExecutionParams_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/ExecutionParams_spec.js index adf28786186..7f436f74378 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/ExecutionParams_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/ExecutionParams_spec.js @@ -14,6 +14,7 @@ describe("API Panel Test Functionality", function() { it("1. Create a postgres datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.PostgreSQL).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); cy.get("@createDatasource").then((httpResponse) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js index d00d20be569..804bc8a575c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js @@ -27,6 +27,7 @@ describe("Create a query with a mongo datasource, run, save and then delete the it("1. Creates a new Mongo datasource", function() { cy.NavigateToDatasourceEditor(); cy.get(datasource.MongoDB).click(); + cy.getPluginFormsAndCreateDatasource(); cy.fillMongoDatasourceForm(); cy.generateUUID().then((uid) => { datasourceName = `Mongo CRUD ds ${uid}`; @@ -294,7 +295,6 @@ describe("Create a query with a mongo datasource, run, save and then delete the }); cy.onlyQueryRun(); - cy.wait(1000); cy.wait("@postExecute").then(({ response }) => { expect(response.body.data.isExecutionSuccess).to.eq(true); expect(response.body.data.body[0]._id).to.eq( diff --git a/app/client/cypress/integration/Smoke_TestSuite_Fat/ClientSideTests/UpgradeAppsmith/UpgradeAppsimth_spec.js b/app/client/cypress/integration/Smoke_TestSuite_Fat/ClientSideTests/UpgradeAppsmith/UpgradeAppsimth_spec.js index e69f8494423..5955c5f85ab 100644 --- a/app/client/cypress/integration/Smoke_TestSuite_Fat/ClientSideTests/UpgradeAppsmith/UpgradeAppsimth_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite_Fat/ClientSideTests/UpgradeAppsmith/UpgradeAppsimth_spec.js @@ -3,7 +3,7 @@ const testdata = require("../../../../fixtures/testdata.json"); const testUrl = "http://localhost:5001/v1/parent/cmd"; describe("Upgrade appsmith version", () => { - it.skip("Upgrade Appsmith version and verify the Applications", () => { + it("Upgrade Appsmith version and verify the Applications", () => { const uuid = () => Cypress._.random(0, 10000); const name = uuid(); cy.wait(2000); @@ -60,7 +60,7 @@ describe("Upgrade appsmith version", () => { cy.wait(2000); }); - it.skip("Upgrade Appsmith from CE to EE and verify the Applications", () => { + it("Upgrade Appsmith from CE to EE and verify the Applications", () => { cy.log("Stop the appsmith container"); cy.StopTheContainer(testUrl, "appsmith"); // stop the old container cy.wait(2000); diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index 474f24ff9ee..7d24054b7e4 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -432,7 +432,6 @@ export class AggregateHelper { : cy.get(selector); return locator .eq(index) - .scrollIntoView() .click({ force: force }) .wait(waitTimeInterval); } @@ -689,18 +688,6 @@ export class AggregateHelper { }); } - public UpdateInput(selector: string, value: string) { - this.GetElement(selector) - .find("input") - .then((ins: any) => { - //const input = ins[0].input; - ins.focus(); - this.Sleep(200); - ins.val(value); - this.Sleep(200); - }); - } - public BlurCodeInput(selector: string) { cy.wrap(selector) .find(".CodeMirror") diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 523f0282f08..0a9d0d87924 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -14,7 +14,7 @@ export class DataSources { private locator = ObjectsRegistry.CommonLocators; private _dsCreateNewTab = "[data-cy=t--tab-CREATE_NEW]"; - private _addNewDataSource = ".t--entity-add-btn.datasources"; + private _addNewDataSource = ".datasources .t--entity-add-btn"; private _createNewPlgin = (pluginName: string) => ".t--plugin-name:contains('" + pluginName + "')"; private _host = "input[name='datasourceConfiguration.endpoints[0].host']"; @@ -186,7 +186,11 @@ export class DataSources { } public NavigateToDSCreateNew() { - this.agHelper.GetNClick(this._addNewDataSource); + cy.get(this._addNewDataSource) + .last() + .scrollIntoView() + .should("be.visible") + .click({ force: true }); // cy.get(this._dsCreateNewTab) // .should("be.visible") // .click({ force: true }); @@ -465,7 +469,6 @@ export class DataSources { this.agHelper.UpdateCodeInput($field, query); }); this.agHelper.AssertAutoSave(); - this.agHelper.Sleep(500); //waiting a bit before proceeding! } public RunQueryNVerifyResponseViews( diff --git a/app/client/cypress/support/Pages/PropertyPane.ts b/app/client/cypress/support/Pages/PropertyPane.ts index 8fda1499037..44992db993c 100644 --- a/app/client/cypress/support/Pages/PropertyPane.ts +++ b/app/client/cypress/support/Pages/PropertyPane.ts @@ -42,8 +42,6 @@ export class PropertyPane { _colorPickerV2Popover = ".t--colorpicker-v2-popover"; _colorPickerV2Color = ".t--colorpicker-v2-color"; _colorRing = ".border-2"; - _colorInput = (option: string) => "//h3[text()='" + option + " Color']//parent::div//input"; - //_colorInputField = (option: string) => "//h3[text()='" + option + " Color']//parent::div"; private isMac = Cypress.platform === "darwin"; private selectAllJSObjectContentShortcut = `${ @@ -82,19 +80,13 @@ export class PropertyPane { } public ChangeColor( - colorIndex: number | string, + colorIndex: number, type: "Primary" | "Background" = "Primary", ) { const typeIndex = type == "Primary" ? 0 : 1; this.agHelper.GetNClick(this._colorRing, typeIndex); - if (typeof colorIndex == "number") { - this.agHelper.GetNClick(this._colorPickerV2Popover); - this.agHelper.GetNClick(this._colorPickerV2Color, colorIndex); - } else { - this.agHelper.GetElement(this._colorInput(type)).clear(); - this.agHelper.TypeText(this._colorInput(type), colorIndex); - //this.agHelper.UpdateInput(this._colorInputField(type), colorIndex);//not working! - } + this.agHelper.GetNClick(this._colorPickerV2Popover); + this.agHelper.GetNClick(this._colorPickerV2Color, colorIndex); } public GetJSONFormConfigurationFileds() { diff --git a/app/client/cypress/support/Pages/Table.ts b/app/client/cypress/support/Pages/Table.ts index cec39dc6e50..b9b26394edc 100644 --- a/app/client/cypress/support/Pages/Table.ts +++ b/app/client/cypress/support/Pages/Table.ts @@ -133,14 +133,7 @@ export class Table { ) { //timeout can be sent higher values incase of larger tables this.agHelper.Sleep(timeout); //Settling time for table! - return cy.waitUntil( - () => this.agHelper.GetElement(this._tableRowColumnData(rowNum, colNum), 30000), - { - errorMsg: "Table is not populated", - timeout: 30000, - interval: 2000, - }, - ).then($cellVal => cy.wrap($cellVal).invoke("text")); + return cy.get(this._tableRowColumnData(rowNum, colNum)).invoke("text"); } public AssertTableRowImageColumnIsLoaded( @@ -233,8 +226,7 @@ export class Table { }); } - public SelectTableRow(rowIndex: number, columnIndex = 0) { - //rowIndex - 0 for 1st row + public SelectTableRow(rowIndex: number, columnIndex = 0) { //rowIndex - 0 for 1st row cy.get(this._tableRow(rowIndex, columnIndex)) .first() .trigger("click", { force: true }); diff --git a/app/client/cypress/support/dataSourceCommands.js b/app/client/cypress/support/dataSourceCommands.js index 4b44522bb6b..1b01f901511 100644 --- a/app/client/cypress/support/dataSourceCommands.js +++ b/app/client/cypress/support/dataSourceCommands.js @@ -336,6 +336,7 @@ Cypress.Commands.add( Cypress.Commands.add("createPostgresDatasource", () => { cy.NavigateToDatasourceEditor(); cy.get(datasourceEditor.PostgreSQL).click(); + //cy.getPluginFormsAndCreateDatasource(); cy.fillPostgresDatasourceForm(); cy.testSaveDatasource(); }); diff --git a/app/client/package.json b/app/client/package.json index ef5214fa564..3ef42567f70 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -45,7 +45,7 @@ "cypress-log-to-output": "^1.1.2", "dayjs": "^1.10.6", "deep-diff": "^1.0.2", - "design-system": "npm:@appsmithorg/design-system@1.0.18", + "design-system": "npm:@appsmithorg/design-system@1.0.15", "downloadjs": "^1.4.7", "draft-js": "^0.11.7", "emoji-mart": "^3.0.1", diff --git a/app/client/src/components/propertyControls/DropDownControl.tsx b/app/client/src/components/propertyControls/DropDownControl.tsx index 9e1c1b49d3f..c63f16afad6 100644 --- a/app/client/src/components/propertyControls/DropDownControl.tsx +++ b/app/client/src/components/propertyControls/DropDownControl.tsx @@ -83,7 +83,6 @@ class DropDownControl extends BaseControl { return ( { options={options} placeholder={this.props.placeholderText} removeSelectedOption={this.onItemRemove} - searchAutoFocus searchPlaceholder={this.props.searchPlaceholderText} selected={defaultSelected} - showEmptyOptions showLabelOnly width="100%" /> diff --git a/app/client/src/pages/Applications/index.tsx b/app/client/src/pages/Applications/index.tsx index f5a178f91ca..5e90445ee67 100644 --- a/app/client/src/pages/Applications/index.tsx +++ b/app/client/src/pages/Applications/index.tsx @@ -661,27 +661,6 @@ function ApplicationsSection(props: any) { workspace.userPermissions, PERMISSION_TYPE.MANAGE_WORKSPACE, ); - const hasCreateNewApplicationPermission = - isPermitted( - workspace.userPermissions, - PERMISSION_TYPE.CREATE_APPLICATION, - ) && !isMobile; - - const onClickAddNewButton = (workspaceId: string) => { - if ( - Object.entries(creatingApplicationMap).length === 0 || - (creatingApplicationMap && !creatingApplicationMap[workspaceId]) - ) { - createNewApplication( - getNextEntityName( - "Untitled application ", - applications.map((el: any) => el.name), - ), - workspaceId, - ); - } - }; - return ( )} - {hasCreateNewApplicationPermission && + {isPermitted( + workspace.userPermissions, + PERMISSION_TYPE.CREATE_APPLICATION, + ) && + !isMobile && !isFetchingApplications && applications.length !== 0 && (