diff --git a/.gitignore b/.gitignore index 2d1d9bda93f0..f312b4ea14eb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ # test coverage coverage-summary.json +app/client/cypress/locators/Widgets.json diff --git a/app/client/cypress/fixtures/tableNewDsl.json b/app/client/cypress/fixtures/tableNewDsl.json index 30fda1987fca..d64d333c6912 100644 --- a/app/client/cypress/fixtures/tableNewDsl.json +++ b/app/client/cypress/fixtures/tableNewDsl.json @@ -1,129 +1,127 @@ { - "dsl": { - "widgetName": "MainContainer", - "backgroundColor": "none", - "rightColumn": 1224, - "snapColumns": 16, - "detachFromLayout": true, - "widgetId": "0", - "topRow": 0, - "bottomRow": 1280, - "containerStyle": "none", - "snapRows": 33, - "parentRowSpace": 1, - "type": "CANVAS_WIDGET", - "canExtend": true, - "version": 8, - "minHeight": 1292, - "parentColumnSpace": 1, - "dynamicBindingPathList": [], - "leftColumn": 0, - "children": [ - { - "isVisible": true, - "label": "Data", - "widgetName": "Table1", - "searchKey": "", - "tableData": "{{\n[\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n }\n]\n}}", - "type": "TABLE_WIDGET", - "isLoading": false, - "parentColumnSpace": 74, - "parentRowSpace": 40, - "leftColumn": 2, - "rightColumn": 10, - "topRow": 12, - "bottomRow": 19, - "parentId": "0", - "widgetId": "sb070qr2ir", + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1280, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 8, + "minHeight": 1292, + "parentColumnSpace": 1, "dynamicBindingPathList": [], - "primaryColumns": { - "id": { - "index": 0, - "width": 150, - "id": "id", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "text", - "textColor": "#4E5D78", - "textSize": "PARAGRAPH", - "fontStyle": "NORMAL", - "enableFilter": true, - "enableSort": true, + "leftColumn": 0, + "children": [{ "isVisible": true, - "isDerived": false, - "label": "id", - "computedValue": "" - }, - "email": { - "index": 1, - "width": 150, - "id": "email", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "text", - "textColor": "#4E5D78", - "textSize": "PARAGRAPH", - "fontStyle": "NORMAL", - "enableFilter": true, - "enableSort": true, - "isVisible": true, - "isDerived": false, - "label": "email", - "computedValue": "" - }, - "userName": { - "index": 2, - "width": 150, - "id": "userName", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "text", - "textColor": "#4E5D78", - "textSize": "PARAGRAPH", - "fontStyle": "NORMAL", - "enableFilter": true, - "enableSort": true, - "isVisible": true, - "isDerived": false, - "label": "userName", - "computedValue": "" - }, - "productName": { - "index": 3, - "width": 150, - "id": "productName", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "text", - "textColor": "#4E5D78", - "textSize": "PARAGRAPH", - "fontStyle": "NORMAL", - "enableFilter": true, - "enableSort": true, - "isVisible": true, - "isDerived": false, - "label": "productName", - "computedValue": "" - }, - "orderAmount": { - "index": 4, - "width": 150, - "id": "orderAmount", - "horizontalAlignment": "LEFT", - "verticalAlignment": "CENTER", - "columnType": "text", - "textColor": "#4E5D78", - "textSize": "PARAGRAPH", - "fontStyle": "NORMAL", - "enableFilter": true, - "enableSort": true, - "isVisible": true, - "isDerived": false, - "label": "orderAmount", - "computedValue": "" - } - } - } - ] - } -} + "label": "Data", + "widgetName": "Table1", + "searchKey": "", + "tableData": "{{\n[\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n }\n]\n}}", + "type": "TABLE_WIDGET", + "isLoading": false, + "parentColumnSpace": 74, + "parentRowSpace": 40, + "leftColumn": 2, + "rightColumn": 10, + "topRow": 12, + "bottomRow": 19, + "parentId": "0", + "widgetId": "sb070qr2ir", + "dynamicBindingPathList": [], + "primaryColumns": { + "id": { + "index": 0, + "width": 150, + "id": "id", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "id", + "computedValue": "" + }, + "email": { + "index": 1, + "width": 150, + "id": "email", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "email", + "computedValue": "" + }, + "userName": { + "index": 2, + "width": 150, + "id": "userName", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "userName", + "computedValue": "" + }, + "productName": { + "index": 3, + "width": 150, + "id": "productName", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "productName", + "computedValue": "" + }, + "orderAmount": { + "index": 4, + "width": 150, + "id": "orderAmount", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "orderAmount", + "computedValue": "" + } + } + }] + } +} \ No newline at end of file diff --git a/app/client/cypress/fixtures/tableNewDslWithPagination.json b/app/client/cypress/fixtures/tableNewDslWithPagination.json new file mode 100644 index 000000000000..08002f6b5d13 --- /dev/null +++ b/app/client/cypress/fixtures/tableNewDslWithPagination.json @@ -0,0 +1,127 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1280, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 8, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [{ + "isVisible": true, + "label": "Data", + "widgetName": "Table1", + "searchKey": "", + "tableData": "{{[\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n },\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n }\n]}}", + "type": "TABLE_WIDGET", + "isLoading": false, + "parentColumnSpace": 74, + "parentRowSpace": 40, + "leftColumn": 2, + "rightColumn": 10, + "topRow": 12, + "bottomRow": 19, + "parentId": "0", + "widgetId": "sb070qr2ir", + "dynamicBindingPathList": [], + "primaryColumns": { + "id": { + "index": 0, + "width": 150, + "id": "id", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "id", + "computedValue": "" + }, + "email": { + "index": 1, + "width": 150, + "id": "email", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "email", + "computedValue": "" + }, + "userName": { + "index": 2, + "width": 150, + "id": "userName", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "userName", + "computedValue": "" + }, + "productName": { + "index": 3, + "width": 150, + "id": "productName", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "productName", + "computedValue": "" + }, + "orderAmount": { + "index": 4, + "width": 150, + "id": "orderAmount", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "#4E5D78", + "textSize": "PARAGRAPH", + "fontStyle": "NORMAL", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDerived": false, + "label": "orderAmount", + "computedValue": "" + } + } + }] + } +} \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Column_Resize_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Column_Resize_spec.js index 7eb900087021..038d411031ce 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Column_Resize_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Column_Resize_spec.js @@ -11,13 +11,14 @@ describe("Table Widget Functionality with Hidden and Resized Columns", function( it("Table Widget Functionality with Hidden and Resized Columns", function() { cy.PublishtheApp(); + // Verify column header width should be equal to table width cy.get(".t--widget-tablewidget") .invoke("outerWidth") .then((tableWidth) => { cy.get(".t--widget-tablewidget .thead .tr") .invoke("outerWidth") - .then((width) => { - expect(width).to.be.at.least(tableWidth); + .then((columnHeaderWidth) => { + expect(columnHeaderWidth).to.be.at.least(tableWidth); }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Derived_Column_Data_validation_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Derived_Column_Data_validation_spec.js index d57c23fac35b..7e96f3888363 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Derived_Column_Data_validation_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Derived_Column_Data_validation_spec.js @@ -14,42 +14,59 @@ describe("Test Create Api and Bind to Table widget", function() { }); it("Create an API and Execute the API and bind with Table", function() { + // Create and execute an API and bind with table cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam); cy.RunAPI(); }); it("Validate Table with API data and then add a column", function() { + // Open property pane cy.SearchEntityandOpen("Table1"); + // Clear Table data and enter Apil data into table data cy.testJsontext("tabledata", "{{Api1.data.users}}"); + // Check Widget properties cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox); + // Open Text1 in propert pane cy.SearchEntityandOpen("Text1"); + // Change the Text value to selected row url cy.testJsontext("text", "{{Table1.selectedRow.url}}"); + // Open Table1 propert pane cy.SearchEntityandOpen("Table1"); + // Compare table 1st index data with itself cy.readTabledata("0", "0").then((tabData) => { const tableData = tabData; localStorage.setItem("tableDataPage1", tableData); }); + // Verify 1st index data cy.ValidateTableData("1"); + // add new column cy.addColumn("CustomColumn"); }); it("Table widget toggle test for background color", function() { + // Open id property pane cy.editColumn("id"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Click on cell background JS button cy.get(widgetsPage.toggleJsBcgColor) .first() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Change the cell background color to green cy.toggleJsAndUpdate("tabledata", "Green"); + // Go back to table property pane cy.get(".t--property-pane-back-btn").click({ force: true }); cy.wait("@updateLayout"); + // verify the cell background color cy.readTabledataValidateCSS("1", "0", "background-color", "rgb(0, 128, 0)"); }); it("Edit column name and validate test for computed value based on column type selected", function() { + // opoen customColumn1 property pane cy.editColumn("customColumn1"); + // Enter Apil 1st user email data into customColumn1 cy.readTabledataPublish("1", "9").then((tabData) => { const tabValue = tabData; cy.updateComputedValue("{{Api1.data.users[0].email}}"); @@ -62,19 +79,24 @@ describe("Test Create Api and Bind to Table widget", function() { }); it("Update table json data and check the column names updated", function() { + // Open table propert pane cy.SearchEntityandOpen("Table1"); + // Change the table data cy.testJsontext("tabledata", JSON.stringify(this.data.TableInputUpdate)); cy.wait("@updateLayout"); + // verify columns are visible or not in the propert pane cy.tableColumnDataValidation("id"); cy.tableColumnDataValidation("email"); cy.tableColumnDataValidation("userName"); cy.tableColumnDataValidation("productName"); cy.tableColumnDataValidation("orderAmount"); cy.tableColumnDataValidation("customColumn1"); + // Hide the columns in property pane cy.hideColumn("email"); cy.hideColumn("userName"); cy.hideColumn("productName"); cy.hideColumn("orderAmount"); + // verify customColumn is visible in the table cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); cy.closePropertyPane(); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_GeneralProperty_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_GeneralProperty_spec.js index e66f9eedfbde..533a43d250b2 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_GeneralProperty_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_GeneralProperty_spec.js @@ -13,161 +13,222 @@ describe("Table Widget property pane feature validation", function() { }); it("Test to validate table pagination is disabled", function() { + // Verify pagination is disabled cy.get(".t--table-widget-prev-page").should("have.attr", "disabled"); cy.get(".t--table-widget-next-page").should("have.attr", "disabled"); cy.get(".t--table-widget-page-input input").should("have.attr", "disabled"); }); it("Test to validate text allignment", function() { + // Open property pane cy.openPropertyPane("tablewidget"); + // Change the text align to center cy.get(widgetsPage.centerAlign) .first() .click({ force: true }); + // Verify the center text alignment cy.readTabledataValidateCSS("1", "0", "justify-content", "center"); + // Change the text align to right cy.get(widgetsPage.rightAlign) .first() .click({ force: true }); + // Verify the right text alignment cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-end"); + // Change the text align to left cy.get(widgetsPage.leftAlign) .first() .click({ force: true }); + // verify the left text alignment cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start"); }); it("Test to validate column heading allignment", function() { // cy.openPropertyPane("tablewidget"); + // Change the text align to center cy.get(widgetsPage.centerAlign) .first() .click({ force: true }); + // Verify the column headings are center aligned cy.get(".draggable-header") .first() .should("have.css", "text-align", "center"); + // Change the text align to right cy.get(widgetsPage.rightAlign) .first() .click({ force: true }); + // Verify the column headings are right aligned cy.get(".draggable-header") .first() .should("have.css", "text-align", "right"); + // Change the text align to left cy.get(widgetsPage.leftAlign) .first() .click({ force: true }); + // Verify the column headings are left aligned cy.get(".draggable-header") .first() .should("have.css", "text-align", "left"); }); it("Test to validate text format", function() { + // Select the bold font style cy.get(widgetsPage.bold).click({ force: true }); + // Varify the font style is bold cy.readTabledataValidateCSS("1", "0", "font-weight", "700"); + // Change the font style to italic cy.get(widgetsPage.italics).click({ force: true }); + // Verify the font style is italic cy.readTabledataValidateCSS("1", "0", "font-style", "italic"); }); it("Test to validate vertical allignment", function() { + // Select the top vertical alignment cy.get(widgetsPage.verticalTop).click({ force: true }); + // verify vertical alignment is top cy.readTabledataValidateCSS("1", "0", "align-items", "flex-start"); + // Change the vertical alignment to center cy.get(widgetsPage.verticalCenter) .last() .click({ force: true }); + // Verify the vertical alignment is centered cy.readTabledataValidateCSS("1", "0", "align-items", "center"); + // Change the vertical alignment to bottom cy.get(widgetsPage.verticalBottom) .last() .click({ force: true }); + // Verify the vertical alignment is bottom cy.readTabledataValidateCSS("1", "0", "align-items", "flex-end"); cy.get(commonlocators.editPropCrossButton).click({ force: true }); }); it("Table widget toggle test for text alignment", function() { + // Open property pane cy.openPropertyPane("tablewidget"); + // Open property pane of column "id" cy.editColumn("id"); + // Click on text align JS cy.get(widgetsPage.toggleTextAlign) .first() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Change the text align value to right for michael and left for others cy.toggleJsAndUpdate("tabledata", testdata.bindingGenAlign); + // Close propert pane cy.get(commonlocators.editPropCrossButton).click({ force: true }); + // Verify the text michael id is right aligned cy.readTabledataValidateCSS("0", "0", "justify-content", "flex-end"); + // Verify the 2nd id is left aligned cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-start"); }); it("Table widget change text size and validate", function() { + // Verify font size is 14px cy.readTabledataValidateCSS("0", "0", "font-size", "14px"); + // Open property pane cy.openPropertyPane("tablewidget"); + // Open property pane cy.editColumn("id"); + // Click on text size JS cy.get(widgetsPage.toggleTextAlign) .first() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Open txe size dropdown options cy.get(widgetsPage.textSize) .last() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Select Heading 1 text size cy.selectTextSize("Heading 1"); + // Verify the font size is 24px cy.readTabledataValidateCSS("0", "0", "font-size", "24px"); + // close propert pane cy.get(commonlocators.editPropCrossButton).click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); + // Verify the font size is 24px cy.readTabledataValidateCSS("0", "0", "font-size", "24px"); }); it("Test to validate open new tab icon shows when URL type data is hovered", function() { + // Open property pane cy.openPropertyPane("tablewidget"); + // Open email property pane cy.editColumn("email"); + // Change column type to url cy.changeColumnType("URL"); + // Show the url hidden icon in front of first email cy.get( `.t--widget-tablewidget .tbody .td[data-rowindex=1][data-colindex=1] .hidden-icon`, ).invoke("show"); + // Verify the url icon is visible on hover over email cy.get( `.t--widget-tablewidget .tbody .td[data-rowindex=1][data-colindex=1] .hidden-icon`, ).should("be.visible"); + // Close property pane cy.get(commonlocators.editPropCrossButton).click(); }); it("Edit column name and test for table header changes", function() { + // Open property pane cy.openPropertyPane("tablewidget"); + // Open email property pane cy.editColumn("email"); + // CHange the Column email name to Email Address cy.editColName("Email Address"); + // verify changed email name is visible cy.get(".draggable-header:contains('Email Address')").should("be.visible"); cy.get(commonlocators.editPropCrossButton).click(); }); it("Test to validate text color and text background", function() { + // Open property pane cy.openPropertyPane("tablewidget"); + // Click on text color input field cy.get(widgetsPage.textColor) .first() .click({ force: true }); + // Select green color cy.xpath(widgetsPage.greenColor).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.wait("@updateLayout"); + // Verify the text color is green cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)"); + // Change the text color and enter purple in input field cy.get(widgetsPage.textColor) .clear({ force: true }) .type("purple", { force: true }); cy.wait("@updateLayout"); + // Verify the text color is purple cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)"); + // Click on cell background color cy.get(widgetsPage.backgroundColor) .first() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); + // select the green color cy.xpath(widgetsPage.greenColor) .first() .click(); cy.wait("@updateLayout"); + // Verify the cell background color is green cy.readTabledataValidateCSS( "1", "0", "background", "rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box", ); + // Change the cell background color and enter purple in input field cy.get(widgetsPage.backgroundColor) .clear({ force: true }) .type("purple", { force: true }); cy.wait("@updateLayout"); + // Verify the cell background color is purple cy.readTabledataValidateCSS( "1", "0", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_PropertyPane_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_PropertyPane_spec.js index 42c7b7617300..af350cf09c14 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_PropertyPane_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_PropertyPane_spec.js @@ -1,8 +1,7 @@ const widgetsPage = require("../../../../locators/Widgets.json"); const commonlocators = require("../../../../locators/commonlocators.json"); const publish = require("../../../../locators/publishWidgetspage.json"); -const dsl = require("../../../../fixtures/tableNewDsl.json"); -const pages = require("../../../../locators/Pages.json"); +const dsl = require("../../../../fixtures/tableNewDslWithPagination.json"); const testdata = require("../../../../fixtures/testdata.json"); describe("Table Widget property pane feature validation", function() { @@ -10,71 +9,205 @@ describe("Table Widget property pane feature validation", function() { cy.addDsl(dsl); }); + // To be done: + // Column Data type: Video + + it("Verify default array data", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Open Widget side bar + cy.get(widgetsPage.addWidget).click(); + // Drag and drop table widget + cy.dragAndDropToCanvas("tablewidget", { x: 300, y: 200 }); + // close Widget side bar + cy.get(widgetsPage.closeWidgetBar).click({ force: true }); + cy.wait(2000); + cy.SearchEntityandOpen("Table2"); + // Verify default array data + cy.get(widgetsPage.tabedataField).should("not.be.empty"); + cy.deleteWidget(widgetsPage.tableWidget); + cy.wait(2000); + }); + + it("Verify On Row Selected Action", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Select show message in the "on selected row" dropdown + cy.onTableAction(0, "onrowselected", "Row is selected"); + cy.PublishtheApp(); + // Select 1st row + cy.isSelectRow(2); + cy.wait(2000); + // Verify Row is selected by showing the message + cy.get(commonlocators.toastmsg).contains("Row is selected"); + cy.get(publish.backToEditor).click(); + }); + + it("Check On Page Change Action", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Select show message in the "on selected row" dropdown + cy.onTableAction(1, "onpagechange", "Page Changed"); + cy.PublishtheApp(); + cy.wait(2000); + // Change the page + cy.get(widgetsPage.nextPageButton).click({ force: true }); + // Verify the page is changed + cy.get(commonlocators.toastmsg).contains("Page Changed"); + cy.get(publish.backToEditor).click(); + }); + it("Verify On Search Text Change Action", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Show Message on Search text change Action + cy.onTableAction(3, "onsearchtextchanged", "Search Text Changed"); + cy.PublishtheApp(); + // Change the Search text + cy.get(widgetsPage.searchField).type("Hello"); + cy.wait(2000); + // Verify the search text is changed + cy.get(commonlocators.toastmsg).contains("Search Text Changed"); + cy.get(publish.backToEditor).click(); + }); + + it("Explore Widget related documents Verification", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Click on "Explore widget related docs" button + cy.get(widgetsPage.exploreWidget).click(); + // Verify the widget related document + cy.get(widgetsPage.widgetRelatedDocument).should("contain", "Table"); + cy.wait(2000); + cy.get(widgetsPage.header).click(); + cy.wait(1000); + cy.PublishtheApp(); + }); + it("Check open section and column data in property pane", function() { cy.openPropertyPane("tablewidget"); + + // Validate the columns are visible in the property pane cy.tableColumnDataValidation("id"); cy.tableColumnDataValidation("email"); cy.tableColumnDataValidation("userName"); cy.tableColumnDataValidation("productName"); cy.tableColumnDataValidation("orderAmount"); + + // Updating the column name ; "id" > "TestUpdated" cy.tableColumnPopertyUpdate("id", "TestUpdated"); + + // Add new column in the table with name "CustomColumn" cy.addColumn("CustomColumn"); + cy.tableColumnDataValidation("customColumn1"); //To be updated later + + // Hide all other columns cy.hideColumn("email"); cy.hideColumn("userName"); cy.hideColumn("productName"); cy.hideColumn("orderAmount"); + + // Verifying the newly added column cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); }); - it("Edit column name and validate test for computed value based on column type selected", function() { + it("Column Detail - Edit column name and validate test for computed value based on column type selected", function() { + cy.makeColumnVisible("email"); + cy.makeColumnVisible("userName"); + cy.makeColumnVisible("productName"); + cy.makeColumnVisible("orderAmount"); + + // Open column detail to be edited by draggable id cy.editColumn("id"); + // Change the column name cy.editColName("updatedId"); - cy.readTabledataPublish("1", "2").then((tabData) => { + // Reading single cell value of the table and verify it's value. + cy.readTabledataPublish("1", "1").then((tabData) => { const tabValue = tabData; + cy.log(tabData); expect(tabData).to.not.equal("2736212"); + // Changing the Computed value from "id" to "Email" cy.updateComputedValue(testdata.currentRowEmail); - cy.readTabledataPublish("1", "2").then((tabData) => { - expect(tabData).to.be.equal(tabValue); - cy.log("computed value of plain text " + tabData); + // Reading single cell value of the table and verify it's value. + cy.readTabledataPublish("1", "0").then((tabData2) => { + cy.log(tabData2); + expect(tabData2).to.be.equal(tabValue); + cy.log("computed value of plain text " + tabData2); }); }); + // Changing Column data type from "Plain text" to "Number" cy.changeColumnType("Number"); - cy.readTabledataPublish("1", "5").then((tabData) => { - const tabValue = tabData; + cy.readTabledataPublish("1", "4").then((tabData) => { + cy.log(tabData); expect(tabData).to.not.equal("lindsay.ferguson@reqres.in"); + // Email to "orderAmount" cy.updateComputedValue(testdata.currentRowOrderAmt); - cy.readTabledataPublish("1", "0").then((tabData) => { - expect(tabData).to.be.equal(tabValue); - cy.log("computed value of number is " + tabData); + cy.readTabledataPublish("1", "0").then((tabData2) => { + cy.log(tabData2); + expect(tabData2).to.be.equal(tabData); + cy.log("computed value of number is " + tabData2); }); }); + // Changing Column data type from "Number" to "Date" cy.changeColumnType("Date"); + // orderAmout to "Moment Date" cy.updateComputedValue(testdata.momentDate); cy.readTabledataPublish("1", "1").then((tabData) => { expect(tabData).to.not.equal("9.99"); cy.log("computed value of Date is " + tabData); }); - // cy.changeColumnType("Time"); - // cy.updateComputedValue(testdata.momentDate); - // cy.readTabledataPublish("1", "0").then(tabData => { - // expect(tabData).to.not.equal("2736212"); - // cy.log("computed value of time is " + tabData); - // }); + // Changing Column data type from "URL" to "Video" + /* const videoVal = 'https://youtu.be/Sc-m3ceZyfk'; + cy.changeColumnType("Video"); + // "Moement "date" to "Video" + cy.updateComputedValue(videoVal); + // cy.testJson text("computedvalue", videoVal, ) + // Verifying the href of the Video added. + cy.readTableLinkPublish("1", "1").then((hrefVal) => { + expect(hrefVal).to.be.equal(videoVal); + });*/ + + // Changing Column data type from "Date" to "Image" + const imageVal = + "https://images.pexels.com/photos/736230/pexels-photo-736230.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"; + + cy.changeColumnType("Image"); + // "Moement "date" to "Image" + cy.updateComputedValue(imageVal); + // Verifying the href of the image added. + cy.readTableLinkPublish("1", "0").then((hrefVal) => { + expect(hrefVal).to.be.contains(imageVal); + }); + + // Changing Column data type from "Date" to "URl" + cy.readTabledataPublish("1", "1").then(() => { + cy.changeColumnType("URL"); + // "Image" to "url" + cy.updateComputedValue(testdata.currentRowEmail); + cy.readTabledataPublish("1", "0").then((tabData2) => { + expect(tabData2).to.not.equal("lindsay.ferguson@reqres.in"); + cy.log("computed value of URL is " + tabData2); + }); + }); }); it("Test to validate text allignment", function() { + // Verifying Center Alignment cy.get(widgetsPage.centerAlign) .first() .click({ force: true }); - cy.readTabledataValidateCSS("0", "0", "justify-content", "center"); + cy.readTabledataValidateCSS("1", "0", "justify-content", "center"); + + // Verifying Right Alignment cy.get(widgetsPage.rightAlign) .first() .click({ force: true }); - cy.readTabledataValidateCSS("0", "0", "justify-content", "flex-end"); + cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-end"); + + // Verifying Left Alignment cy.get(widgetsPage.leftAlign) .first() .click({ force: true }); @@ -82,19 +215,24 @@ describe("Table Widget property pane feature validation", function() { }); it("Test to validate text format", function() { + // Validate Bold text cy.get(widgetsPage.bold).click({ force: true }); - cy.readTabledataValidateCSS("0", "0", "font-weight", "700"); + cy.readTabledataValidateCSS("1", "0", "font-weight", "700"); + // Validate Italic text cy.get(widgetsPage.italics).click({ force: true }); cy.readTabledataValidateCSS("0", "0", "font-style", "italic"); }); it("Test to validate vertical allignment", function() { + // Validate vertical alignemnt of Cell text to TOP cy.get(widgetsPage.verticalTop).click({ force: true }); - cy.readTabledataValidateCSS("0", "0", "align-items", "flex-start"); + cy.readTabledataValidateCSS("1", "0", "align-items", "flex-start"); + // Validate vertical alignemnt of Cell text to Center cy.get(widgetsPage.verticalCenter) .last() .click({ force: true }); - cy.readTabledataValidateCSS("0", "0", "align-items", "center"); + cy.readTabledataValidateCSS("1", "0", "align-items", "center"); + // Validate vertical alignemnt of Cell text to Bottom cy.get(widgetsPage.verticalBottom) .last() .click({ force: true }); @@ -105,26 +243,30 @@ describe("Table Widget property pane feature validation", function() { cy.get(widgetsPage.textColor) .first() .click({ force: true }); + // Changing text color to GREEN and validate cy.xpath(widgetsPage.greenColor).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); cy.wait("@updateLayout"); - cy.readTabledataValidateCSS("0", "0", "color", "rgb(3, 179, 101)"); + cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)"); + // Changing text color to PURPLE and validate using JS cy.get(widgetsPage.toggleJsColor).click(); cy.testCodeMirrorLast("purple"); cy.wait("@updateLayout"); - cy.readTabledataValidateCSS("0", "0", "color", "rgb(128, 0, 128)"); + cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)"); + // Changing Cell backgroud color to GREEN and validate cy.get(widgetsPage.backgroundColor) .first() .click({ force: true }); cy.xpath(widgetsPage.greenColor).click(); cy.wait("@updateLayout"); cy.readTabledataValidateCSS( - "0", + "1", "0", "background", "rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box", ); + // Changing Cell backgroud color to PURPLE and validate using JS cy.get(widgetsPage.toggleJsBcgColor).click(); cy.testCodeMirrorLast("purple"); cy.wait("@updateLayout"); @@ -134,5 +276,50 @@ describe("Table Widget property pane feature validation", function() { "background", "rgb(128, 0, 128) none repeat scroll 0% 0% / auto padding-box border-box", ); + // close property pane + cy.closePropertyPane(); + }); + + it("Verify default search text", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Chage deat search text value to "data" + cy.testJsontext("defaultsearchtext", "data"); + cy.PublishtheApp(); + // Verify the deaullt search text + cy.get(widgetsPage.searchField).should("have.value", "data"); + cy.get(publish.backToEditor).click(); + }); + + it("Verify default selected row", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + cy.testJsontext("defaultsearchtext", ""); + // Change default selected row value to 1 + cy.get(widgetsPage.defaultSelectedRowField).type("1"); + cy.wait(2000); + cy.PublishtheApp(); + // Verify the default selected row + cy.get(widgetsPage.selectedRow).should( + "have.css", + "background-color", + "rgba(106, 134, 206, 0.1)", + ); + cy.get(publish.backToEditor).click(); + }); + + it("Table-Delete Verification", function() { + // Open property pane + cy.openPropertyPane("tablewidget"); + // Delete the Table widget + cy.deleteWidget(widgetsPage.tableWidget); + cy.PublishtheApp(); + // Verify the Table widget is deleted + cy.get(widgetsPage.tableWidget).should("not.exist"); + }); + + afterEach(() => { + // put your clean up code if any + cy.goToEditFromPublish(); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Property_JsonUpdate_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Property_JsonUpdate_spec.js index 42509006f4f3..1ad00dd29bce 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Property_JsonUpdate_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Property_JsonUpdate_spec.js @@ -16,36 +16,52 @@ describe("Test Create Api and Bind to Table widget", function() { }); it("Validate Table with API data and then add a column", function() { + // Open property pane cy.SearchEntityandOpen("Table1"); + // Change the table data to Apil data users cy.testJsontext("tabledata", "{{Api1.data.users}}"); + // Check server sided pagination cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox); + // Open property pane of Text1 cy.SearchEntityandOpen("Text1"); + // Change the text value to selected url cy.testJsontext("text", "{{Table1.selectedRow.url}}"); + // Open property pane cy.SearchEntityandOpen("Table1"); + // Copmre the table 1st index with itself cy.readTabledata("0", "0").then((tabData) => { const tableData = tabData; localStorage.setItem("tableDataPage1", tableData); }); + // Validate the table 1st index cy.ValidateTableData("1"); + // Add new column cy.addColumn("CustomColumn"); }); it("Update table json data and check the column names updated and validate empty value", function() { + // Open property pane cy.SearchEntityandOpen("Table1"); + // Change the table data cy.testJsontext("tabledata", JSON.stringify(this.data.TableInputWithNull)); cy.wait("@updateLayout"); + // Verify the columns are visible in property pane cy.tableColumnDataValidation("id"); cy.tableColumnDataValidation("email"); cy.tableColumnDataValidation("userName"); cy.tableColumnDataValidation("productName"); cy.tableColumnDataValidation("orderAmount"); cy.tableColumnDataValidation("customColumn1"); + // Hide the columns in the table from property pane cy.hideColumn("id"); cy.hideColumn("email"); cy.hideColumn("userName"); cy.hideColumn("productName"); + // Verify CustomColumn is visible cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); + // close property pane cy.closePropertyPane(); + // Validate the empty values cy.readTabledataPublish("0", "0").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal(""); @@ -53,14 +69,18 @@ describe("Test Create Api and Bind to Table widget", function() { }); it("Check Selected Row(s) Resets When Table Data Changes", function() { + // Select 1st row cy.isSelectRow(1); + // Empty first row cy.testJsontext("tabledata", "[]"); cy.wait("@updateLayout"); const newTableData = [...this.data.TableInput]; newTableData[0].userName = ""; + // Change table data from empty to some cy.testJsontext("tabledata", JSON.stringify(newTableData)); cy.wait("@updateLayout"); const selectedRowsSelector = `.t--widget-tablewidget .tbody .tr.selected-row`; + // Verify selected row resets on table data changes cy.get(selectedRowsSelector).should(($p) => { // should found 0 rows expect($p).to.have.length(0); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Add_button_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Add_button_spec.js index 52c3d3f922ea..1152173a153c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Add_button_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Add_button_spec.js @@ -12,22 +12,30 @@ describe("Table Widget property pane feature validation", function() { it("Table widget with Add button test and validation", function() { cy.openPropertyPane("tablewidget"); + // Open column details of "id". cy.editColumn("id"); cy.get(widgetsPage.tableBtn).should("not.exist"); + // Changing column data type to "Button" cy.changeColumnType("Button"); + // Changing the computed value (data) to "orderAmount" cy.updateComputedValue(testdata.currentRowOrderAmt); + // Selecting button action to show message cy.get(widgetsPage.actionSelect).click(); cy.get(commonlocators.chooseAction) .children() .contains("Show Message") .click(); cy.addSuccessMessage("Successful ".concat(testdata.currentRowEmail)); + // Close Property pane cy.get(commonlocators.editPropCrossButton).click({ force: true }); + + // Validating the button action by clicking cy.get(widgetsPage.tableBtn) .last() .click({ force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); + // Validating the toast message cy.get(widgetsPage.toastAction).should("be.visible"); cy.get(widgetsPage.toastActionText) .last() 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 15a1cff83715..9f8b41073ae5 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 @@ -1,13 +1,8 @@ -const testdata = require("../../../../fixtures/testdata.json"); const apiwidget = require("../../../../locators/apiWidgetslocator.json"); -const explorer = require("../../../../locators/explorerlocators.json"); const commonlocators = require("../../../../locators/commonlocators.json"); -const formWidgetsPage = require("../../../../locators/FormWidgets.json"); -const publish = require("../../../../locators/publishWidgetspage.json"); const widgetsPage = require("../../../../locators/Widgets.json"); const dsl = require("../../../../fixtures/tableNewDsl.json"); -const pageid = "MyPage"; before(() => { cy.addDsl(dsl); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Derived_Column_Computed_value_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Derived_Column_Computed_value_spec.js index 1a927ec29247..e697923db3b5 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Derived_Column_Computed_value_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_Widget_Derived_Column_Computed_value_spec.js @@ -12,19 +12,26 @@ describe("Table Widget property pane feature validation", function() { it("Test to add column", function() { cy.openPropertyPane("tablewidget"); + // Adding new column cy.addColumn("CustomColumn"); cy.tableColumnDataValidation("customColumn1"); //To be updated later + // Hiding all other columns in the table from property pane cy.hideColumn("email"); cy.hideColumn("userName"); cy.hideColumn("productName"); cy.hideColumn("orderAmount"); + // Validating the newly added column cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); }); it("Edit column name and validate test for computed value", function() { + // Open column detail by draggable id of the column cy.editColumn("customColumn1"); + // Validating single cell value cy.readTabledataPublish("1", "2").then(() => { + // Chaging the computed value to "Emails" cy.updateComputedValue(testdata.currentRowWithIdOutside); + // Validating single cell value cy.readTabledataPublish("1", "1").then((tabData) => { expect(tabData).to.be.equal("#lindsay.ferguson@reqres.in"); cy.log("computed value of plain text " + tabData); 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 673cdfdad4d7..f35121d00967 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 @@ -36,11 +36,9 @@ describe("Table Widget Functionality", function() { // .find("> .bp3-button-text") // .should("have.text", "{{navigateTo()}}"); cy.get(commonlocators.editPropCrossButton).click({ force: true }); - cy.PublishtheApp(); }); it("Table Widget Functionality To Verify The Data", function() { - cy.isSelectRow(1); cy.readTabledataPublish("1", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); @@ -49,7 +47,6 @@ describe("Table Widget Functionality", function() { }); it("Table Widget Functionality To Show a Base64 Image", function() { - cy.get(publish.backToEditor).click(); cy.openPropertyPane("tablewidget"); cy.editColumn("image"); cy.changeColumnType("Image"); @@ -57,8 +54,8 @@ describe("Table Widget Functionality", function() { const index = 1; const imageVal = this.data.TableInput[index].image; - cy.readTableLinkPublish(index, "1").then((bgUrl) => { - expect(bgUrl).to.be.equal(`url("${imageVal}")`); + cy.readTableLinkPublish(index, "1").then((hrefVal) => { + expect(hrefVal).to.contain(imageVal); }); }); @@ -118,19 +115,18 @@ describe("Table Widget Functionality", function() { .contains("is exactly") .click(); cy.get(publish.inputValue).type(tabValue); - cy.wait(500); - cy.get(publish.applyFiltersBtn).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); - cy.get(publish.canvas) - .first() - .click(); + cy.get(widgetsPage.filterApplyBtn).click({ force: true }); + cy.wait(500); + // cy.get(widgetsPage.filterCloseBtn).click({force:true}); cy.readTabledataPublish("0", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); }); + cy.get(widgetsPage.filterCloseBtn).click({ force: true }); + cy.get(publish.filterBtn).click(); cy.get(publish.removeFilter).click(); - cy.get("body").type("{esc}"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { @@ -139,7 +135,8 @@ describe("Table Widget Functionality", function() { }); cy.get(publish.canvas) .first() - .click(); + .click({ force: true }); + cy.wait(500); }); }); @@ -159,19 +156,17 @@ describe("Table Widget Functionality", function() { .contains("contains") .click(); cy.get(publish.inputValue).type("Lindsay"); - cy.wait(500); - cy.get(publish.applyFiltersBtn).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); - cy.get(publish.canvas) - .first() - .click(); + cy.get(widgetsPage.filterApplyBtn).click({ force: true }); + cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); }); + cy.get(widgetsPage.filterCloseBtn).click({ force: true }); + cy.get(publish.filterBtn).click(); cy.get(publish.removeFilter).click(); - cy.get("body").type("{esc}"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { @@ -180,7 +175,7 @@ describe("Table Widget Functionality", function() { }); cy.get(publish.canvas) .first() - .click(); + .click({ force: true }); }); }); @@ -200,19 +195,17 @@ describe("Table Widget Functionality", function() { .contains("starts with") .click(); cy.get(publish.inputValue).type("Lindsay"); - cy.wait(500); - cy.get(publish.applyFiltersBtn).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); - cy.get(publish.canvas) - .first() - .click(); + cy.get(widgetsPage.filterApplyBtn).click({ force: true }); + cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); }); + cy.get(widgetsPage.filterCloseBtn).click({ force: true }); + cy.get(publish.filterBtn).click(); cy.get(publish.removeFilter).click(); - cy.get("body").type("{esc}"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { @@ -221,7 +214,7 @@ describe("Table Widget Functionality", function() { }); cy.get(publish.canvas) .first() - .click(); + .click({ force: true }); }); }); @@ -241,19 +234,17 @@ describe("Table Widget Functionality", function() { .contains("ends with") .click(); cy.get(publish.inputValue).type("Ferguson"); - cy.wait(500); - cy.get(publish.applyFiltersBtn).click(); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); - cy.get(publish.canvas) - .first() - .click(); + cy.get(widgetsPage.filterApplyBtn).click({ force: true }); + cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { const tabValue = tabData; expect(tabValue).to.be.equal("Lindsay Ferguson"); }); + cy.get(widgetsPage.filterCloseBtn).click({ force: true }); + cy.get(publish.filterBtn).click(); cy.get(publish.removeFilter).click(); - cy.get("body").type("{esc}"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.readTabledataPublish("0", "3").then((tabData) => { @@ -262,7 +253,7 @@ describe("Table Widget Functionality", function() { }); cy.get(publish.canvas) .first() - .click(); + .click({ force: true }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_spec.js index d96a598d7a5f..2d260dde248e 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_spec.js @@ -150,7 +150,6 @@ describe("Button Widget Functionality", function() { }); it("Button-Copy Verification", function() { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; //Copy button and verify all properties cy.copyWidget("buttonwidget", widgetsPage.buttonWidget); diff --git a/app/client/cypress/locators/Widgets.json b/app/client/cypress/locators/Widgets.json index 70fb968d96a2..cda3eb70f9b2 100644 --- a/app/client/cypress/locators/Widgets.json +++ b/app/client/cypress/locators/Widgets.json @@ -110,5 +110,21 @@ "switchWidgetInactive": ".t--switch-widget-inactive", "switchWidgetLoading": ".t--switch-widget-loading", "chartPlotGroup": "g.raphael-group-63-plot-group", - "toggleEnableMultirowselection": ".t--property-control-enablemultirowselection .bp3-control-indicator" + "toggleEnableMultirowselection": ".t--property-control-enablemultirowselection .bp3-control-indicator", + "searchField": "[type=search]", + "defaultSelectedRowField":".t--property-control-defaultselectedrow .CodeMirror-line", + "selectedRow":".selected-row", + "removeTableWidget": ".t--delete-widget", + "nextPageButton": ".t--table-widget-next-page", + "addWidget": ".t--entity.group.widgets > div:nth-child(1) >div:nth-child(5)", + "closeWidgetBar": ".t--close-widgets-sidebar", + "tabedataField": ".t--property-control-tabledata", + "exploreWidget": "[class$=bp3-panel-stack-view] > div:nth-child(1) > div:nth-child(1) > span:nth-child(4)", + "widgetRelatedDocument": "div.main > div:nth-child(1) > div:nth-child(1)", + "rowHeight":".t--table-compact-mode-toggle-btn", + "rowHeightShortOpt":".bp3-popover-content > div > div:nth-child(1)", + "tbIndex0": "[class=td][data-colindex='0'][data-rowindex='0']", + "filterApplyBtn":".t--apply-filter-btn", + "filterCloseBtn":".t--close-filter-btn", + "header":"#header-root" } diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 748a66f601ad..9dc8e468c5f6 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1471,6 +1471,13 @@ Cypress.Commands.add("showColumn", (colId) => { .should("be.visible"); }); +Cypress.Commands.add("makeColumnVisible", (colId) => { + cy.get("[data-rbd-draggable-id='" + colId + "'] .t--show-column-btn").click({ + force: true, + }); + cy.wait(1000); +}); + Cypress.Commands.add("addColumn", (colId) => { cy.get(widgetsPage.addColumn).scrollIntoView(); cy.get(widgetsPage.addColumn) @@ -1528,7 +1535,18 @@ Cypress.Commands.add("addAction", (value) => { cy.enterActionValue(value); }); -Cypress.Commands.add("selectShowMsg", (value) => { +Cypress.Commands.add("onTableAction", (value, value1, value2) => { + cy.get(commonlocators.dropdownSelectButton) + .eq(value) + .click(); + cy.get(commonlocators.chooseAction) + .children() + .contains("Show Message") + .click(); + cy.testJsontext(value1, value2); +}); + +Cypress.Commands.add("selectShowMsg", () => { cy.get(commonlocators.chooseAction) .children() .contains("Show Message") diff --git a/list b/list new file mode 100644 index 000000000000..e69de29bb2d1