diff --git a/app/client/cypress/fixtures/navigateToInputDsl.json b/app/client/cypress/fixtures/navigateToInputDsl.json new file mode 100644 index 0000000000..ba6da67bd8 --- /dev/null +++ b/app/client/cypress/fixtures/navigateToInputDsl.json @@ -0,0 +1,53 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 966, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 260, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 30, + "minHeight": 270, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "isVisible": true, + "inputType": "TEXT", + "label": "", + "widgetName": "Input1", + "version": 1, + "resetOnSubmit": true, + "isRequired": false, + "isDisabled": false, + "allowCurrencyChange": false, + "type": "INPUT_WIDGET", + "isLoading": false, + "parentColumnSpace": 14.90625, + "parentRowSpace": 10, + "leftColumn": 13, + "rightColumn": 33, + "topRow": 12, + "bottomRow": 16, + "parentId": "0", + "widgetId": "bqgeyly6z5", + "defaultText": "params={{appsmith.URL.queryParams.paramName}}", + "dynamicBindingPathList": [ + { + "key": "defaultText" + } + ], + "dynamicTriggerPathList": [] + } + ], + "dynamicTriggerPathList": [] + } +} diff --git a/app/client/cypress/fixtures/navigateTotabledsl.json b/app/client/cypress/fixtures/navigateTotabledsl.json new file mode 100644 index 0000000000..e5f87f7fbc --- /dev/null +++ b/app/client/cypress/fixtures/navigateTotabledsl.json @@ -0,0 +1,72 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 966, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 470, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 30, + "minHeight": 270, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "isVisible": true, + "label": "Data", + "widgetName": "Table1", + "searchKey": "", + "textSize": "PARAGRAPH", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "totalRecordCount": 0, + "defaultPageSize": 0, + "dynamicBindingPathList": [], + "primaryColumns": {}, + "derivedColumns": {}, + "tableData": "", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75 + }, + "isVisibleSearch": true, + "isVisibleFilters": true, + "isVisibleDownload": true, + "isVisibleCompactMode": true, + "isVisiblePagination": true, + "version": 1, + "type": "TABLE_WIDGET", + "isLoading": false, + "parentColumnSpace": 14.90625, + "parentRowSpace": 10, + "leftColumn": 15, + "rightColumn": 51, + "topRow": 17, + "bottomRow": 45, + "parentId": "0", + "widgetId": "tsjcdyi1p8", + "dynamicTriggerPathList": [ + { + "key": "onRowSelected" + } + ], + "dynamicPropertyPathList": [ + { + "key": "onRowSelected" + } + ], + "onRowSelected": "{{ navigateTo('MyPage',{\"paramName\": Table1.selectedRow.id},'SAME_WINDOW') }}" + } + ], + "dynamicTriggerPathList": [] + } +} diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/NavigateToFeatureValidation_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/NavigateToFeatureValidation_spec.js new file mode 100644 index 0000000000..0890b32a48 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/NavigateToFeatureValidation_spec.js @@ -0,0 +1,45 @@ +const widgetsPage = require("../../../../locators/Widgets.json"); +const commonlocators = require("../../../../locators/commonlocators.json"); +const publish = require("../../../../locators/publishWidgetspage.json"); +const dsl = require("../../../../fixtures/navigateTotabledsl.json"); +const pages = require("../../../../locators/Pages.json"); +const testdata = require("../../../../fixtures/testdata.json"); +const dsl2 = require("../../../../fixtures/navigateToInputDsl.json"); +const explorer = require("../../../../locators/explorerlocators.json"); +const pageid = "MyPage"; + +describe("Table Widget with Input Widget and Navigate to functionality validation", function() { + before(() => { + cy.addDsl(dsl); + }); + + it("Table Widget Functionality with multiple page", function() { + cy.openPropertyPane("tablewidget"); + cy.widgetText("Table1", widgetsPage.tableWidget, commonlocators.tableInner); + cy.testJsontext("tabledata", JSON.stringify(testdata.TablePagination)); + cy.get(commonlocators.editPropCrossButton).click({ force: true }); + }); + + it("Create MyPage and valdiate if its successfully created", function() { + cy.Createpage(pageid); + cy.addDsl(dsl2); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(500); + cy.get(`.t--entity-name:contains("${pageid}")`).should("be.visible"); + }); + + it("Validate NavigateTo Page functionality ", function() { + cy.SearchEntityandOpen("Table1"); + cy.PublishtheApp(); + cy.readTabledataPublish("1", "0").then((tabDataP) => { + const tabValueP = tabDataP; + cy.log(tabValueP); + cy.isSelectRow(1); + cy.get("input").should("be.visible"); + cy.get(publish.inputWidget + " " + "input") + .first() + .invoke("attr", "value") + .should("contain", tabValueP); + }); + }); +});