Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions app/client/cypress/fixtures/formWithInputdsl.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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 });
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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);
Expand All @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions app/client/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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}\"]`;
Expand Down
3 changes: 2 additions & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down