diff --git a/.github/workflows/external-client-test.yml b/.github/workflows/external-client-test.yml index d882d70dbc..28523fdbca 100644 --- a/.github/workflows/external-client-test.yml +++ b/.github/workflows/external-client-test.yml @@ -71,6 +71,7 @@ jobs: - name: Build and test env: APPSMITH_MONGODB_URI: "mongodb://localhost:27017/mobtools" + APPSMITH_CLOUD_SERVICES_BASE_URL: "https://release-cs.appsmith.com" APPSMITH_REDIS_URL: "redis://127.0.0.1:6379" APPSMITH_ENCRYPTION_PASSWORD: "password" APPSMITH_ENCRYPTION_SALT: "salt" @@ -199,7 +200,7 @@ jobs: if(check.length == 0) { const head_sha = pull.head.sha; const { data: completed_at } = await github.checks.create({ - owner: context.repo.owner, + owner: context.repo.owner, repo: context.repo.repo, head_sha: head_sha, name: process.env.job, @@ -443,7 +444,7 @@ jobs: if(check.length == 0) { const head_sha = pull.head.sha; const { data: completed_at } = await github.checks.create({ - owner: context.repo.owner, + owner: context.repo.owner, repo: context.repo.repo, head_sha: head_sha, name: process.env.job, @@ -512,7 +513,7 @@ jobs: if(check.length == 0) { const head_sha = pull.head.sha; const { data: completed_at } = await github.checks.create({ - owner: context.repo.owner, + owner: context.repo.owner, repo: context.repo.repo, head_sha: head_sha, name: process.env.job, diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index ee7f215bd3..e4e8110d4e 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -83,6 +83,7 @@ jobs: - name: Build and test env: APPSMITH_MONGODB_URI: "mongodb://localhost:27017/mobtools" + APPSMITH_CLOUD_SERVICES_BASE_URL: "https://release-cs.appsmith.com" APPSMITH_REDIS_URL: "redis://127.0.0.1:6379" APPSMITH_ENCRYPTION_PASSWORD: "password" APPSMITH_ENCRYPTION_SALT: "salt" diff --git a/app/client/build.sh b/app/client/build.sh index c668865fc0..2f625ec5c4 100755 --- a/app/client/build.sh +++ b/app/client/build.sh @@ -6,7 +6,7 @@ GIT_SHA=$(eval git rev-parse HEAD) echo $GIT_SHA echo "Sentry Auth Token: $SENTRY_AUTH_TOKEN" -REACT_APP_SENTRY_RELEASE=$GIT_SHA EXTEND_ESLINT=true craco --max-old-space-size=4096 build --config craco.build.config.js +REACT_APP_SENTRY_RELEASE=$GIT_SHA REACT_APP_CLIENT_LOG_LEVEL=ERROR EXTEND_ESLINT=true craco --max-old-space-size=4096 build --config craco.build.config.js rm ./build/static/js/*.js.map echo "build finished" diff --git a/app/client/cypress/fixtures/DividerDsl.json b/app/client/cypress/fixtures/DividerDsl.json new file mode 100644 index 0000000000..36c0065140 --- /dev/null +++ b/app/client/cypress/fixtures/DividerDsl.json @@ -0,0 +1,48 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1280, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1300, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 23, + "minHeight": 1310, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "widgetName": "Divider1", + "rightColumn": 23, + "widgetId": "i5kplngd19", + "topRow": 25, + "bottomRow": 75, + "parentRowSpace": 10, + "isVisible": true, + "type": "DIVIDER_WIDGET", + "version": 1, + "parentId": "0", + "isLoading": false, + "parentColumnSpace": 19.75, + "dynamicTriggerPathList": [], + "leftColumn": 15, + "dynamicBindingPathList": [], + "orientation": "horizontal", + "capType": "nc", + "capSide": -1, + "strokeStyle": "solid", + "dividerColor": "black", + "thickness": 2 + } + ] + } +} \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js index 94a026cb44..7ffd0131ad 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_Edit_spec.js @@ -7,11 +7,9 @@ describe("API Panel Test Functionality", function() { cy.NavigateToAPI_Panel(); cy.log("Navigation to API Panel screen successful"); cy.CreateAPI("FirstAPI"); - cy.get("textarea").should( - "have.attr", - "placeholder", - "https://mock-api.appsmith.com/users", - ); + cy.get(".CodeMirror-placeholder") + .first() + .should("have.text", "https://mock-api.appsmith.com/users"); cy.log("Creation of FirstAPI Action successful"); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); cy.SaveAndRunAPI(); @@ -29,25 +27,20 @@ describe("API Panel Test Functionality", function() { cy.NavigateToAPI_Panel(); cy.CreateAPI("CrashTestAPI"); cy.SelectAction(testdata.postAction); - cy.xpath(apiwidget.headerKey) + cy.get(apiwidget.headerKey) .first() - .focus({ force: true }) - .type("{uparrow}", { force: true }) - .type("{ctrl}{shift}{downarrow}", { force: true }) - .type("{backspace}", { force: true }); + .click({ force: true }) + .type("{uparrow}", { parseSpecialCharSequences: true }) + .type("{ctrl}{shift}{downarrow}", { parseSpecialCharSequences: true }) + .type("{backspace}", { parseSpecialCharSequences: true }); // assert so that this fails - cy.xpath(apiwidget.headerKey).should("be.visible"); - cy.xpath(apiwidget.headerKey).should("have.value", ""); + cy.get(apiwidget.headerKey).should("be.visible"); + cy.get(apiwidget.headerKey).should("have.value", ""); }); it("Should correctly parse query params", function() { cy.NavigateToAPI_Panel(); cy.CreateAPI("APIWithQueryParams"); - cy.get("textarea").should( - "have.attr", - "placeholder", - "https://mock-api.appsmith.com/users", - ); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methodWithQueryParam); cy.ValidateQueryParams({ key: "q", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_RequestBody_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_RequestBody_spec.js index e7bcd32a12..0651e60673 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_RequestBody_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ApiPaneTests/API_RequestBody_spec.js @@ -12,7 +12,7 @@ describe("API Panel request body", function() { cy.contains(apiEditor.bodyTab).click(); cy.contains(testdata.apiFormDataBodyType).click(); - cy.xpath(apiwidget.formEncoded).should("be.visible"); + cy.get(apiwidget.formEncoded).should("be.visible"); cy.DeleteAPI(); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js index 50309718f1..992fe23a68 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Debugger/Logs_spec.js @@ -15,7 +15,6 @@ describe("Debugger logs", function() { }); it("Reset debugger state", function() { - cy.openPropertyPane("buttonwidget"); cy.get(".t--property-control-visible") .find(".t--js-toggle") .click(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Divider_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Divider_spec.js new file mode 100644 index 0000000000..05bcec35a9 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Divider_spec.js @@ -0,0 +1,23 @@ +const dsl = require("../../../../fixtures/DividerDsl.json"); +const explorer = require("../../../../locators/explorerlocators.json"); + +describe("Divider Widget Functionality", function() { + beforeEach(() => { + cy.addDsl(dsl); + }); + + it("Add new Divider", () => { + cy.get(explorer.addWidget).click(); + cy.dragAndDropToCanvas("dividerwidget", { x: 300, y: 300 }); + cy.get(".t--divider-widget").should("exist"); + }); + + it("Open Existing Divider from created Widgets list", () => { + cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(Widgets)").click({ + multiple: true, + }); + cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(Divider1)").click({ + multiple: true, + }); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Image_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Image_spec.js index 747a4e8471..5713afc305 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Image_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Image_spec.js @@ -23,7 +23,6 @@ describe("Image Widget Functionality", function() { ); cy.get(viewWidgetsPage.defaultImage) .click({ force: true }) - .type(this.data.command) .type(this.data.defaultimage); /** * @param{URL} ImageUrl diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_MultiRowSelect_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_MultiRowSelect_spec.js new file mode 100644 index 0000000000..fc09a9fbe5 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_MultiRowSelect_spec.js @@ -0,0 +1,46 @@ +const widgetsPage = require("../../../../locators/Widgets.json"); +const dsl = require("../../../../fixtures/tableNewDsl.json"); + +describe("Table Widget row multi select validation", function() { + before(() => { + cy.addDsl(dsl); + }); + + it("Test multi select column shows when enableMultirowselection is true", function() { + cy.openPropertyPane("tablewidget"); + cy.get(widgetsPage.toggleEnableMultirowselection) + .first() + .click({ force: true }); + cy.get(".t--table-multiselect-header") + .first() + .should("be.visible"); + + cy.get(".t--table-multiselect") + .first() + .should("be.visible"); + }); + + it("Test click on header cell selects all row", function() { + // click on header check cell + cy.get(".t--table-multiselect-header") + .first() + .click({ force: true }); + // check if rows selected + cy.get(".tr").should("have.class", "selected-row"); + }); + + it("Test click on single row cell changes header select cell state", function() { + // un select all rows + cy.get(".t--table-multiselect-header") + .first() + .click({ force: true }); + // click on first row select box + cy.get(".t--table-multiselect") + .first() + .click({ force: true }); + // check if header cell is in half check state + cy.get(".t--table-multiselect-header-half-check-svg") + .first() + .should("be.visible"); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js index c5648f5efb..15a1cff837 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Copy_Paste_spec.js @@ -32,6 +32,11 @@ describe("Test Suite to validate copy/paste table Widget", function() { 200, ); cy.get(commonlocators.toastAction).should("be.visible"); + + //Check after copying new table widget should not have any warnings + cy.get('.t--widget-propertypane-toggle [name="warning"]').should( + "not.exist", + ); /* cy.get(commonlocators.toastAction) .contains("UNDO") diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js index 7bd4ae775d..d46969722f 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js @@ -264,16 +264,16 @@ describe("Table Widget Functionality", function() { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); cy.log("the value is" + tabValue); - cy.get(publish.compactMode).click(); - cy.get(publish.compactOpt) + cy.get(publish.rowHeight).click(); + cy.get(publish.rowHeightOpt) .contains("Tall") .click(); cy.scrollTabledataPublish("3", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Byron Fields"); }); - cy.get(publish.compactMode).click(); - cy.get(publish.compactOpt) + cy.get(publish.rowHeight).click(); + cy.get(publish.rowHeightOpt) .contains("Short") .click(); cy.readTabledataPublish("4", "3").then((tabData) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/video_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/video_spec.js index 5ee9895da8..1f657612e3 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/video_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/video_spec.js @@ -51,7 +51,7 @@ describe("Video Widget Functionality", function() { cy.get(".CodeMirror textarea") .first() .blur(); - cy.get(widgetsPage.autoPlay).click(); + cy.get(widgetsPage.autoPlay).click({ force: true }); cy.wait("@updateLayout").should( "have.nested.property", "response.body.responseMeta.status", @@ -62,7 +62,7 @@ describe("Video Widget Functionality", function() { cy.get(commonlocators.toastMsg).should("be.visible"); cy.get(commonlocators.toastMsg).contains("Play success"); */ - cy.get(widgetsPage.autoPlay).click(); + cy.get(widgetsPage.autoPlay).click({ force: true }); cy.wait("@updateLayout").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DynamicInput/autocomplete_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DynamicInput/autocomplete_spec.js index 517b437c47..ecc7c5d252 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DynamicInput/autocomplete_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DynamicInput/autocomplete_spec.js @@ -6,29 +6,23 @@ const dynamicInputLocators = require("../../../../locators/DynamicInput.json"); const apiwidget = require("../../../../locators/apiWidgetslocator.json"); describe("Dynamic input autocomplete", () => { - beforeEach(() => { + before(() => { cy.addDsl(dsl); }); it("opens autocomplete for bindings", () => { cy.openPropertyPane("buttonwidget"); cy.get(dynamicInputLocators.input) .first() - .focus() - .type("{ctrl}{shift}{downarrow}") - .then(($cm) => { - if ($cm.val() !== "") { - cy.get(dynamicInputLocators.input) - .first() - .clear({ - force: true, - }); - } - + .click({ force: true }) + .type("{uparrow}", { parseSpecialCharSequences: true }) + .type("{ctrl}{shift}{downarrow}", { parseSpecialCharSequences: true }) + .type("{backspace}", { parseSpecialCharSequences: true }) + .then(() => { cy.get(dynamicInputLocators.input) .first() + .click({ force: true }) .type("{{", { - force: true, - parseSpecialCharSequences: false, + parseSpecialCharSequences: true, }); // Tests if autocomplete will open @@ -42,9 +36,11 @@ describe("Dynamic input autocomplete", () => { // Tests if "No suggestions" message will pop if you type any garbage cy.get(dynamicInputLocators.input) .first() - .type("garbage", { - force: true, - parseSpecialCharSequences: false, + .click({ force: true }) + .type("{uparrow}", { parseSpecialCharSequences: true }) + .type("{ctrl}{shift}{downarrow}", { parseSpecialCharSequences: true }) + .type("{{ garbage", { + parseSpecialCharSequences: true, }) .then(() => { cy.get(".CodeMirror-Tern-tooltip").should( @@ -53,21 +49,16 @@ describe("Dynamic input autocomplete", () => { ); }); }); + cy.evaluateErrorMessage("ReferenceError: garbage is not defined"); }); it("opens current value popup", () => { - // Test on widgets pane - cy.openPropertyPane("buttonwidget"); - cy.get(dynamicInputLocators.input) - .first() - .focus(); - cy.assertEvaluatedValuePopup("string"); // Test on api pane cy.NavigateToAPI_Panel(); cy.get(apiwidget.createapi).click({ force: true }); cy.wait("@createNewApi"); - cy.xpath(apiwidget.headerValue) - .first() - .focus(); + cy.get(apiwidget.headerValue).within(() => { + cy.get("textarea").click({ force: true }); + }); cy.assertEvaluatedValuePopup("string"); }); }); 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 12cd1d8c7a..01ddf0a9b5 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 @@ -5,6 +5,7 @@ const datasource = require("../../../../locators/DatasourcesEditor.json"); const apiwidget = require("../../../../locators/apiWidgetslocator.json"); const commonlocators = require("../../../../locators/commonlocators.json"); const explorer = require("../../../../locators/explorerlocators.json"); +const pages = require("../../../../locators/Pages.json"); const pageid = "MyPage"; let datasourceName; @@ -59,7 +60,7 @@ describe("Entity explorer tests related to query and datasource", function() { /* eslint-disable */ cy.wait(2000); - cy.go("back"); + cy.NavigateToQueryEditor(); cy.contains(".t--datasource-name", datasourceName) .find(queryLocators.editDatasourceButton) @@ -121,7 +122,12 @@ describe("Entity explorer tests related to query and datasource", function() { cy.runQuery(); cy.deleteQuery(); - + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); + cy.wait(500); + cy.NavigateToQueryEditor(); + cy.get(pages.integrationActiveTab) + .should("be.visible") + .click({ force: true }); cy.contains(".t--datasource-name", datasourceName) .find(".t--edit-datasource") .click(); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckBox_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckBox_spec.js index e987207b66..f3503292c7 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckBox_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckBox_spec.js @@ -81,7 +81,7 @@ describe("Checkbox Widget Functionality", function() { cy.get(publish.checkboxWidget).click(); cy.get(widgetsPage.formButtonWidget) .contains("Submit") - .should("have.attr", "disabled"); + .should("have.class", "bp3-disabled"); cy.get(publish.checkboxWidget).click(); cy.get(widgetsPage.formButtonWidget) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Radio_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Radio_spec.js index cf11fdd239..32b67709b9 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Radio_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Radio_spec.js @@ -49,7 +49,6 @@ describe("Radio Widget Functionality", function() { cy.get(formWidgetsPage.radioOnSelectionChangeDropdown) .get(commonlocators.dropdownSelectButton) .click({ force: true }) - .type(this.data.command) .type("2"); cy.PublishtheApp(); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js index 8e37dfa521..8b4b21a142 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Onboarding/Onboarding_spec.js @@ -2,6 +2,9 @@ // const explorer = require("../../../../locators/explorerlocators.json"); const homePage = require("../../../../locators/HomePage.json"); const commonlocators = require("../../../../locators/commonlocators.json"); +const pages = require("../../../../locators/Pages.json"); +const datasourceEditor = require("../../../../locators/DatasourcesEditor.json"); +const datasource = require("../../../../locators/DatasourcesEditor.json"); describe("Onboarding", function() { it("Onboarding flow", function() { @@ -38,9 +41,6 @@ describe("Onboarding", function() { .should("be.visible") .click({ force: true }); - cy.get(".t--create-query").click(); - cy.wait("@createNewApi"); - // Create and run query // Using the cheat option to create the action with 30 sec timeout cy.get(".t--onboarding-cheat-action") diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OrganisationTests/LeaveOrganizationTest_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OrganisationTests/LeaveOrganizationTest_spec.js index 325789bc62..d720788c33 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OrganisationTests/LeaveOrganizationTest_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OrganisationTests/LeaveOrganizationTest_spec.js @@ -51,14 +51,7 @@ describe("Leave organization test spec", function() { cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1")); cy.visit("/applications"); - cy.get(homePage.orgList.concat(newOrganizationName).concat(")")) - .scrollIntoView() - .should("be.visible") - .within(() => { - cy.get(homePage.orgNamePopover) - .first() - .click(); - }); + cy.openOrgOptionsPopup(newOrganizationName); cy.get(homePage.orgNamePopoverContent) .find("a") .should("have.length", 1) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Pages/Pages_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Pages/Pages_spec.js index 95133ddc2e..fb7a3de75c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Pages/Pages_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Pages/Pages_spec.js @@ -23,7 +23,9 @@ describe("Pages", function() { cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(Page1)").click({ multiple: true, }); - cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(APIs)").click({ + cy.get( + ".bp3-icon-caret-right ~ .t--entity-name:contains(Datasources)", + ).click({ multiple: true, }); cy.get(`.t--entity-name:contains(${apiName})`).should("have.length", 2); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/PropertyPane/PropertyPaneCTA_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/PropertyPane/PropertyPaneCTA_spec.js new file mode 100644 index 0000000000..6bdd252016 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/PropertyPane/PropertyPaneCTA_spec.js @@ -0,0 +1,21 @@ +const dsl = require("../../../../fixtures/TextTabledsl.json"); + +describe("Property pane CTA to add an action", function() { + before(() => { + cy.addDsl(dsl); + }); + + it("Check if CTA is shown when there is no action", function() { + cy.openPropertyPane("tablewidget"); + + cy.get(".t--propertypane-connect-cta").should("be.visible"); + }); + + it("Check if CTA does not exist when there is an action", function() { + cy.NavigateToAPI_Panel(); + + cy.CreateAPI("FirstAPI"); + cy.SearchEntityandOpen("Table1"); + cy.get(".t--propertypane-connect-cta").should("not.exist"); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/Datasourcedocs_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/Datasourcedocs_spec.js index 85badafaa2..8834919119 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/Datasourcedocs_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/Datasourcedocs_spec.js @@ -1,6 +1,7 @@ const datasource = require("../../../../locators/DatasourcesEditor.json"); const queryLocators = require("../../../../locators/QueryEditor.json"); const commonlocators = require("../../../../locators/commonlocators.json"); +const queryEditor = require("../../../../locators/QueryEditor.json"); describe("Check datasource doc links", function() { let postgresDatasourceName; @@ -44,7 +45,8 @@ describe("Check datasource doc links", function() { }); it("Delete the query and datasources", function() { - cy.get(queryLocators.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/SwitchDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/SwitchDatasource_spec.js index 7e4e07ef32..cdb81f2401 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/SwitchDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/QueryPaneTests/SwitchDatasource_spec.js @@ -1,5 +1,6 @@ const datasource = require("../../../../locators/DatasourcesEditor.json"); const queryLocators = require("../../../../locators/QueryEditor.json"); +const queryEditor = require("../../../../locators/QueryEditor.json"); describe("Switch datasource", function() { let postgresDatasourceName; @@ -92,7 +93,8 @@ describe("Switch datasource", function() { }); it("Delete the query and datasources", function() { - cy.get(queryLocators.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js index ea436086a3..54ff3d797d 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js @@ -23,5 +23,7 @@ describe("Widget Selection", function() { cy.get(`.t--widget-propertypane-toggle`) .not(`[style *= "background: rgb(255, 224, 210);"]`) // Excluding focused widgets. .should("have.length", 2); + + cy.get(`.t--multi-selection-box`).should("have.length", 1); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiFlow/CurlImportFlow_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiFlow/CurlImportFlow_spec.js index 9ea0d1bad9..d33f1f2480 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiFlow/CurlImportFlow_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiFlow/CurlImportFlow_spec.js @@ -1,10 +1,14 @@ const ApiEditor = require("../../../../locators/ApiEditor.json"); const apiwidget = require("../../../../locators/apiWidgetslocator.json"); +const pages = require("../../../../locators/Pages.json"); describe("Test curl import flow", function() { it("Test curl import flow Run and Delete", function() { localStorage.setItem("ApiPaneV2", "ApiPaneV2"); cy.NavigateToApiEditor(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.get(ApiEditor.curlImage).click({ force: true }); cy.get("textarea").type("curl -X GET https://mock-api.appsmith.com/users"); cy.importCurl(); @@ -27,7 +31,5 @@ describe("Test curl import flow", function() { cy.get("@deleteAction").then((response) => { cy.expect(response.response.body.responseMeta.success).to.eq(true); }); - cy.get(ApiEditor.ApiHomePage).should("be.visible"); - cy.get(ApiEditor.formActionButtons).should("not.exist"); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js index 5411c7745f..cb090494a1 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js @@ -14,11 +14,8 @@ describe("API Panel Test Functionality", function() { }); it("PUT Action test API fetaure", function() { - cy.log("Login Successful"); cy.NavigateToAPI_Panel(); - cy.log("Navigation to API Panel screen successful"); cy.CreateAPI("FirstAPI"); - cy.log("Creation of FirstAPI Action successful"); cy.SelectAction(testdata.putAction); cy.EnterSourceDetailsWithbody( testdata.baseUrl, diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js index 2d8be44b26..0437fef97e 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js @@ -1,10 +1,14 @@ const ApiEditor = require("../../../../locators/ApiEditor.json"); const apiwidget = require("../../../../locators/apiWidgetslocator.json"); +const pages = require("../../../../locators/Pages.json"); describe("Test curl import flow", function() { it("Test curl import flow for POST action with JSON body", function() { localStorage.setItem("ApiPaneV2", "ApiPaneV2"); cy.NavigateToApiEditor(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.get(ApiEditor.curlImage).click({ force: true }); cy.get("textarea").type( 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST https://mock-api.appsmith.com/echo/post', @@ -30,6 +34,9 @@ describe("Test curl import flow", function() { it("Test curl import flow for POST action with multipart form data", function() { localStorage.setItem("ApiPaneV2", "ApiPaneV2"); cy.NavigateToApiEditor(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.get(ApiEditor.curlImage).click({ force: true }); cy.get("textarea").type( "curl --request POST http://httpbin.org/post -F 'randomKey=randomValue' --form 'randomKey2=\"randomValue2\"'", 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 dabd0e202a..9c0da595b9 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 @@ -1,5 +1,6 @@ const datasource = require("../../../../locators/DatasourcesEditor.json"); const queryEditor = require("../../../../locators/QueryEditor.json"); +const datasourceEditor = require("../../../../locators/DatasourcesEditor.json"); let datasourceName; @@ -21,14 +22,18 @@ describe("Postgres datasource test cases", function() { it("Create a new query from the datasource editor", function() { cy.saveDatasource(); - cy.get(datasource.createQuerty).click(); + // cy.get(datasource.createQuerty).click(); + cy.get(`${datasourceEditor.datasourceCard} ${datasource.createQuerty}`) + .last() + .click(); cy.wait("@createNewApi").should( "have.nested.property", "response.body.responseMeta.status", 201, ); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js index 0f674bb143..82a484dede 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js @@ -100,7 +100,6 @@ describe("Entity explorer tests related to copy query", function() { cy.log("sliced id :" + updatedName); cy.EditEntityNameByDoubleClick(datasourceName, updatedName); cy.SearchEntityandOpen(updatedName); - cy.testSaveDatasource(); cy.hoverAndClick(); cy.get(apiwidget.delete).click({ force: true }); //This is check to make sure if a datasource is active 409 diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js index fccf4a4aa8..ed2cfb49e6 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js @@ -63,7 +63,8 @@ describe("Entity explorer datasource structure", function() { 201, ); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", @@ -72,7 +73,8 @@ describe("Entity explorer datasource structure", function() { cy.GlobalSearchEntity("MyQuery"); cy.get(`.t--entity-name:contains(MyQuery)`).click(); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", @@ -151,7 +153,8 @@ describe("Entity explorer datasource structure", function() { 200, ); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/ConfirmRunAction_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/ConfirmRunAction_spec.js index 312c09fa0d..19977d12df 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/ConfirmRunAction_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/ConfirmRunAction_spec.js @@ -41,7 +41,8 @@ describe("Confirm run action", function() { 200, ); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/PostgreDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/PostgreDatasource_spec.js index d291516b41..2eda8700f9 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/PostgreDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/PostgreDatasource_spec.js @@ -1,5 +1,6 @@ const queryLocators = require("../../../../locators/QueryEditor.json"); const datasource = require("../../../../locators/DatasourcesEditor.json"); +const pages = require("../../../../locators/Pages.json"); let datasourceName; @@ -39,6 +40,9 @@ describe("Create a query with a postgres datasource, run, save and then delete t }); it("Create, runs and delete another query", () => { cy.NavigateToQueryEditor(); + cy.get(pages.integrationActiveTab) + .should("be.visible") + .click({ force: true }); cy.contains(".t--datasource-name", datasourceName) .find(queryLocators.createQuery) .click(); @@ -53,6 +57,9 @@ describe("Create a query with a postgres datasource, run, save and then delete t }); it("Deletes a datasource", () => { cy.NavigateToQueryEditor(); + cy.get(pages.integrationActiveTab) + .should("be.visible") + .click({ force: true }); cy.contains(".t--datasource-name", datasourceName) .find(".t--edit-datasource") .click(); diff --git a/app/client/cypress/locators/DatasourcesEditor.json b/app/client/cypress/locators/DatasourcesEditor.json index defed053bb..834f6726ac 100644 --- a/app/client/cypress/locators/DatasourcesEditor.json +++ b/app/client/cypress/locators/DatasourcesEditor.json @@ -13,6 +13,8 @@ "sectionAuthentication": "[data-cy=section-Authentication]", "PostgresEntity": ".t--entity-name:contains(PostgreSQL)", "createQuerty": ".t--create-query", + "activeDatasourceList": ".t--active-datasource-list", + "datasourceCard": ".t--datasource", "editDatasource": ".t--edit-datasource", "defaultDatabaseName": "input[name='datasourceConfiguration.connection.defaultDatabaseName']", "selConnectionType": "[data-cy='datasourceConfiguration.connection.type']", diff --git a/app/client/cypress/locators/DynamicInput.json b/app/client/cypress/locators/DynamicInput.json index 8f34ce8219..8e5b4bc686 100644 --- a/app/client/cypress/locators/DynamicInput.json +++ b/app/client/cypress/locators/DynamicInput.json @@ -1,5 +1,5 @@ { - "input": ".CodeMirror textarea", + "input": ".CodeEditorTarget", "hints": "ul.CodeMirror-hints", "evaluatedValue": ".t--CodeEditor-evaluatedValue", "bindingPrompt": ".t--no-binding-prompt" diff --git a/app/client/cypress/locators/Pages.json b/app/client/cypress/locators/Pages.json index 2044baf6a8..b68297e32d 100644 --- a/app/client/cypress/locators/Pages.json +++ b/app/client/cypress/locators/Pages.json @@ -9,7 +9,9 @@ "Menuaction": ".bp3-overlay-open>.bp3-transition-container", "Delete": ":nth-child(2) > .bp3-menu-item", "apiEditorIcon": ".t--nav-link-api-editor", - "addEntityAPI": ".apis .t--entity-add-btn", + "addEntityAPI": ".datasources .t--entity-add-btn", + "integrationCreateNew": "[data-cy=t--tab-CREATE_NEW]", + "integrationActiveTab": "[data-cy=t--tab-ACTIVE]", "entityWidget": ".t--entity-name:contains('Widgets')", "entityTable": ".t--entity-name:contains('Table1')", "entityText": ".t--entity-name:contains('Text1')", diff --git a/app/client/cypress/locators/QueryEditor.json b/app/client/cypress/locators/QueryEditor.json index 4f2bcfe25b..1d736eda63 100644 --- a/app/client/cypress/locators/QueryEditor.json +++ b/app/client/cypress/locators/QueryEditor.json @@ -5,6 +5,8 @@ "runQuery": ".t--run-query", "saveQuery": ".t--save-query", "deleteQuery": ".t--delete-query", + "queryMoreAction": ".t--more-action-menu", + "deleteUsingContext": ".t--apiFormDeleteBtn", "createQuery": ".t--create-query", "addQueryEntity": ".//div[contains(@class,'t--entity group queries')]//div[contains(@class,'t--entity-add-btn')]", "addDatasource": ".t--add-datasource", diff --git a/app/client/cypress/locators/ViewWidgets.json b/app/client/cypress/locators/ViewWidgets.json index 68db5f3722..d71bd9d2cc 100644 --- a/app/client/cypress/locators/ViewWidgets.json +++ b/app/client/cypress/locators/ViewWidgets.json @@ -27,7 +27,7 @@ "createMarker": ".t--property-control-createnewmarker [type='checkbox']", "zoomLevel": ".t--property-control-zoomlevel svg", "sourceImage": ".t--property-control-image .CodeMirror-code", - "defaultImage": ".t--property-control-defaultimage .CodeMirror-code", + "defaultImage": ".t--property-control-defaultimage .CodeMirror textarea", "Chartlabel": ".t--draggable-chartwidget g:nth-child(5) text", "PieChartLabel": ".t--draggable-chartwidget g g:nth-child(1) g text", "pickMyLocation": ".t--draggable-mapwidget div[title='Pick My Location']" diff --git a/app/client/cypress/locators/Widgets.json b/app/client/cypress/locators/Widgets.json index 7b5644726c..38b87d7465 100644 --- a/app/client/cypress/locators/Widgets.json +++ b/app/client/cypress/locators/Widgets.json @@ -8,8 +8,8 @@ "buttonWidget": ".t--draggable-buttonwidget", "buttonStyleDropdown": ".t--property-control-buttonstyle [name='downArrow']", "buttonBackground": ".sc-ecQjpJ > div > .bp3-button", - "copyWidget": ":nth-child(2) > .bp3-popover-target > .sc-bdnylx > svg", - "removeWidget": ":nth-child(3) > .bp3-popover-target > .sc-bdnylx > svg", + "copyWidget": ".t--copy-widget svg", + "removeWidget": ".t--delete-widget svg", "propertypaneText": ".t--propertypane .bp3-panel-stack-view", "formButtonWidget": ".t--widget-formbuttonwidget", "textWidget": ".t--draggable-textwidget", @@ -75,7 +75,7 @@ "verticalBottom": ".t--icon-tab-BOTTOM", "textColor": ".t--property-control-textcolor input", "backgroundcolorPicker": ".t--property-control-backgroundcolor input", - "greenColor": "//div[@color='rgb(3, 179, 101)']", + "greenColor": "//div[@color='#03b365']", "toggleJsColor": ".t--property-control-textcolor .t--js-toggle", "backgroundColor": ".t--property-control-cellbackground input", "toggleJsBcgColor": ".t--property-control-cellbackground .t--js-toggle", @@ -105,5 +105,6 @@ "switchWidgetActive": ".t--switch-widget-active", "switchWidgetInactive": ".t--switch-widget-inactive", "switchWidgetLoading": ".t--switch-widget-loading", - "chartPlotGroup": "g.raphael-group-63-plot-group" + "chartPlotGroup": "g.raphael-group-63-plot-group", + "toggleEnableMultirowselection": ".t--property-control-enablemultirowselection .bp3-control-indicator" } diff --git a/app/client/cypress/locators/apiWidgetslocator.json b/app/client/cypress/locators/apiWidgetslocator.json index 9bdb4100dd..c49c628b0b 100644 --- a/app/client/cypress/locators/apiWidgetslocator.json +++ b/app/client/cypress/locators/apiWidgetslocator.json @@ -12,12 +12,11 @@ "path": ".t--path >div textarea", "editResourceUrl": ".t--dataSourceField", "autoSuggest": "//div[contains(@id,'react-select')]", - "headerKey": "(//div[contains(@class,'t--actionConfiguration.headers[0].key.0')]//textarea)[2]", - "headerValue": "(//div[contains(@class,'t--actionConfiguration.headers[0].value.0')]//textarea)[2]", - "postDefaultContentTypeHeaderKey": "(//div[contains(@class,'t--actionConfiguration.headers[2].key.2')]//textarea)[2]", - "queryKey": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].key.0')]//textarea)[2]", - "queryValue": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].value.0')]//textarea)[2]", - "formEncoded": "(//div[contains(@class,'t--actionConfiguration.bodyFormData[0].key.0')]//textarea)[2]", + "headerKey": ".t--actionConfiguration\\.headers\\[0\\]\\.key\\.0", + "headerValue": ".t--actionConfiguration\\.headers\\[0\\]\\.value\\.0", + "queryKey": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.key\\.0", + "queryValue": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.value\\.0", + "formEncoded": ".t--actionConfiguration\\.bodyFormData\\[0\\]\\.key\\.0", "responseStatus": "//div[@id='root']", "responseText": ".CodeMirror-line > [role='presentation']", "createApiOnSideBar": "button:contains('Create new API')", @@ -54,6 +53,6 @@ "onPageLoad": "[data-cy=executeOnLoad]", "renameEntity": ".single-select >div:contains('Edit Name')", "paramsTab": "//li//span[text()='Params']", - "paramKey": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].key.0')]//textarea)[1]", - "paramValue": "(//div[contains(@class,'t--actionConfiguration.queryParameters[0].value.0')]//textarea)[1]" + "paramKey": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.key\\.0", + "paramValue": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.value\\.0" } diff --git a/app/client/cypress/locators/commonlocators.json b/app/client/cypress/locators/commonlocators.json index 7248cf2091..968b5ad27a 100644 --- a/app/client/cypress/locators/commonlocators.json +++ b/app/client/cypress/locators/commonlocators.json @@ -13,9 +13,9 @@ "optionchangetextDropdown": " .t--property-control-onoptionchange .CodeMirror-code", "optionchangetextDatePicker": " .t--property-control-ondateselected .CodeMirror-code", "optionchangetextCheckbox": ".t--property-control-oncheckchange .CodeMirror-code", - "optionchangetextSwitch": ".t--property-control-onchange .CodeMirror-code", + "optionchangetextSwitch": ".t--property-control-onchange .CodeMirror textarea", "optionchangetextInput": ".t--property-control-ontextchanged .CodeMirror-code", - "optionchangeRadioselect": ".t--property-control-onselectionchange .CodeMirror-code", + "optionchangeRadioselect": ".t--property-control-onselectionchange .CodeMirror textarea", "optionalignment": ".t--property-control-alignment .bp3-popover-target", "onMarkerclick": ".t--property-control-onmarkerclick .CodeMirror-code", "success": "div[type='success'] span", diff --git a/app/client/cypress/locators/explorerlocators.json b/app/client/cypress/locators/explorerlocators.json index 47b927f915..42e0c2bb9b 100644 --- a/app/client/cypress/locators/explorerlocators.json +++ b/app/client/cypress/locators/explorerlocators.json @@ -3,7 +3,7 @@ "NoQueryMsg": "p:contains('No DB Queries yet.')", "NoWidgetsMsg": "p:contains('No widgets yet.')", "AddPage": ".pages .t--entity-add-btn", - "addEntityAPI": ".apis .t--entity-add-btn", + "addEntityAPI": ".datasources .t--entity-add-btn", "entityWidget": ".t--entity-name:contains('Widgets')", "entityTable": ".t--entity-name:contains('Table1')", "entityText": ".t--entity-name:contains('Text1')", @@ -13,7 +13,7 @@ "editName": ".single-select >div:contains('Edit Name')", "deletePage": ".single-select >div:contains('Delete')", "refreshStructure": ".single-select >div:contains('Refresh')", - "entityQuery": ".t--entity-name:contains('Queries')", + "entityQuery": ".t--entity-name:contains('Datasources')", "datasourceStructure": ".t--entity.datasourceStructure", "datasourceColumn": ".t--datasource-column", "templateMenuIcon": ".t--template-menu-trigger", @@ -25,6 +25,6 @@ "addWidget":".widgets .t--entity-add-btn", "dropHere":".appsmith_widget_0", "closeWidgets":".t--close-widgets-sidebar", - "addDBQueryEntity": ".dbqueries .t--entity-add-btn", + "addDBQueryEntity": ".datasources .t--entity-add-btn", "editEntity": ".t--entity-name input" } \ No newline at end of file diff --git a/app/client/cypress/locators/publishWidgetspage.json b/app/client/cypress/locators/publishWidgetspage.json index 900e80d117..8e91ef0bfe 100644 --- a/app/client/cypress/locators/publishWidgetspage.json +++ b/app/client/cypress/locators/publishWidgetspage.json @@ -31,8 +31,8 @@ "inputValue": ".t--table-filter-value-input", "canvas": ".canvas", "removeFilter": ".t--table-filter-remove-btn", - "compactMode": ".t--table-compact-mode-toggle-btn", - "compactOpt": ".t--table-compact-mode-option", + "rowHeight": ".t--table-compact-mode-toggle-btn", + "rowHeightOpt": ".t--table-compact-mode-option", "visibilityMode": ".t--table-column-visibility-toggle-btn", "visibilityOpt": ".option-title", "containerWidget": ".t--widget-containerwidget", diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 92ba4582f5..c1773bdcd7 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -24,6 +24,12 @@ const viewWidgetsPage = require("../locators/ViewWidgets.json"); let pageidcopy = " "; +export const initLocalstorage = () => { + cy.window().then((window) => { + window.localStorage.setItem("ShowCommentsButtonToolTip", ""); + }); +}; + Cypress.Commands.add("createOrg", () => { cy.get(homePage.createOrg) .should("be.visible") @@ -373,6 +379,8 @@ Cypress.Commands.add("LogintoApp", (uname, pword) => { "response.body.responseMeta.status", 200, ); + + initLocalstorage(); }); Cypress.Commands.add("LoginFromAPI", (uname, pword) => { @@ -509,6 +517,9 @@ Cypress.Commands.add("NavigateToAPI_Panel", () => { cy.get(pages.addEntityAPI) .should("be.visible") .click({ force: true }); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.get("#loading").should("not.exist"); }); @@ -742,16 +753,14 @@ Cypress.Commands.add( "EnterSourceDetailsWithHeader", (baseUrl, v1method, hKey, hValue) => { cy.enterDatasourceAndPath(baseUrl, v1method); - cy.xpath(apiwidget.headerKey) + cy.get(apiwidget.headerKey) .first() .click({ force: true }) - .type(hKey, { force: true }) - .should("have.value", hKey); - cy.xpath(apiwidget.headerValue) + .type(hKey, { parseSpecialCharSequences: true }); + cy.get(apiwidget.headerValue) .first() .click({ force: true }) - .type(hValue, { force: true }) - .should("have.value", hValue); + .type(hValue, { parseSpecialCharSequences: true }); cy.WaitAutoSave(); }, ); @@ -844,22 +853,20 @@ Cypress.Commands.add( "EnterSourceDetailsWithQueryParam", (baseUrl, v1method, hKey, hValue, qKey, qValue) => { cy.enterDatasourceAndPath(baseUrl, v1method); - cy.xpath(apiwidget.headerKey) + cy.get(apiwidget.headerKey) .first() .click({ force: true }) - .type(hKey, { force: true }) - .should("have.value", hKey); - cy.xpath(apiwidget.headerValue) + .type(hKey, { parseSpecialCharSequences: true }); + cy.get(apiwidget.headerValue) .first() .click({ force: true }) - .type(hValue, { force: true }) - .should("have.value", hValue); - cy.xpath(apiwidget.queryKey) + .type(hValue, { parseSpecialCharSequences: true }); + cy.get(apiwidget.queryKey) .first() .click({ force: true }) .type(qKey, { force: true }) .should("have.value", qKey); - cy.xpath(apiwidget.queryValue) + cy.get(apiwidget.queryValue) .first() .click({ force: true }) .type(qValue, { force: true }) @@ -880,6 +887,9 @@ Cypress.Commands.add( Cypress.Commands.add("CreationOfUniqueAPIcheck", (apiname) => { cy.get(pages.addEntityAPI).click(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.get(apiwidget.createapi).click({ force: true }); cy.wait("@createNewApi"); // cy.wait("@getUser"); @@ -1722,9 +1732,7 @@ Cypress.Commands.add("getAlert", (alertcss) => { cy.get(alertcss) .click({ force: true }) - .type("{command}{A}{del}") - .type("hello") - .should("not.to.be.empty"); + .type("hello"); cy.get(".t--open-dropdown-Select-type").click({ force: true }); cy.get(".bp3-popover-content .bp3-menu li") .contains("Success") @@ -1754,9 +1762,7 @@ Cypress.Commands.add( cy.get(alertcss) .click({ force: true }) - .type("{command}{A}{del}") - .type("hello") - .should("not.to.be.empty"); + .type("hello"); cy.get(".t--open-dropdown-Select-type").click({ force: true }); cy.get(".bp3-popover-content .bp3-menu li") .contains("Success") @@ -1768,7 +1774,7 @@ Cypress.Commands.add("addQueryFromLightningMenu", (QueryName) => { cy.get(commonlocators.dropdownSelectButton) .first() .click({ force: true }) - .selectOnClickOption("Execute a DB Query") + .selectOnClickOption("Execute a Query") .selectOnClickOption(QueryName); }); @@ -1776,7 +1782,7 @@ Cypress.Commands.add("addAPIFromLightningMenu", (ApiName) => { cy.get(commonlocators.dropdownSelectButton) .first() .click({ force: true }) - .selectOnClickOption("Call An API") + .selectOnClickOption("Execute a Query") .selectOnClickOption(ApiName); }); @@ -1849,7 +1855,11 @@ Cypress.Commands.add("testSaveDeleteDatasource", () => { 200, ); - cy.get(datasourceEditor.editDatasource).click(); + cy.get( + `${datasourceEditor.datasourceCard} ${datasourceEditor.editDatasource}`, + ) + .last() + .click(); cy.get(".t--delete-datasource").click(); cy.wait("@deleteDatasource").should( @@ -1872,7 +1882,9 @@ Cypress.Commands.add("NavigateToDatasourceEditor", () => { cy.get(explorer.addDBQueryEntity) .last() .click({ force: true }); - cy.get(queryEditor.addDatasource).click(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); }); Cypress.Commands.add("NavigateToQueryEditor", () => { @@ -1902,7 +1914,11 @@ Cypress.Commands.add("saveDatasource", () => { Cypress.Commands.add("testSaveDatasource", () => { cy.saveDatasource(); - cy.get(datasourceEditor.editDatasource).click(); + cy.get( + `${datasourceEditor.datasourceCard} ${datasourceEditor.editDatasource}`, + ) + .last() + .click(); cy.testDatasource(); }); @@ -1960,7 +1976,9 @@ Cypress.Commands.add("createPostgresDatasource", () => { Cypress.Commands.add("deleteDatasource", (datasourceName) => { cy.NavigateToQueryEditor(); - + cy.get(pages.integrationActiveTab) + .should("be.visible") + .click({ force: true }); cy.contains(".t--datasource-name", datasourceName) .find(".t--edit-datasource") .click(); @@ -2020,7 +2038,8 @@ Cypress.Commands.add("runAndDeleteQuery", () => { 200, ); - cy.get(queryEditor.deleteQuery).click(); + cy.get(queryEditor.queryMoreAction).click(); + cy.get(queryEditor.deleteUsingContext).click(); cy.wait("@deleteAction").should( "have.nested.property", "response.body.responseMeta.status", @@ -2044,7 +2063,7 @@ Cypress.Commands.add("executeDbQuery", (queryName) => { .click({ force: true }) .get("ul.bp3-menu") .children() - .contains("Execute a DB Query") + .contains("Execute a Query") .click({ force: true }) .get("ul.bp3-menu") .children() @@ -2168,9 +2187,12 @@ Cypress.Commands.add("copyWidget", (widget, widgetLocator) => { .children() .last() .invoke("text") - .then((originalWidget) => { + .then((x) => { + cy.log(x); + let originalWidget = x.replaceAll("x", ""); + originalWidget = originalWidget.replaceAll(/\u200B/g, ""); cy.log(originalWidget); - cy.get(widgetsPage.copyWidget).click(); + cy.get(widgetsPage.copyWidget).click({ force: true }); cy.reload(); // Wait for the widget to be appear in the DOM and press Ctrl/Cmd + V to paste the button. cy.get(widgetLocator).should("be.visible"); @@ -2181,7 +2203,10 @@ Cypress.Commands.add("copyWidget", (widget, widgetLocator) => { .children() .last() .invoke("text") - .then((copiedWidget) => { + .then((y) => { + cy.log(y); + let copiedWidget = y.replaceAll("x", ""); + copiedWidget = copiedWidget.replaceAll(/\u200B/g, ""); cy.log(copiedWidget); expect(originalWidget).to.be.equal(copiedWidget); }); @@ -2190,7 +2215,7 @@ Cypress.Commands.add("copyWidget", (widget, widgetLocator) => { Cypress.Commands.add("deleteWidget", (widget) => { // Delete the button widget - cy.get(widgetsPage.removeWidget).click(); + cy.get(widgetsPage.removeWidget).click({ force: true }); cy.get(widgetsPage.deleteToast).should("have.text", "UNDO"); }); @@ -2212,6 +2237,9 @@ Cypress.Commands.add("UpdateChartType", (typeOfChart) => { Cypress.Commands.add("createAndFillApi", (url, parameters) => { cy.NavigateToApiEditor(); + cy.get(pages.integrationCreateNew) + .should("be.visible") + .click({ force: true }); cy.testCreateApiButton(); cy.get("@createNewApi").then((response) => { cy.get(ApiEditor.ApiNameField).should("be.visible"); @@ -2495,13 +2523,13 @@ Cypress.Commands.add("ValidatePaginationInputData", () => { Cypress.Commands.add("callApi", (apiname) => { cy.get(commonlocators.callApi) .first() - .click(); + .click({ force: true }); cy.get(commonlocators.singleSelectMenuItem) - .contains("Call An API") - .click(); + .contains("Execute a Query") + .click({ force: true }); cy.get(commonlocators.selectMenuItem) .contains(apiname) - .click(); + .click({ force: true }); }); Cypress.Commands.add("assertPageSave", () => { @@ -2512,10 +2540,16 @@ Cypress.Commands.add("ValidateQueryParams", (param) => { cy.xpath(apiwidget.paramsTab) .should("be.visible") .click({ force: true }); - cy.xpath(apiwidget.paramKey) - .first() - .contains(param.key); - cy.xpath(apiwidget.paramValue) - .first() - .contains(param.value); + + cy.validateCodeEditorContent(apiwidget.paramKey, param.key); + cy.validateCodeEditorContent(apiwidget.paramValue, param.value); }); + +Cypress.Commands.add( + "validateCodeEditorContent", + (selector, contentToValidate) => { + cy.get(selector).within(() => { + cy.get(".CodeMirror-code").should("have.text", contentToValidate); + }); + }, +); diff --git a/app/client/cypress/support/index.js b/app/client/cypress/support/index.js index 71c1be4d99..bf914f1c91 100644 --- a/app/client/cypress/support/index.js +++ b/app/client/cypress/support/index.js @@ -18,6 +18,7 @@ let appId; // Import commands.js using ES2015 syntax: import "./commands"; +import { initLocalstorage } from "./commands"; Cypress.on("uncaught:exception", (err, runnable) => { // returning false here prevents Cypress from @@ -31,11 +32,13 @@ Cypress.on("fail", (error, runnable) => { }); before(function() { + initLocalstorage(); cy.startServerAndRoutes(); // Clear indexedDB cy.window().then((window) => { window.indexedDB.deleteDatabase("Appsmith"); }); + const username = Cypress.env("USERNAME"); const password = Cypress.env("PASSWORD"); cy.LoginFromAPI(username, password); @@ -58,6 +61,7 @@ before(function() { }); beforeEach(function() { + initLocalstorage(); Cypress.Cookies.preserveOnce("SESSION", "remember_token"); cy.startServerAndRoutes(); }); diff --git a/app/client/cypress/test.sh b/app/client/cypress/test.sh index b1a36fb9d4..f8c75f22cc 100755 --- a/app/client/cypress/test.sh +++ b/app/client/cypress/test.sh @@ -27,10 +27,10 @@ if [ "$target" == "ci" ]; then # On the CI server run the tests in parallel # This requires the projectId and the record_key to be configured in your environment variables. By default this is defined on the CI server echo "Got the Build ID: $BUILD_ID" - $(npm bin)/cypress run --headless --browser chrome \ + $(npm bin)/cypress run --headless \ --record --key "$CYPRESS_RECORD_KEY" --ci-build-id $BUILD_ID \ --parallel --group "Electrons on Gitlab CI" \ --spec "cypress/integration/Smoke_TestSuite/**/*.js" else - $(npm bin)/cypress run --headless --browser chrome --spec "cypress/integration/Smoke_TestSuite/**/*.js" + $(npm bin)/cypress run --headless --browser chromium --spec "cypress/integration/Smoke_TestSuite/**/*.js" fi diff --git a/app/client/package.json b/app/client/package.json index 9886eefe71..f2ee5e6319 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -117,6 +117,7 @@ "react-mentions": "^4.1.1", "react-paginating": "^1.4.0", "react-player": "^2.3.1", + "react-rating": "^2.0.5", "react-redux": "^7.1.3", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", @@ -155,7 +156,7 @@ }, "scripts": { "analyze": "source-map-explorer 'build/static/js/*.js'", - "start": "BROWSER=none EXTEND_ESLINT=true REACT_APP_ENVIRONMENT=DEVELOPMENT HOST=dev.appsmith.com craco start", + "start": "BROWSER=none EXTEND_ESLINT=true REACT_APP_ENVIRONMENT=DEVELOPMENT REACT_APP_CLIENT_LOG_LEVEL=debug HOST=dev.appsmith.com craco start", "build": "./build.sh", "build-local": "craco --max-old-space-size=4096 build --config craco.build.config.js", "build-staging": "REACT_APP_ENVIRONMENT=STAGING craco --max-old-space-size=4096 build --config craco.build.config.js", diff --git a/app/client/public/index.html b/app/client/public/index.html index df6675bb58..a022cc7b1c 100755 --- a/app/client/public/index.html +++ b/app/client/public/index.html @@ -34,10 +34,10 @@
- +