diff --git a/app/client/cypress/fixtures/formWithInputdsl.json b/app/client/cypress/fixtures/formWithInputdsl.json new file mode 100644 index 000000000000..5a33e795b1fb --- /dev/null +++ b/app/client/cypress/fixtures/formWithInputdsl.json @@ -0,0 +1,183 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 966, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1290, + "containerStyle": "none", + "snapRows": 128, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 30, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "widgetName": "Form1", + "backgroundColor": "white", + "rightColumn": 40, + "widgetId": "j77dthxf61", + "topRow": 8, + "bottomRow": 60, + "parentRowSpace": 40, + "isVisible": true, + "type": "FORM_WIDGET", + "version": 1, + "parentId": "0", + "isLoading": false, + "parentColumnSpace": 74, + "leftColumn": 12, + "dynamicBindingPathList": [], + "children": [ + { + "widgetName": "Canvas1", + "rightColumn": 2072, + "detachFromLayout": true, + "widgetId": "sidaue1kdu", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 2080, + "parentRowSpace": 1, + "isVisible": true, + "canExtend": false, + "type": "CANVAS_WIDGET", + "version": 1, + "parentId": "j77dthxf61", + "minHeight": 520, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + { + "widgetName": "Text1", + "rightColumn": 48, + "textAlign": "LEFT", + "widgetId": "ac6cc8wmlu", + "topRow": 0, + "bottomRow": 4, + "isVisible": true, + "type": "TEXT_WIDGET", + "fontStyle": "BOLD", + "version": 1, + "textColor": "#231F20", + "parentId": "sidaue1kdu", + "isLoading": false, + "leftColumn": 0, + "dynamicBindingPathList": [], + "fontSize": "HEADING1", + "text": "Form" + }, + { + "isRequired": false, + "widgetName": "Checkbox1", + "rightColumn": 52, + "widgetId": "szjhneuog5", + "topRow": 16, + "bottomRow": 20, + "parentRowSpace": 38, + "isVisible": true, + "label": "Label", + "type": "CHECKBOX_WIDGET", + "version": 1, + "parentId": "e3tq9qwta6", + "isLoading": false, + "parentColumnSpace": 71.75, + "leftColumn": 40, + "dynamicBindingPathList": [], + "defaultCheckedState": true, + "isDisabled": false + }, + { + "widgetName": "Switch1", + "rightColumn": 52, + "widgetId": "szjhneuog9", + "topRow": 72, + "bottomRow": 76, + "parentRowSpace": 38, + "isVisible": true, + "label": "Switch", + "type": "SWITCH_WIDGET", + "defaultSwitchState": true, + "version": 1, + "parentId": "e3tq9qwta6", + "isLoading": false, + "parentColumnSpace": 71.75, + "leftColumn": 40, + "dynamicBindingPathList": [], + "isDisabled": false + }, + { + "resetFormOnClick": true, + "widgetName": "FormButton1", + "rightColumn": 64, + "isDefaultClickDisabled": true, + "widgetId": "xyn7t20lhv", + "buttonStyle": "PRIMARY_BUTTON", + "topRow": 44, + "bottomRow": 48, + "isVisible": true, + "type": "FORM_BUTTON_WIDGET", + "version": 1, + "parentId": "sidaue1kdu", + "isLoading": false, + "disabledWhenInvalid": true, + "leftColumn": 48, + "dynamicBindingPathList": [], + "text": "Submit" + }, + { + "resetFormOnClick": true, + "widgetName": "FormButton2", + "rightColumn": 48, + "isDefaultClickDisabled": true, + "widgetId": "xlrmeiioaa", + "buttonStyle": "SECONDARY_BUTTON", + "topRow": 44, + "bottomRow": 48, + "isVisible": true, + "type": "FORM_BUTTON_WIDGET", + "version": 1, + "parentId": "sidaue1kdu", + "isLoading": false, + "disabledWhenInvalid": false, + "leftColumn": 32, + "dynamicBindingPathList": [], + "text": "Reset" + } + ] + } + ] + }, + { + "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": 42, + "rightColumn": 62, + "topRow": 13, + "bottomRow": 17, + "parentId": "0", + "widgetId": "fxixmi3q4s" + } + ], + "dynamicTriggerPathList": [] + } +} \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js index 2a4774093a37..0a3b1c96ea21 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js @@ -5,7 +5,7 @@ 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/formWidgetdsl.json"); +const dsl = require("../../../../fixtures/formWithInputdsl.json"); const pageid = "MyPage"; before(() => { @@ -51,6 +51,22 @@ describe("Test Suite to validate copy/delete/undo functionalites", function() { expect($lis).to.have.length(2); expect($lis.eq(0)).to.contain("{{FormTestCopy.isVisible}}"); expect($lis.eq(1)).to.contain("{{FormTestCopy.data}}"); + cy.contains("FormTestCopy"); + cy.get($lis.eq(1)) + .contains("{{FormTestCopy.data}}") + .click({ force: true }); + //cy.get('.clipboard-message success') + // .contains('Copied to clipboard!') + // .should('be.visible'); + cy.wait(10000); + cy.GlobalSearchEntity("Input1"); + cy.wait(10000); + cy.get(".bp3-input") + .first() + .click({ force: true }); + cy.get(".bp3-input") + .first() + .type(`{${modifierKey}}v`, { force: true }); }); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_With_Switch_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_With_Switch_spec.js index 503ad63a11ed..0145d8cedc95 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_With_Switch_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_With_Switch_spec.js @@ -4,6 +4,7 @@ const widgetsPage = require("../../../../locators/Widgets.json"); const publish = require("../../../../locators/publishWidgetspage.json"); const dsl = require("../../../../fixtures/datepicker_switchDsl.json"); const pages = require("../../../../locators/Pages.json"); +const dayjs = require("dayjs"); describe("Switch Widget within Form widget Functionality", function() { before(() => { @@ -28,9 +29,7 @@ describe("Switch Widget within Form widget Functionality", function() { cy.get(formWidgetsPage.defaultDate).click(); cy.SetDateToToday(); cy.setDate(1, "ddd MMM DD YYYY"); - const nextDay = Cypress.moment() - .add(1, "days") - .format("DD/MM/YYYY"); + const nextDay = dayjs().format("DD/MM/YYYY"); cy.log(nextDay); cy.get(widgetsPage.actionSelect).click(); cy.get(commonlocators.chooseAction) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js index 3a1a83a28ee0..72bbc757503b 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js @@ -3,6 +3,7 @@ const formWidgetsPage = require("../../../../locators/FormWidgets.json"); const dsl = require("../../../../fixtures/newFormDsl.json"); const publishPage = require("../../../../locators/publishWidgetspage.json"); const pages = require("../../../../locators/Pages.json"); +const dayjs = require("dayjs"); describe("DatePicker Widget Functionality", function() { before(() => { @@ -34,7 +35,7 @@ describe("DatePicker Widget Functionality", function() { * @param2 --> user date formate */ cy.setDate(1, "ddd MMM DD YYYY"); - const nextDay = Cypress.moment() + const nextDay = dayjs() .add(1, "days") .format("DD/MM/YYYY"); cy.log(nextDay); @@ -51,7 +52,7 @@ describe("DatePicker Widget Functionality", function() { }); it("Datepicker-Clear date validation", function() { - const today = Cypress.moment() + const today = dayjs() .add(0, "days") .format("DD/MM/YYYY"); cy.get(formWidgetsPage.defaultDate).click(); diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 80237961cfa7..03c86ac6029f 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -3,6 +3,7 @@ /* eslint-disable cypress/no-assigning-return-values */ require("cypress-file-upload"); +const dayjs = require("dayjs"); const loginPage = require("../locators/LoginPage.json"); const homePage = require("../locators/HomePage.json"); @@ -2427,14 +2428,14 @@ Cypress.Commands.add("readTabledata", (rowNum, colNum) => { }); Cypress.Commands.add("getDate", (date, dateFormate) => { - const eDate = Cypress.moment() + const eDate = dayjs() .add(date, "days") .format(dateFormate); return eDate; }); Cypress.Commands.add("setDate", (date, dateFormate) => { - const expDate = Cypress.moment() + const expDate = dayjs() .add(date, "days") .format(dateFormate); const sel = `.DayPicker-Day[aria-label=\"${expDate}\"]`; diff --git a/app/client/package.json b/app/client/package.json index 21dd4bc8df5f..37dc418dbc75 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -61,6 +61,7 @@ "core-js": "^3.9.1", "craco-alias": "^2.1.1", "cypress-log-to-output": "^1.1.2", + "dayjs": "^1.10.6", "deep-diff": "^1.0.2", "downloadjs": "^1.4.7", "draft-js": "^0.11.7", @@ -228,7 +229,7 @@ "babel-plugin-styled-components": "^1.10.7", "cra-bundle-analyzer": "^0.1.0", "craco-babel-loader": "^0.1.4", - "cypress": "6.2.1", + "cypress": "7.6.0", "cypress-file-upload": "^4.1.1", "cypress-multi-reporters": "^1.2.4", "cypress-xpath": "^1.4.0",