diff --git a/app/client/cypress/fixtures/JsonBDTdsl.json b/app/client/cypress/fixtures/JsonBDTdsl.json new file mode 100644 index 0000000000..9558ff0ca6 --- /dev/null +++ b/app/client/cypress/fixtures/JsonBDTdsl.json @@ -0,0 +1,1400 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 4896, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1320, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 59, + "minHeight": 1292, + "dynamicTriggerPathList": [], + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "boxShadow": "none", + "widgetName": "UpdateModal", + "isCanvas": true, + "displayName": "Modal", + "iconSVG": "/static/media/icon.4975978e.svg", + "topRow": 51, + "bottomRow": 75, + "parentRowSpace": 10, + "type": "MODAL_WIDGET", + "hideCard": false, + "shouldScrollContents": true, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "leftColumn": 20, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + } + ], + "children": [ + { + "boxShadow": "none", + "widgetName": "Canvas1Copy", + "displayName": "Canvas", + "topRow": 0, + "bottomRow": 620, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "hideCard": true, + "shouldScrollContents": false, + "minHeight": 628, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + { + "schema": { + "__root_schema__": { + "children": { + "title": { + "children": {}, + "dataType": "string", + "defaultValue": "{{((sourceData, formData, fieldState) => (Table1.selectedRow.details.title))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Text Input", + "sourceData": "heyy", + "isCustomField": false, + "accessor": "title", + "identifier": "title", + "position": 0, + "originalIdentifier": "title", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Title", + "iconName": "array-string", + "labelStyle": "BOLD" + }, + "info": { + "children": { + "published": { + "children": {}, + "dataType": "boolean", + "defaultValue": "{{((sourceData, formData, fieldState) => (Table1.selectedRow.details.info.published))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Switch", + "sourceData": true, + "isCustomField": false, + "accessor": "published", + "identifier": "published", + "position": 0, + "originalIdentifier": "published", + "accentColor": "{{((sourceData, formData, fieldState) => (appsmith.theme.colors.primaryColor))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "boxShadow": "none", + "alignWidget": "LEFT", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Published", + "labelStyle": "BOLD" + }, + "publishedDate": { + "children": {}, + "dataType": "string", + "defaultValue": "{{((sourceData, formData, fieldState) => (moment(Table1.selectedRow.details.info.publishedDate, \"YYYY-MM-DD\").format(\"YYYY-MM-DDTHH:mm:ss.sssZ\")))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Datepicker", + "sourceData": "2022-07-12", + "isCustomField": false, + "accessor": "publishedDate", + "identifier": "publishedDate", + "position": 1, + "originalIdentifier": "publishedDate", + "accentColor": "{{((sourceData, formData, fieldState) => (appsmith.theme.colors.primaryColor))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "boxShadow": "none", + "closeOnSelection": true, + "convertToISO": false, + "dateFormat": "YYYY-MM-DD", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "label": "Published Date", + "maxDate": "2121-12-31T18:29:00.000Z", + "minDate": "1920-12-31T18:30:00.000Z", + "shortcuts": false, + "timePrecision": "minute", + "labelTextSize": "0.875rem", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "published": true, + "publishedDate": "2022-07-12" + }, + "isCustomField": false, + "accessor": "info", + "identifier": "info", + "position": 1, + "originalIdentifier": "info", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Info", + "backgroundColor": "#a5b4fc", + "borderColor": "transparent", + "cellBackgroundColor": "transparent", + "labelStyle": "BOLD" + }, + "genres": { + "children": {}, + "dataType": "array", + "defaultValue": "{{((sourceData, formData, fieldState) => (Table1.selectedRow.details.genres))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Multiselect", + "sourceData": [ + "Self-Help", + "Thriller" + ], + "isCustomField": false, + "accessor": "genres", + "identifier": "genres", + "position": 2, + "originalIdentifier": "genres", + "accentColor": "{{((sourceData, formData, fieldState) => (appsmith.theme.colors.primaryColor))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "boxShadow": "none", + "isDisabled": false, + "isFilterable": false, + "isRequired": false, + "isVisible": true, + "label": "Genres", + "labelTextSize": "0.875rem", + "serverSideFiltering": false, + "options": "{{getEnum.data[0].enum_range.map(item=> {return { label: item, value: item}})}}", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "info": { + "published": true, + "publishedDate": "2022-07-12" + }, + "title": "heyy", + "genres": [ + "Self-Help", + "Thriller" + ] + }, + "isCustomField": false, + "accessor": "__root_schema__", + "identifier": "__root_schema__", + "position": -1, + "originalIdentifier": "__root_schema__", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "boxShadow": "none", + "cellBorderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "" + } + }, + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "widgetName": "UpdateJSONForm", + "submitButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "PRIMARY" + }, + "dynamicPropertyPathList": [ + { + "key": "schema.__root_schema__.children.date_of_birth.defaultValue" + }, + { + "key": "onSubmit" + }, + { + "key": "schema.__root_schema__.children.info.children.published.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.defaultValue" + } + ], + "displayName": "JSON Form", + "iconSVG": "/static/media/icon.5b428de12db9ad6a591955ead07f86e9.svg", + "onSubmit": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};\nselectRecords.run()})}}", + "topRow": 8, + "bottomRow": 60, + "fieldLimitExceeded": false, + "parentRowSpace": 10, + "title": "", + "type": "JSON_FORM_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 6.875, + "dynamicTriggerPathList": [ + { + "key": "onSubmit" + } + ], + "leftColumn": 3, + "dynamicBindingPathList": [ + { + "key": "sourceData" + }, + { + "key": "schema.__root_schema__.children.genres.borderRadius" + }, + { + "key": "schema.__root_schema__.children.genres.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.cellBorderRadius" + }, + { + "key": "schema.__root_schema__.children.info.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.children.published.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.published.defaultValue" + }, + { + "key": "schema.__root_schema__.children.title.borderRadius" + }, + { + "key": "schema.__root_schema__.children.title.accentColor" + }, + { + "key": "schema.__root_schema__.children.title.defaultValue" + }, + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + }, + { + "key": "submitButtonStyles.buttonColor" + }, + { + "key": "submitButtonStyles.borderRadius" + }, + { + "key": "resetButtonStyles.buttonColor" + }, + { + "key": "resetButtonStyles.borderRadius" + }, + { + "key": "schema.__root_schema__.children.genres.options" + }, + { + "key": "schema.__root_schema__.children.genres.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.defaultValue" + }, + { + "key": "schema.__root_schema__.defaultValue" + }, + { + "key": "schema.__root_schema__.borderRadius" + }, + { + "key": "schema.__root_schema__.cellBorderRadius" + } + ], + "sourceData": "{{Table1.selectedRow.details}}", + "showReset": true, + "resetButtonLabel": "Reset", + "key": "nvfef1wd3c", + "backgroundColor": "#fca5a5", + "isDeprecated": false, + "rightColumn": 62, + "autoGenerateForm": true, + "widgetId": "82o4idxj2m", + "resetButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "SECONDARY" + }, + "isVisible": true, + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "scrollContents": true, + "fixedFooter": true, + "submitButtonLabel": "Update", + "childStylesheet": { + "ARRAY": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "OBJECT": { + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "CHECKBOX": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + "CURRENCY_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "DATEPICKER": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "EMAIL_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTISELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTILINE_TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PASSWORD_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PHONE_NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "RADIO_GROUP": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "SELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "SWITCH": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "disabledWhenInvalid": true, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + { + "boxShadow": "none", + "widgetName": "IconButton1Copy", + "onClick": "{{closeModal('UpdateModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 1, + "bottomRow": 5, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 56, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "iconSize": 24, + "isDisabled": false, + "key": "glch1esz5b", + "isDeprecated": false, + "rightColumn": 64, + "iconName": "cross", + "widgetId": "4fnws5ftg4", + "isVisible": true, + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "TERTIARY" + }, + { + "widgetName": "Text1Copy", + "displayName": "Text", + "iconSVG": "/static/media/icon.97c59b52.svg", + "topRow": 1, + "bottomRow": 5, + "type": "TEXT_WIDGET", + "hideCard": false, + "animateLoading": true, + "overflow": "NONE", + "fontFamily": "{{appsmith.theme.fontFamily.appFont}}", + "dynamicTriggerPathList": [], + "leftColumn": 1, + "dynamicBindingPathList": [ + { + "key": "text" + }, + { + "key": "fontFamily" + } + ], + "shouldTruncate": false, + "truncateButtonColor": "#FFC13D", + "text": "Update Data for SerialId # {{Table1.selectedRow.serialid}}", + "key": "orwoe8agwc", + "isDeprecated": false, + "rightColumn": 55, + "textAlign": "LEFT", + "widgetId": "3rncsabmka", + "isVisible": true, + "fontStyle": "BOLD", + "textColor": "#231F20", + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "fontSize": "1.5rem" + } + ], + "isDisabled": false, + "key": "jcn9nfbcoh", + "isDeprecated": false, + "rightColumn": 401.25, + "detachFromLayout": true, + "widgetId": "sdc2iv8uiq", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisible": true, + "version": 1, + "parentId": "bl75l6vmtq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + } + ], + "key": "n6csxgy8za", + "height": 628, + "isDeprecated": false, + "rightColumn": 44, + "detachFromLayout": true, + "widgetId": "bl75l6vmtq", + "canOutsideClickClose": true, + "canEscapeKeyClose": true, + "version": 2, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "width": 460 + }, + { + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "isVisibleDownload": true, + "iconSVG": "/static/media/icon.db8a9cbd.svg", + "topRow": 7, + "isSortable": true, + "type": "TABLE_WIDGET", + "animateLoading": true, + "dynamicBindingPathList": [ + { + "key": "tableData" + }, + { + "key": "primaryColumns.details.computedValue" + }, + { + "key": "primaryColumns.serialid.computedValue" + }, + { + "key": "primaryColumns.customColumn1.boxShadow" + }, + { + "key": "primaryColumns.customColumn1.borderRadius" + }, + { + "key": "primaryColumns.customColumn1.buttonColor" + }, + { + "key": "primaryColumns.customColumn1.buttonLabel" + }, + { + "key": "accentColor" + }, + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + } + ], + "leftColumn": 4, + "delimiter": ",", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisibleFilters": true, + "isVisible": true, + "enableClientSideSearch": true, + "version": 3, + "totalRecordsCount": 0, + "isLoading": false, + "childStylesheet": { + "button": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "menuButton": { + "menuColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "iconButton": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "primaryColumnId": "serialid", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75, + "serialid": 78, + "bigintid": 309, + "demimalid": 378, + "decimalid": 259, + "numericid": 270, + "info": 448, + "id": 60, + "details": 679 + }, + "widgetName": "Table1", + "defaultPageSize": 0, + "columnOrder": [ + "serialid", + "details", + "customColumn1" + ], + "dynamicPropertyPathList": [], + "displayName": "Table", + "bottomRow": 57, + "parentRowSpace": 10, + "defaultSelectedRow": "0", + "hideCard": false, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "primaryColumns.customColumn1.onClick" + } + ], + "primaryColumns": { + "customColumn1": { + "index": 4, + "width": 150, + "id": "customColumn1", + "columnType": "button", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": true, + "label": "delete", + "computedValue": "", + "buttonStyle": "rgb(3, 179, 101)", + "labelColor": "#FFFFFF", + "buttonColor": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.colors.primaryColor))}}", + "borderRadius": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.borderRadius.appBorderRadius))}}", + "boxShadow": "{{Table1.sanitizedTableData.map((currentRow) => ( 'none'))}}", + "iconName": "", + "buttonLabel": "{{Table1.sanitizedTableData.map((currentRow) => ( 'DeleteQuery'))}}", + "onClick": "{{deleteRecord.run(() => selectRecords.run(), () => {})}}" + }, + "serialid": { + "index": 0, + "width": 150, + "id": "serialid", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "", + "textSize": "0.875rem", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "serialid", + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.serialid))}}", + "cellBackground": "" + }, + "details": { + "index": 1, + "width": 150, + "id": "details", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "", + "textSize": "0.875rem", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "details", + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.details))}}", + "cellBackground": "" + } + }, + "key": "8l8hit8gra", + "derivedColumns": { + "customColumn1": { + "index": 4, + "width": 150, + "id": "customColumn1", + "columnType": "button", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": true, + "label": "delete", + "computedValue": "", + "buttonStyle": "rgb(3, 179, 101)", + "labelColor": "#FFFFFF", + "buttonColor": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.colors.primaryColor))}}", + "borderRadius": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.borderRadius.appBorderRadius))}}", + "boxShadow": "{{Table1.sanitizedTableData.map((currentRow) => ( 'none'))}}", + "iconName": "", + "buttonLabel": "{{Table1.sanitizedTableData.map((currentRow) => ( 'DeleteQuery'))}}" + } + }, + "isDeprecated": false, + "rightColumn": 60, + "textSize": "0.875rem", + "widgetId": "w9mvbp1g2t", + "tableData": "{{selectRecords.data}}", + "label": "Data", + "searchKey": "", + "parentId": "0", + "renderMode": "CANVAS", + "horizontalAlignment": "LEFT", + "isVisibleSearch": true, + "isVisiblePagination": true, + "verticalAlignment": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "InsertButton", + "onClick": "{{showModal('InsertModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "dynamicPropertyPathList": [ + { + "key": "onClick" + } + ], + "displayName": "Button", + "iconSVG": "/static/media/icon.cca02633.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 4, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Run InsertQuery", + "isDisabled": false, + "key": "7va5q4amde", + "isDeprecated": false, + "rightColumn": 20, + "isDefaultClickDisabled": true, + "widgetId": "jr1y6sdur4", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "UpdateButton", + "onClick": "{{showModal('UpdateModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "dynamicPropertyPathList": [], + "displayName": "Button", + "iconSVG": "/static/media/icon.cca02633.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 44, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Run UpdateQuery", + "isDisabled": false, + "key": "7va5q4amde", + "isDeprecated": false, + "rightColumn": 60, + "isDefaultClickDisabled": true, + "widgetId": "3k4fg1zx8x", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "InsertModal", + "isCanvas": true, + "displayName": "Modal", + "iconSVG": "/static/media/icon.4975978e.svg", + "topRow": 22, + "bottomRow": 46, + "parentRowSpace": 10, + "type": "MODAL_WIDGET", + "hideCard": false, + "shouldScrollContents": true, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "leftColumn": 20, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + } + ], + "children": [ + { + "boxShadow": "none", + "widgetName": "Canvas1", + "displayName": "Canvas", + "topRow": 0, + "bottomRow": 600, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "hideCard": true, + "shouldScrollContents": false, + "minHeight": 600, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "leftColumn": 0, + "dynamicBindingPathList": [], + "children": [ + { + "boxShadow": "none", + "widgetName": "IconButton1", + "onClick": "{{closeModal('InsertModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 1, + "bottomRow": 5, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "leftColumn": 56, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "iconSize": 24, + "isDisabled": false, + "key": "glch1esz5b", + "isDeprecated": false, + "rightColumn": 64, + "iconName": "cross", + "widgetId": "jqcrr1o8or", + "isVisible": true, + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "TERTIARY" + }, + { + "widgetName": "Text1", + "displayName": "Text", + "iconSVG": "/static/media/icon.97c59b52.svg", + "topRow": 1, + "bottomRow": 5, + "type": "TEXT_WIDGET", + "hideCard": false, + "animateLoading": true, + "overflow": "NONE", + "fontFamily": "{{appsmith.theme.fontFamily.appFont}}", + "dynamicTriggerPathList": [], + "leftColumn": 1, + "dynamicBindingPathList": [ + { + "key": "fontFamily" + } + ], + "shouldTruncate": false, + "truncateButtonColor": "#FFC13D", + "text": "Insert Record", + "key": "orwoe8agwc", + "isDeprecated": false, + "rightColumn": 41, + "textAlign": "LEFT", + "widgetId": "achn17gfze", + "isVisible": true, + "fontStyle": "BOLD", + "textColor": "#231F20", + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "fontSize": "1.5rem" + }, + { + "schema": { + "__root_schema__": { + "children": { + "title": { + "children": {}, + "dataType": "string", + "defaultValue": "", + "fieldType": "Text Input", + "sourceData": "ssss", + "isCustomField": false, + "accessor": "title", + "identifier": "title", + "position": 0, + "originalIdentifier": "title", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Title", + "iconName": "array-string", + "labelStyle": "BOLD", + "placeholderText": "{{((sourceData, formData, fieldState) => (sourceData.title))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}" + }, + "info": { + "children": { + "published": { + "children": {}, + "dataType": "boolean", + "defaultValue": false, + "fieldType": "Switch", + "sourceData": true, + "isCustomField": false, + "accessor": "published", + "identifier": "published", + "position": 0, + "originalIdentifier": "published", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none", + "alignWidget": "LEFT", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Published", + "labelStyle": "BOLD" + }, + "publishedDate": { + "children": {}, + "dataType": "string", + "defaultValue": "", + "fieldType": "Datepicker", + "sourceData": "2022-08-01", + "isCustomField": false, + "accessor": "publishedDate", + "identifier": "publishedDate", + "position": 1, + "originalIdentifier": "publishedDate", + "accentColor": "{{((sourceData, formData, fieldState) => (appsmith.theme.colors.primaryColor))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "boxShadow": "none", + "closeOnSelection": true, + "convertToISO": false, + "dateFormat": "YYYY-MM-DD", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "label": "Published Date", + "maxDate": "2121-12-31T18:29:00.000Z", + "minDate": "1920-12-31T18:30:00.000Z", + "shortcuts": false, + "timePrecision": "minute", + "labelTextSize": "0.875rem", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "published": true, + "publishedDate": "2022-08-01" + }, + "isCustomField": false, + "accessor": "info", + "identifier": "info", + "position": 1, + "originalIdentifier": "info", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Info", + "backgroundColor": "#fef08a", + "borderColor": "transparent", + "cellBackgroundColor": "transparent", + "labelStyle": "BOLD" + }, + "genres": { + "children": {}, + "dataType": "array", + "defaultValue": "", + "fieldType": "Multiselect", + "sourceData": [ + "Self-Help" + ], + "isCustomField": false, + "accessor": "genres", + "identifier": "genres", + "position": 2, + "originalIdentifier": "genres", + "accentColor": "{{((sourceData, formData, fieldState) => (appsmith.theme.colors.primaryColor))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "boxShadow": "none", + "isDisabled": false, + "isFilterable": false, + "isRequired": false, + "isVisible": true, + "label": "Genres", + "labelTextSize": "0.875rem", + "serverSideFiltering": false, + "options": "{{getEnum.data[0].enum_range.map(item=> {return { label: item, value: item}})}}", + "placeholderText": "{{((sourceData, formData, fieldState) => (`Select Genres`))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "info": { + "published": true, + "publishedDate": "2022-08-01" + }, + "title": "ssss", + "genres": [ + "Self-Help" + ] + }, + "isCustomField": false, + "accessor": "__root_schema__", + "identifier": "__root_schema__", + "position": -1, + "originalIdentifier": "__root_schema__", + "borderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "boxShadow": "none", + "cellBorderRadius": "{{((sourceData, formData, fieldState) => (appsmith.theme.borderRadius.appBorderRadius))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "" + } + }, + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "widgetName": "InsertJSONForm", + "submitButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "PRIMARY" + }, + "dynamicPropertyPathList": [ + { + "key": "schema.__root_schema__.children.date_of_birth.defaultValue" + }, + { + "key": "onSubmit" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.defaultValue" + } + ], + "displayName": "JSON Form", + "iconSVG": "/static/media/icon.5b428de12db9ad6a591955ead07f86e9.svg", + "onSubmit": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal('InsertModal'), () => {};})}}", + "topRow": 6, + "bottomRow": 58, + "fieldLimitExceeded": false, + "parentRowSpace": 10, + "title": "", + "type": "JSON_FORM_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 6.875, + "dynamicTriggerPathList": [ + { + "key": "onSubmit" + } + ], + "leftColumn": 3, + "dynamicBindingPathList": [ + { + "key": "sourceData" + }, + { + "key": "schema.__root_schema__.children.genres.borderRadius" + }, + { + "key": "schema.__root_schema__.children.genres.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.cellBorderRadius" + }, + { + "key": "schema.__root_schema__.children.info.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.publishedDate.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.published.accentColor" + }, + { + "key": "schema.__root_schema__.children.title.borderRadius" + }, + { + "key": "schema.__root_schema__.children.title.accentColor" + }, + { + "key": "schema.__root_schema__.children.title.placeholderText" + }, + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + }, + { + "key": "submitButtonStyles.buttonColor" + }, + { + "key": "submitButtonStyles.borderRadius" + }, + { + "key": "resetButtonStyles.buttonColor" + }, + { + "key": "resetButtonStyles.borderRadius" + }, + { + "key": "schema.__root_schema__.children.genres.options" + }, + { + "key": "schema.__root_schema__.children.genres.placeholderText" + } + ], + "sourceData": "{{Table1.selectedRow.details}}", + "showReset": true, + "resetButtonLabel": "Reset", + "key": "nvfef1wd3c", + "backgroundColor": "#fca5a5", + "isDeprecated": false, + "rightColumn": 62, + "autoGenerateForm": true, + "widgetId": "lr122o9x8m", + "resetButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "SECONDARY" + }, + "isVisible": true, + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "scrollContents": true, + "fixedFooter": true, + "submitButtonLabel": "Insert", + "childStylesheet": { + "ARRAY": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "OBJECT": { + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "CHECKBOX": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + "CURRENCY_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "DATEPICKER": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "EMAIL_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTISELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTILINE_TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PASSWORD_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PHONE_NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "RADIO_GROUP": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "SELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "SWITCH": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "disabledWhenInvalid": true, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + } + ], + "isDisabled": false, + "key": "jcn9nfbcoh", + "isDeprecated": false, + "rightColumn": 401.25, + "detachFromLayout": true, + "widgetId": "6otxv391ns", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisible": true, + "version": 1, + "parentId": "rhom101hjk", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + } + ], + "key": "n6csxgy8za", + "height": 600, + "isDeprecated": false, + "rightColumn": 44, + "detachFromLayout": true, + "widgetId": "rhom101hjk", + "canOutsideClickClose": true, + "canEscapeKeyClose": true, + "version": 2, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "width": 452 + }, + { + "boxShadow": "none", + "widgetName": "IconButton2", + "onClick": "{{deleteAllRecords.run(() => selectRecords.run(), () => {})}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 30, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "isDisabled": false, + "key": "8he4nv2fbs", + "isDeprecated": false, + "rightColumn": 34, + "iconName": "delete", + "widgetId": "30jhk2thdb", + "isVisible": true, + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY" + } + ] + } +} diff --git a/app/client/cypress/fixtures/JsonDTdsl.json b/app/client/cypress/fixtures/JsonDTdsl.json new file mode 100644 index 0000000000..6b07d2a76d --- /dev/null +++ b/app/client/cypress/fixtures/JsonDTdsl.json @@ -0,0 +1,1699 @@ +{ + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 4896, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1320, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 59, + "minHeight": 1292, + "dynamicTriggerPathList": [], + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "boxShadow": "none", + "widgetName": "UpdateModal", + "isCanvas": true, + "displayName": "Modal", + "iconSVG": "/static/media/icon.4975978e.svg", + "topRow": 51, + "bottomRow": 75, + "parentRowSpace": 10, + "type": "MODAL_WIDGET", + "hideCard": false, + "shouldScrollContents": true, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "leftColumn": 20, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + } + ], + "children": [ + { + "boxShadow": "none", + "widgetName": "Canvas1Copy", + "displayName": "Canvas", + "topRow": 0, + "bottomRow": 620, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "hideCard": true, + "shouldScrollContents": false, + "minHeight": 628, + "parentColumnSpace": 1, + "leftColumn": 0, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + }, + { + "key": "accentColor" + } + ], + "children": [ + { + "schema": { + "__root_schema__": { + "children": { + "customer": { + "children": {}, + "dataType": "string", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.customer))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Text Input", + "sourceData": "Josh William", + "isCustomField": false, + "accessor": "customer", + "identifier": "customer", + "position": 0, + "originalIdentifier": "customer", + "accentColor": "#ffc13d", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": true, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Customer", + "iconName": "person", + "labelStyle": "BOLD" + }, + "title": { + "children": {}, + "dataType": "string", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.title))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Text Input", + "sourceData": "Ivanhoe", + "isCustomField": false, + "accessor": "title", + "identifier": "title", + "position": 1, + "originalIdentifier": "title", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Title", + "iconName": "annotation", + "labelStyle": "BOLD" + }, + "type": { + "children": {}, + "dataType": "array", + "defaultValue": "{{((sourceData, formData, fieldState) => (Table1.selectedRow.details.type.map(item=> {return { label: item, value: item }})))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Multiselect", + "sourceData": [ + "Novel", + "Adventure" + ], + "isCustomField": false, + "accessor": "type", + "identifier": "type", + "position": 2, + "originalIdentifier": "type", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "isDisabled": false, + "isFilterable": false, + "isRequired": false, + "isVisible": true, + "label": "Type", + "labelTextSize": "0.875rem", + "serverSideFiltering": false, + "options": "{{[\"Novel\", \"Adventure\", \"Programming\", \"Computer\"].map(item=> {return {\n label: item,\n value: item\n }})}}", + "labelStyle": "BOLD" + }, + "info": { + "children": { + "published": { + "children": {}, + "dataType": "boolean", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info.published))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Switch", + "sourceData": true, + "isCustomField": false, + "accessor": "published", + "identifier": "published", + "position": 0, + "originalIdentifier": "published", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none", + "alignWidget": "LEFT", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Published", + "labelStyle": "BOLD" + }, + "price": { + "children": {}, + "dataType": "number", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info.price))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Number Input", + "sourceData": 400, + "isCustomField": false, + "accessor": "price", + "identifier": "price", + "position": 1, + "originalIdentifier": "price", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Price", + "labelStyle": "BOLD", + "minNum": "100", + "maxNum": "1000", + "errorMessage": "{{((sourceData, formData, fieldState) => (`Out of range!`))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "published": true, + "price": 400 + }, + "isCustomField": false, + "accessor": "info", + "identifier": "info", + "position": 3, + "originalIdentifier": "info", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Info", + "backgroundColor": "#fef08a", + "borderColor": "transparent", + "cellBackgroundColor": "transparent", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(UpdateJSONForm.sourceData, UpdateJSONForm.formData, UpdateJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "customer": "Josh William", + "title": "Ivanhoe", + "type": [ + "Novel", + "Adventure" + ], + "info": { + "published": true, + "price": 400 + } + }, + "isCustomField": false, + "accessor": "__root_schema__", + "identifier": "__root_schema__", + "position": -1, + "originalIdentifier": "__root_schema__", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "" + } + }, + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "widgetName": "UpdateJSONForm", + "submitButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "PRIMARY" + }, + "dynamicPropertyPathList": [ + { + "key": "schema.__root_schema__.children.date_of_birth.defaultValue" + }, + { + "key": "onSubmit" + }, + { + "key": "schema.__root_schema__.children.info.children.published.defaultValue" + } + ], + "displayName": "JSON Form", + "iconSVG": "/static/media/icon.5b428de12db9ad6a591955ead07f86e9.svg", + "onSubmit": "{{updateRecord.run(() => {closeModal('UpdateModal'), () => {};\nselectRecords.run()})}}", + "topRow": 8, + "bottomRow": 60, + "fieldLimitExceeded": false, + "parentRowSpace": 10, + "title": "", + "type": "JSON_FORM_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 6.875, + "dynamicTriggerPathList": [ + { + "key": "onSubmit" + } + ], + "leftColumn": 3, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + }, + { + "key": "submitButtonStyles.buttonColor" + }, + { + "key": "submitButtonStyles.borderRadius" + }, + { + "key": "resetButtonStyles.buttonColor" + }, + { + "key": "resetButtonStyles.borderRadius" + }, + { + "key": "childStylesheet.ARRAY.accentColor" + }, + { + "key": "childStylesheet.ARRAY.borderRadius" + }, + { + "key": "childStylesheet.ARRAY.cellBorderRadius" + }, + { + "key": "childStylesheet.OBJECT.borderRadius" + }, + { + "key": "childStylesheet.OBJECT.cellBorderRadius" + }, + { + "key": "childStylesheet.CHECKBOX.accentColor" + }, + { + "key": "childStylesheet.CHECKBOX.borderRadius" + }, + { + "key": "childStylesheet.CURRENCY_INPUT.accentColor" + }, + { + "key": "childStylesheet.CURRENCY_INPUT.borderRadius" + }, + { + "key": "childStylesheet.DATEPICKER.accentColor" + }, + { + "key": "childStylesheet.DATEPICKER.borderRadius" + }, + { + "key": "childStylesheet.EMAIL_INPUT.accentColor" + }, + { + "key": "childStylesheet.EMAIL_INPUT.borderRadius" + }, + { + "key": "childStylesheet.MULTISELECT.accentColor" + }, + { + "key": "childStylesheet.MULTISELECT.borderRadius" + }, + { + "key": "childStylesheet.MULTILINE_TEXT_INPUT.accentColor" + }, + { + "key": "childStylesheet.MULTILINE_TEXT_INPUT.borderRadius" + }, + { + "key": "childStylesheet.NUMBER_INPUT.accentColor" + }, + { + "key": "childStylesheet.NUMBER_INPUT.borderRadius" + }, + { + "key": "childStylesheet.PASSWORD_INPUT.accentColor" + }, + { + "key": "childStylesheet.PASSWORD_INPUT.borderRadius" + }, + { + "key": "childStylesheet.PHONE_NUMBER_INPUT.accentColor" + }, + { + "key": "childStylesheet.PHONE_NUMBER_INPUT.borderRadius" + }, + { + "key": "childStylesheet.RADIO_GROUP.accentColor" + }, + { + "key": "childStylesheet.SELECT.accentColor" + }, + { + "key": "childStylesheet.SELECT.borderRadius" + }, + { + "key": "childStylesheet.SWITCH.accentColor" + }, + { + "key": "childStylesheet.TEXT_INPUT.accentColor" + }, + { + "key": "childStylesheet.TEXT_INPUT.borderRadius" + }, + { + "key": "schema.__root_schema__.defaultValue" + }, + { + "key": "schema.__root_schema__.borderRadius" + }, + { + "key": "schema.__root_schema__.cellBorderRadius" + }, + { + "key": "sourceData" + }, + { + "key": "schema.__root_schema__.children.customer.defaultValue" + }, + { + "key": "schema.__root_schema__.children.customer.borderRadius" + }, + { + "key": "schema.__root_schema__.children.title.defaultValue" + }, + { + "key": "schema.__root_schema__.children.title.accentColor" + }, + { + "key": "schema.__root_schema__.children.title.borderRadius" + }, + { + "key": "schema.__root_schema__.children.type.defaultValue" + }, + { + "key": "schema.__root_schema__.children.type.accentColor" + }, + { + "key": "schema.__root_schema__.children.type.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.published.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.price.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.children.price.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.price.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.cellBorderRadius" + }, + { + "key": "schema.__root_schema__.children.type.options" + }, + { + "key": "schema.__root_schema__.children.info.children.published.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.children.price.errorMessage" + } + ], + "sourceData": "{{Table1.selectedRow.details}}", + "showReset": true, + "resetButtonLabel": "Reset", + "key": "nvfef1wd3c", + "backgroundColor": "#fca5a5", + "isDeprecated": false, + "rightColumn": 62, + "autoGenerateForm": true, + "widgetId": "82o4idxj2m", + "resetButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "SECONDARY" + }, + "isVisible": true, + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "scrollContents": true, + "fixedFooter": true, + "submitButtonLabel": "Update", + "childStylesheet": { + "ARRAY": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "OBJECT": { + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "CHECKBOX": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + "CURRENCY_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "DATEPICKER": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "EMAIL_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTISELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTILINE_TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PASSWORD_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PHONE_NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "RADIO_GROUP": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "SELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "SWITCH": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "disabledWhenInvalid": true, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + { + "boxShadow": "none", + "widgetName": "IconButton1Copy", + "onClick": "{{closeModal('UpdateModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 1, + "bottomRow": 5, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "leftColumn": 56, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "iconSize": 24, + "isDisabled": false, + "key": "glch1esz5b", + "isDeprecated": false, + "rightColumn": 64, + "iconName": "cross", + "widgetId": "4fnws5ftg4", + "isVisible": true, + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "TERTIARY", + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ] + }, + { + "widgetName": "Text1Copy", + "displayName": "Text", + "iconSVG": "/static/media/icon.97c59b52.svg", + "topRow": 1, + "bottomRow": 5, + "type": "TEXT_WIDGET", + "hideCard": false, + "animateLoading": true, + "overflow": "NONE", + "fontFamily": "{{appsmith.theme.fontFamily.appFont}}", + "dynamicTriggerPathList": [], + "leftColumn": 1, + "dynamicBindingPathList": [ + { + "key": "fontFamily" + }, + { + "key": "borderRadius" + }, + { + "key": "text" + } + ], + "shouldTruncate": false, + "truncateButtonColor": "#FFC13D", + "text": "Update Data for SerialId # {{Table1.selectedRow.serialid}}", + "key": "orwoe8agwc", + "isDeprecated": false, + "rightColumn": 55, + "textAlign": "LEFT", + "widgetId": "3rncsabmka", + "isVisible": true, + "fontStyle": "BOLD", + "textColor": "#231F20", + "version": 1, + "parentId": "sdc2iv8uiq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "fontSize": "1.5rem" + } + ], + "isDisabled": false, + "key": "jcn9nfbcoh", + "isDeprecated": false, + "rightColumn": 401.25, + "detachFromLayout": true, + "widgetId": "sdc2iv8uiq", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisible": true, + "version": 1, + "parentId": "bl75l6vmtq", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "dynamicTriggerPathList": [] + } + ], + "key": "n6csxgy8za", + "height": 628, + "isDeprecated": false, + "rightColumn": 44, + "detachFromLayout": true, + "widgetId": "bl75l6vmtq", + "canOutsideClickClose": true, + "canEscapeKeyClose": true, + "version": 2, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "width": 460 + }, + { + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "isVisibleDownload": true, + "iconSVG": "/static/media/icon.db8a9cbd.svg", + "topRow": 7, + "isSortable": true, + "type": "TABLE_WIDGET", + "animateLoading": true, + "dynamicBindingPathList": [ + { + "key": "accentColor" + }, + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + }, + { + "key": "childStylesheet.button.buttonColor" + }, + { + "key": "childStylesheet.button.borderRadius" + }, + { + "key": "childStylesheet.menuButton.menuColor" + }, + { + "key": "childStylesheet.menuButton.borderRadius" + }, + { + "key": "childStylesheet.iconButton.buttonColor" + }, + { + "key": "childStylesheet.iconButton.borderRadius" + }, + { + "key": "tableData" + }, + { + "key": "derivedColumns.customColumn1.buttonColor" + }, + { + "key": "primaryColumns.customColumn1.buttonColor" + }, + { + "key": "derivedColumns.customColumn1.borderRadius" + }, + { + "key": "primaryColumns.customColumn1.borderRadius" + }, + { + "key": "derivedColumns.customColumn1.boxShadow" + }, + { + "key": "primaryColumns.customColumn1.boxShadow" + }, + { + "key": "derivedColumns.customColumn1.buttonLabel" + }, + { + "key": "primaryColumns.customColumn1.buttonLabel" + }, + { + "key": "primaryColumns.serialid.computedValue" + }, + { + "key": "primaryColumns.details.computedValue" + } + ], + "leftColumn": 4, + "delimiter": ",", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisibleFilters": true, + "isVisible": true, + "enableClientSideSearch": true, + "version": 3, + "totalRecordsCount": 0, + "isLoading": false, + "childStylesheet": { + "button": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "menuButton": { + "menuColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "iconButton": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "primaryColumnId": "serialid", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75, + "serialid": 78, + "bigintid": 309, + "demimalid": 378, + "decimalid": 259, + "numericid": 270, + "info": 448, + "id": 60, + "details": 679 + }, + "widgetName": "Table1", + "defaultPageSize": 0, + "columnOrder": [ + "serialid", + "details", + "customColumn1" + ], + "dynamicPropertyPathList": [], + "displayName": "Table", + "bottomRow": 57, + "parentRowSpace": 10, + "defaultSelectedRow": "0", + "hideCard": false, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "primaryColumns.customColumn1.onClick" + } + ], + "primaryColumns": { + "customColumn1": { + "index": 4, + "width": 150, + "id": "customColumn1", + "columnType": "button", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": true, + "label": "delete", + "computedValue": "", + "buttonStyle": "rgb(3, 179, 101)", + "labelColor": "#FFFFFF", + "buttonColor": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.colors.primaryColor))}}", + "borderRadius": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.borderRadius.appBorderRadius))}}", + "boxShadow": "{{Table1.sanitizedTableData.map((currentRow) => ( 'none'))}}", + "iconName": "", + "buttonLabel": "{{Table1.sanitizedTableData.map((currentRow) => ( 'DeleteQuery'))}}", + "onClick": "{{deleteRecord.run(() => selectRecords.run(), () => {})}}" + }, + "serialid": { + "index": 0, + "width": 150, + "id": "serialid", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "", + "textSize": "0.875rem", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "serialid", + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.serialid))}}", + "cellBackground": "" + }, + "details": { + "index": 1, + "width": 150, + "id": "details", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textColor": "", + "textSize": "0.875rem", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "details", + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.details))}}", + "cellBackground": "" + } + }, + "key": "8l8hit8gra", + "derivedColumns": { + "customColumn1": { + "index": 4, + "width": 150, + "id": "customColumn1", + "columnType": "button", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": true, + "label": "delete", + "computedValue": "", + "buttonStyle": "rgb(3, 179, 101)", + "labelColor": "#FFFFFF", + "buttonColor": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.colors.primaryColor))}}", + "borderRadius": "{{Table1.sanitizedTableData.map((currentRow) => ( appsmith.theme.borderRadius.appBorderRadius))}}", + "boxShadow": "{{Table1.sanitizedTableData.map((currentRow) => ( 'none'))}}", + "iconName": "", + "buttonLabel": "{{Table1.sanitizedTableData.map((currentRow) => ( 'DeleteQuery'))}}" + } + }, + "isDeprecated": false, + "rightColumn": 60, + "textSize": "0.875rem", + "widgetId": "w9mvbp1g2t", + "tableData": "{{selectRecords.data}}", + "label": "Data", + "searchKey": "", + "parentId": "0", + "renderMode": "CANVAS", + "horizontalAlignment": "LEFT", + "isVisibleSearch": true, + "isVisiblePagination": true, + "verticalAlignment": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "InsertButton", + "onClick": "{{showModal('InsertModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "dynamicPropertyPathList": [ + { + "key": "onClick" + } + ], + "displayName": "Button", + "iconSVG": "/static/media/icon.cca02633.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 4, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Run InsertQuery", + "isDisabled": false, + "key": "7va5q4amde", + "isDeprecated": false, + "rightColumn": 20, + "isDefaultClickDisabled": true, + "widgetId": "jr1y6sdur4", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "UpdateButton", + "onClick": "{{showModal('UpdateModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "dynamicPropertyPathList": [], + "displayName": "Button", + "iconSVG": "/static/media/icon.cca02633.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 44, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "text": "Run UpdateQuery", + "isDisabled": false, + "key": "7va5q4amde", + "isDeprecated": false, + "rightColumn": 60, + "isDefaultClickDisabled": true, + "widgetId": "3k4fg1zx8x", + "isVisible": true, + "recaptchaType": "V3", + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY", + "placement": "CENTER" + }, + { + "boxShadow": "none", + "widgetName": "InsertModal", + "isCanvas": true, + "displayName": "Modal", + "iconSVG": "/static/media/icon.4975978e.svg", + "topRow": 22, + "bottomRow": 46, + "parentRowSpace": 10, + "type": "MODAL_WIDGET", + "hideCard": false, + "shouldScrollContents": true, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "leftColumn": 20, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + } + ], + "children": [ + { + "boxShadow": "none", + "widgetName": "Canvas1", + "displayName": "Canvas", + "topRow": 0, + "bottomRow": 600, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "hideCard": true, + "shouldScrollContents": false, + "minHeight": 600, + "parentColumnSpace": 1, + "dynamicTriggerPathList": [], + "leftColumn": 0, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + }, + { + "key": "accentColor" + } + ], + "children": [ + { + "boxShadow": "none", + "widgetName": "IconButton1", + "onClick": "{{closeModal('InsertModal')}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 1, + "bottomRow": 5, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "leftColumn": 56, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "iconSize": 24, + "isDisabled": false, + "key": "glch1esz5b", + "isDeprecated": false, + "rightColumn": 64, + "iconName": "cross", + "widgetId": "jqcrr1o8or", + "isVisible": true, + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "TERTIARY" + }, + { + "widgetName": "Text1", + "displayName": "Text", + "iconSVG": "/static/media/icon.97c59b52.svg", + "topRow": 1, + "bottomRow": 5, + "type": "TEXT_WIDGET", + "hideCard": false, + "animateLoading": true, + "overflow": "NONE", + "fontFamily": "{{appsmith.theme.fontFamily.appFont}}", + "dynamicTriggerPathList": [], + "leftColumn": 1, + "dynamicBindingPathList": [ + { + "key": "fontFamily" + }, + { + "key": "borderRadius" + } + ], + "shouldTruncate": false, + "truncateButtonColor": "#FFC13D", + "text": "Insert Record", + "key": "orwoe8agwc", + "isDeprecated": false, + "rightColumn": 41, + "textAlign": "LEFT", + "widgetId": "achn17gfze", + "isVisible": true, + "fontStyle": "BOLD", + "textColor": "#231F20", + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "fontSize": "1.5rem" + }, + { + "schema": { + "__root_schema__": { + "children": { + "customer": { + "children": {}, + "dataType": "string", + "defaultValue": "", + "fieldType": "Text Input", + "sourceData": "Josh William", + "isCustomField": false, + "accessor": "customer", + "identifier": "customer", + "position": 0, + "originalIdentifier": "customer", + "accentColor": "#ffc13d", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": true, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Customer", + "iconName": "person", + "labelStyle": "BOLD", + "placeholderText": "{{((sourceData, formData, fieldState) => (sourceData.customer))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}" + }, + "title": { + "children": {}, + "dataType": "string", + "defaultValue": "", + "fieldType": "Text Input", + "sourceData": "Ivanhoe", + "isCustomField": false, + "accessor": "title", + "identifier": "title", + "position": 1, + "originalIdentifier": "title", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Title", + "iconName": "annotation", + "labelStyle": "BOLD", + "placeholderText": "{{((sourceData, formData, fieldState) => (sourceData.title))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}" + }, + "type": { + "children": {}, + "dataType": "array", + "defaultValue": "", + "fieldType": "Multiselect", + "sourceData": [ + "Novel", + "Adventure" + ], + "isCustomField": false, + "accessor": "type", + "identifier": "type", + "position": 2, + "originalIdentifier": "type", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "isDisabled": false, + "isFilterable": false, + "isRequired": false, + "isVisible": true, + "label": "Type", + "labelTextSize": "0.875rem", + "serverSideFiltering": false, + "options": "{{[\"Novel\", \"Adventure\", \"Programming\", \"Computer\"].map(item=> {return {\n label: item,\n value: item\n }})}}", + "labelStyle": "BOLD", + "placeholderText": "{{((sourceData, formData, fieldState) => (`Select Book type`))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "allowSelectAll": false + }, + "info": { + "children": { + "published": { + "children": {}, + "dataType": "boolean", + "defaultValue": false, + "fieldType": "Switch", + "sourceData": true, + "isCustomField": false, + "accessor": "published", + "identifier": "published", + "position": 0, + "originalIdentifier": "published", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none", + "alignWidget": "LEFT", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Published", + "labelStyle": "BOLD" + }, + "price": { + "children": {}, + "dataType": "number", + "defaultValue": "", + "fieldType": "Number Input", + "sourceData": 400, + "isCustomField": false, + "accessor": "price", + "identifier": "price", + "position": 1, + "originalIdentifier": "price", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "iconAlign": "left", + "isDisabled": false, + "isRequired": false, + "isSpellCheck": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Price", + "labelStyle": "BOLD", + "minNum": "100", + "maxNum": "1000", + "placeholderText": "{{((sourceData, formData, fieldState) => (`100 - 1000`))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "errorMessage": "Out of range!" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.info))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "published": true, + "price": 400 + }, + "isCustomField": false, + "accessor": "info", + "identifier": "info", + "position": 3, + "originalIdentifier": "info", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "Info", + "backgroundColor": "#fef08a", + "borderColor": "transparent", + "cellBackgroundColor": "transparent", + "labelStyle": "BOLD" + } + }, + "dataType": "object", + "defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(InsertJSONForm.sourceData, InsertJSONForm.formData, InsertJSONForm.fieldState)}}", + "fieldType": "Object", + "sourceData": { + "customer": "Josh William", + "title": "Ivanhoe", + "type": [ + "Novel", + "Adventure" + ], + "info": { + "published": true, + "price": 400 + } + }, + "isCustomField": false, + "accessor": "__root_schema__", + "identifier": "__root_schema__", + "position": -1, + "originalIdentifier": "__root_schema__", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none", + "isDisabled": false, + "isRequired": false, + "isVisible": true, + "labelTextSize": "0.875rem", + "label": "" + } + }, + "boxShadow": "{{appsmith.theme.boxShadow.appBoxShadow}}", + "widgetName": "InsertJSONForm", + "submitButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "PRIMARY" + }, + "dynamicPropertyPathList": [ + { + "key": "schema.__root_schema__.children.date_of_birth.defaultValue" + }, + { + "key": "onSubmit" + } + ], + "displayName": "JSON Form", + "iconSVG": "/static/media/icon.5b428de12db9ad6a591955ead07f86e9.svg", + "onSubmit": "{{insertRecord.run(() => {\nselectRecords.run();\t\t\t\tresetWidget('InsertModal', true);\ncloseModal('InsertModal'), () => {};})}}", + "topRow": 6, + "bottomRow": 58, + "fieldLimitExceeded": false, + "parentRowSpace": 10, + "title": "", + "type": "JSON_FORM_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 6.875, + "dynamicTriggerPathList": [ + { + "key": "onSubmit" + } + ], + "leftColumn": 3, + "dynamicBindingPathList": [ + { + "key": "borderRadius" + }, + { + "key": "boxShadow" + }, + { + "key": "submitButtonStyles.buttonColor" + }, + { + "key": "submitButtonStyles.borderRadius" + }, + { + "key": "resetButtonStyles.buttonColor" + }, + { + "key": "resetButtonStyles.borderRadius" + }, + { + "key": "childStylesheet.ARRAY.accentColor" + }, + { + "key": "childStylesheet.ARRAY.borderRadius" + }, + { + "key": "childStylesheet.ARRAY.cellBorderRadius" + }, + { + "key": "childStylesheet.OBJECT.borderRadius" + }, + { + "key": "childStylesheet.OBJECT.cellBorderRadius" + }, + { + "key": "childStylesheet.CHECKBOX.accentColor" + }, + { + "key": "childStylesheet.CHECKBOX.borderRadius" + }, + { + "key": "childStylesheet.CURRENCY_INPUT.accentColor" + }, + { + "key": "childStylesheet.CURRENCY_INPUT.borderRadius" + }, + { + "key": "childStylesheet.DATEPICKER.accentColor" + }, + { + "key": "childStylesheet.DATEPICKER.borderRadius" + }, + { + "key": "childStylesheet.EMAIL_INPUT.accentColor" + }, + { + "key": "childStylesheet.EMAIL_INPUT.borderRadius" + }, + { + "key": "childStylesheet.MULTISELECT.accentColor" + }, + { + "key": "childStylesheet.MULTISELECT.borderRadius" + }, + { + "key": "childStylesheet.MULTILINE_TEXT_INPUT.accentColor" + }, + { + "key": "childStylesheet.MULTILINE_TEXT_INPUT.borderRadius" + }, + { + "key": "childStylesheet.NUMBER_INPUT.accentColor" + }, + { + "key": "childStylesheet.NUMBER_INPUT.borderRadius" + }, + { + "key": "childStylesheet.PASSWORD_INPUT.accentColor" + }, + { + "key": "childStylesheet.PASSWORD_INPUT.borderRadius" + }, + { + "key": "childStylesheet.PHONE_NUMBER_INPUT.accentColor" + }, + { + "key": "childStylesheet.PHONE_NUMBER_INPUT.borderRadius" + }, + { + "key": "childStylesheet.RADIO_GROUP.accentColor" + }, + { + "key": "childStylesheet.SELECT.accentColor" + }, + { + "key": "childStylesheet.SELECT.borderRadius" + }, + { + "key": "childStylesheet.SWITCH.accentColor" + }, + { + "key": "childStylesheet.TEXT_INPUT.accentColor" + }, + { + "key": "childStylesheet.TEXT_INPUT.borderRadius" + }, + { + "key": "schema.__root_schema__.defaultValue" + }, + { + "key": "schema.__root_schema__.borderRadius" + }, + { + "key": "schema.__root_schema__.cellBorderRadius" + }, + { + "key": "sourceData" + }, + { + "key": "schema.__root_schema__.children.customer.borderRadius" + }, + { + "key": "schema.__root_schema__.children.title.accentColor" + }, + { + "key": "schema.__root_schema__.children.title.borderRadius" + }, + { + "key": "schema.__root_schema__.children.type.accentColor" + }, + { + "key": "schema.__root_schema__.children.type.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.children.published.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.price.accentColor" + }, + { + "key": "schema.__root_schema__.children.info.children.price.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.defaultValue" + }, + { + "key": "schema.__root_schema__.children.info.borderRadius" + }, + { + "key": "schema.__root_schema__.children.info.cellBorderRadius" + }, + { + "key": "schema.__root_schema__.children.customer.placeholderText" + }, + { + "key": "schema.__root_schema__.children.title.placeholderText" + }, + { + "key": "schema.__root_schema__.children.type.options" + }, + { + "key": "schema.__root_schema__.children.type.placeholderText" + }, + { + "key": "schema.__root_schema__.children.info.children.price.placeholderText" + } + ], + "sourceData": "{{Table1.selectedRow.details}}", + "showReset": true, + "resetButtonLabel": "Reset", + "key": "nvfef1wd3c", + "backgroundColor": "#fca5a5", + "isDeprecated": false, + "rightColumn": 62, + "autoGenerateForm": true, + "widgetId": "lr122o9x8m", + "resetButtonStyles": { + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "buttonVariant": "SECONDARY" + }, + "isVisible": true, + "version": 1, + "parentId": "6otxv391ns", + "renderMode": "CANVAS", + "isLoading": false, + "scrollContents": true, + "fixedFooter": true, + "submitButtonLabel": "Insert", + "childStylesheet": { + "ARRAY": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "OBJECT": { + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none", + "cellBorderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "cellBoxShadow": "none" + }, + "CHECKBOX": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + }, + "CURRENCY_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "DATEPICKER": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "EMAIL_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTISELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "MULTILINE_TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PASSWORD_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "PHONE_NUMBER_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "RADIO_GROUP": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "SELECT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + }, + "SWITCH": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "boxShadow": "none" + }, + "TEXT_INPUT": { + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "boxShadow": "none" + } + }, + "disabledWhenInvalid": true, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + } + ], + "isDisabled": false, + "key": "jcn9nfbcoh", + "isDeprecated": false, + "rightColumn": 401.25, + "detachFromLayout": true, + "widgetId": "6otxv391ns", + "accentColor": "{{appsmith.theme.colors.primaryColor}}", + "isVisible": true, + "version": 1, + "parentId": "rhom101hjk", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}" + } + ], + "key": "n6csxgy8za", + "height": 600, + "isDeprecated": false, + "rightColumn": 44, + "detachFromLayout": true, + "widgetId": "rhom101hjk", + "canOutsideClickClose": true, + "canEscapeKeyClose": true, + "version": 2, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "width": 452 + }, + { + "boxShadow": "none", + "widgetName": "IconButton2", + "onClick": "{{deleteAllRecords.run(() => selectRecords.run(), () => {})}}", + "buttonColor": "{{appsmith.theme.colors.primaryColor}}", + "displayName": "Icon Button", + "iconSVG": "/static/media/icon.1a0c634a.svg", + "topRow": 2, + "bottomRow": 6, + "parentRowSpace": 10, + "type": "ICON_BUTTON_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 16.71875, + "dynamicTriggerPathList": [ + { + "key": "onClick" + } + ], + "leftColumn": 30, + "dynamicBindingPathList": [ + { + "key": "buttonColor" + }, + { + "key": "borderRadius" + } + ], + "isDisabled": false, + "key": "8he4nv2fbs", + "isDeprecated": false, + "rightColumn": 34, + "iconName": "delete", + "widgetId": "30jhk2thdb", + "isVisible": true, + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "borderRadius": "{{appsmith.theme.borderRadius.appBorderRadius}}", + "buttonVariant": "PRIMARY" + } + ] + } +} diff --git a/app/client/cypress/fixtures/datasources.json b/app/client/cypress/fixtures/datasources.json index 80569437fb..e5bf016a86 100644 --- a/app/client/cypress/fixtures/datasources.json +++ b/app/client/cypress/fixtures/datasources.json @@ -38,8 +38,6 @@ "database-url": "appsmith-f9fe4.firebaseio.com", "projectID": "appsmith-f9fe4", "serviceAccCredentials": "testdata", - "access_key": "AKIATTSPRCT3ZEMEPSMC", - "secret_key": "DTFRFG15G7Xyn8IIHDW9cKXMg+TuA7DIC74oC0L9", "mockHostAddress":"fake-api.cvuydmurdlas.us-east-1.rds.amazonaws.com", "mockDatabaseName": "fakeapi", "mockDatabaseUsername": "fakeapi", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/BugTests/Bug14299_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/BugTests/Bug14299_Spec.ts index e3155cae5f..6220978d54 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/BugTests/Bug14299_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/BugTests/Bug14299_Spec.ts @@ -40,7 +40,7 @@ describe("[Bug]: The data from the query does not show up on the widget #14299", dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("getAstronauts"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); jsEditor.CreateJSObject( `export default { runAstros: () => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js index 8e379eb3a8..0d4f73c23a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js @@ -130,8 +130,8 @@ describe("Git import flow", function() { cy.xpath("//input[@value='Success']").should("be.visible"); }); - // commenting these test until issue with git status call is fixed - /*it("Create a new branch, clone page and validate data on that branch in deploy and edit mode", () => { + // Skipping these test until issue with git status call is fixed + it.skip("Create a new branch, clone page and validate data on that branch in deploy and edit mode", () => { cy.createGitBranch(newBranch); cy.get(".tbody") .first() @@ -199,7 +199,7 @@ describe("Git import flow", function() { cy.get(commonlocators.backToEditor).click(); cy.wait(2000); }); - it("Switch to master and verify data in edit and deploy mode", () => { + it.skip("Switch to master and verify data in edit and deploy mode", () => { cy.switchGitBranch("master"); cy.wait(2000); // validate data binding in edit and deploy mode @@ -221,7 +221,7 @@ describe("Git import flow", function() { cy.get(commonlocators.backToEditor).click(); cy.wait(2000); }); - it("Add widget to master, merge then checkout to child branch and verify data", () => { + it.skip("Add widget to master, merge then checkout to child branch and verify data", () => { cy.get(explorer.widgetSwitchId).click(); cy.wait(2000); // wait for transition cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 600 }); @@ -237,6 +237,6 @@ describe("Git import flow", function() { }); after(() => { - cy.deleteTestGithubRepo(repoName); - }); */ + //cy.deleteTestGithubRepo(repoName); + }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js index 2cef7dddec..b1fc419663 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js @@ -1,6 +1,9 @@ const omnibar = require("../../../../locators/Omnibar.json"); const dsl = require("../../../../fixtures/omnibarDsl.json"); const commonlocators = require("../../../../locators/commonlocators.json"); +import { ObjectsRegistry } from "../../../../support/Objects/Registry"; + +let agHelper = ObjectsRegistry.AggregateHelper; describe("Omnibar functionality test cases", () => { const apiName = "Omnibar1"; @@ -102,7 +105,10 @@ describe("Omnibar functionality test cases", () => { cy.wait(1000); cy.wait("@createNewJSCollection"); cy.wait(1000); - cy.get(".t--js-action-name-edit-field").type(jsObjectName); + cy.get(".t--js-action-name-edit-field") + .type(jsObjectName) + .wait(1000); + agHelper.WaitUntilToastDisappear("created successfully"); cy.get(omnibar.globalSearch).click({ force: true }); cy.get(omnibar.categoryTitle) .eq(1) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js index 660aa20bfa..6cb76528e6 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ThemingTests/Theme_MultiSelectWidget_spec.js @@ -1,11 +1,5 @@ const commonlocators = require("../../../../locators/commonlocators.json"); -const dsl = require("../../../../fixtures/ThemeAppdsl.json"); -const widgetsPage = require("../../../../locators/Widgets.json"); -const testdata = require("../../../../fixtures/testdata.json"); -const apiwidget = require("../../../../locators/apiWidgetslocator.json"); const explorer = require("../../../../locators/explorerlocators.json"); -const formWidgetsPage = require("../../../../locators/FormWidgets.json"); -const publish = require("../../../../locators/publishWidgetspage.json"); const themelocator = require("../../../../locators/ThemeLocators.json"); let themeBackgroudColor; @@ -13,13 +7,15 @@ let themeFont; let themeColour; describe("Theme validation usecase for multi-select widget", function() { - it("Drag and drop multi-select widget and validate Default font and list of font validation", function() { + it("Drag and drop multi-select widget and validate Default font and list of font validation + Bug 15007", function() { cy.log("Login Successful"); cy.reload(); // To remove the rename tooltip cy.get(explorer.addWidget).click(); cy.get(commonlocators.entityExplorersearch).should("be.visible"); cy.get(commonlocators.entityExplorersearch) .clear() + .wait(200) + .click() .type("multiselect"); cy.dragAndDropToCanvas("multiselectwidgetv2", { x: 300, y: 80 }); cy.wait("@updateLayout").should( @@ -45,7 +41,7 @@ describe("Theme validation usecase for multi-select widget", function() { "response.body.responseMeta.status", 200, ); - cy.wait(5000); + cy.wait(3000); cy.contains("Border").click({ force: true }); //Shadow validation @@ -97,25 +93,32 @@ describe("Theme validation usecase for multi-select widget", function() { .text(); }); }); - cy.contains("Font").click({ force: true }); + //cy.contains("Font").click({ force: true }); //Color cy.wait(3000); - cy.get(themelocator.inputColor).clear(); - cy.get(themelocator.inputColor).type("purple"); + cy.get(themelocator.inputColor) + .clear() + .wait(200) + .click() + .type("purple"); cy.get(themelocator.inputColor).should("have.value", "purple"); cy.get(themelocator.color) .eq(1) .click({ force: true }); - cy.get(themelocator.inputColor).clear(); cy.wait(2000); - cy.get(themelocator.inputColor).type("brown"); + cy.get(themelocator.inputColor) + .clear() + .wait(200) + .click() + .type("brown"); cy.get(themelocator.inputColor).should("have.value", "brown"); cy.wait(2000); cy.contains("Color").click({ force: true }); }); - it("Publish the App and validate Font across the app", function() { + it.skip("Publish the App and validate Font across the app + Bug 15007", function() { + //Skipping due to mentioned bug cy.PublishtheApp(); cy.get(".rc-select-selection-item > .rc-select-selection-item-content") .first() @@ -133,10 +136,10 @@ describe("Theme validation usecase for multi-select widget", function() { "font-family", themeFont, ); + cy.goToEditFromPublish(); }); it("Validate Default Theme change across application", function() { - cy.goToEditFromPublish(); cy.get("#canvas-selection-0").click({ force: true }); //Change the Theme cy.get(commonlocators.changeThemeBtn).click({ force: true }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/BooleanEnum_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/BooleanEnum_Spec.ts index 6a016407bb..0fc31c77de 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/BooleanEnum_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/BooleanEnum_Spec.ts @@ -39,14 +39,14 @@ describe("Postgres - Datatype Boolean & Enum types tests", function() { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("createEnum"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); query = `create table boolenumtypes (serialId SERIAL not null primary key, workingDay weekdays, AreWeWorking boolean)`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("createTable"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); //ee.ExpandCollapseEntity(dsName); //Clicking Create Query from Active DS is already expanding ds @@ -70,43 +70,43 @@ describe("Postgres - Datatype Boolean & Enum types tests", function() { ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("insertRecord"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `UPDATE public."boolenumtypes" SET "workingday" = {{Updateworkingday.selectedOptionValue}}, "areweworking" = {{Updateareweworking.isSwitchedOn}} WHERE serialid = {{Table1.selectedRow.serialid}};`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("updateRecord"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `SELECT * from enum_range(NULL::weekdays)`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("getEnum"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `DELETE FROM public."boolenumtypes" WHERE serialId ={{Table1.selectedRow.serialid}}`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("deleteRecord"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `DELETE FROM public."boolenumtypes"`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("deleteAllRecords"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `drop table public."boolenumtypes"`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("dropTable"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); query = `drop type weekdays`; ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("dropEnum"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); ee.ExpandCollapseEntity("QUERIES/JS", false); ee.ExpandCollapseEntity(dsName, false); @@ -197,7 +197,7 @@ describe("Postgres - Datatype Boolean & Enum types tests", function() { ee.CreateNewDsQuery(dsName); agHelper.RenameWithInPane("verifyEnumOrdering"); agHelper.GetNClick(dataSources._templateMenu); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); dataSources.ReadQueryTableResponse(1).then(($cellData) => { expect($cellData).to.eq("Saturday"); @@ -207,7 +207,7 @@ describe("Postgres - Datatype Boolean & Enum types tests", function() { }); query = `SELECT * FROM boolenumtypes WHERE workingday = (SELECT MIN(workingday) FROM boolenumtypes);`; - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); dataSources.ReadQueryTableResponse(1).then(($cellData) => { expect($cellData).to.eq("Monday"); @@ -301,6 +301,6 @@ describe("Postgres - Datatype Boolean & Enum types tests", function() { deployMode.DeployApp(); deployMode.NavigateBacktoEditor(); ee.ExpandCollapseEntity("QUERIES/JS"); - dataSources.DeleteDatasouceFromWinthinDS(dsName, 200); //ProductLines, Employees pages are still using this ds + dataSources.DeleteDatasouceFromWinthinDS(dsName, 200); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Character_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Character_Spec.ts index 5cafd94852..8c55c56248 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Character_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Character_Spec.ts @@ -14,7 +14,7 @@ describe("Postgres - Datatype Character tests", function() { cy.fixture("CharacterDTdsl").then((val: any) => { agHelper.AddDsl(val); }); - propPane.ChangeTheme("Modern"); + propPane.ChangeTheme("Pacific"); }); it("1. Create Postgress DS", function() { @@ -38,9 +38,10 @@ describe("Postgres - Datatype Character tests", function() { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("createTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); cy.get(".CodeMirror textarea").focus(); dataSources.RunQuery(); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementVisible(ee._entityNameInExplorer("public.chartypes")); @@ -54,7 +55,7 @@ describe("Postgres - Datatype Character tests", function() { agHelper .GetText(dataSources._noRecordFound) .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("4. Creating INSERT query - chartypes", () => { @@ -62,7 +63,7 @@ describe("Postgres - Datatype Character tests", function() { VALUES ({{Insertone.text}}, {{Insertasmany.text}}, {{Insertlimited.text}}::varchar(4), {{Insertunlimited.text}});`; ee.ActionTemplateMenuByEntityName("public.chartypes", "INSERT"); agHelper.RenameWithInPane("insertRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("5. Creating UPDATE query - chartypes", () => { @@ -74,7 +75,7 @@ describe("Postgres - Datatype Character tests", function() { WHERE serialid = {{Table1.selectedRow.serialid}};`; ee.ActionTemplateMenuByEntityName("public.chartypes", "UPDATE"); agHelper.RenameWithInPane("updateRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("5. Creating DELETE query with condition - chartypes", () => { @@ -82,21 +83,21 @@ describe("Postgres - Datatype Character tests", function() { WHERE serialId = {{Table1.selectedRow.serialid}};`; ee.ActionTemplateMenuByEntityName("public.chartypes", "DELETE"); agHelper.RenameWithInPane("deleteRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("6. Creating DELETE query for complete table empty - chartypes", () => { query = `DELETE FROM public."chartypes"`; ee.ActionTemplateMenuByEntityName("public.chartypes", "DELETE"); agHelper.RenameWithInPane("deleteAllRecords"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("7. Creating DROP table query - chartypes", () => { query = `drop table public."chartypes"`; ee.ActionTemplateMenuByEntityName("public.chartypes", "DELETE"); agHelper.RenameWithInPane("dropTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); ee.ExpandCollapseEntity("QUERIES/JS", false); ee.ExpandCollapseEntity(dsName, false); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/DateTime_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/DateTime_Spec.ts index c87fab1ff6..360a86199f 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/DateTime_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/DateTime_Spec.ts @@ -41,9 +41,10 @@ describe("Postgres - Datatype DateTime tests", function() { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("createTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); cy.get(".CodeMirror textarea").focus(); dataSources.RunQuery(); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementVisible( @@ -64,7 +65,7 @@ describe("Postgres - Datatype DateTime tests", function() { agHelper .GetText(dataSources._noRecordFound) .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("4. Creating INSERT query - datetimetypes", () => { @@ -72,7 +73,7 @@ describe("Postgres - Datatype DateTime tests", function() { VALUES('{{Insertts.text}}', '{{Inserttstz.text}}', '{{Insertdater.text}}', '{{Inserttimer.text}}', '{{Insertintervaler.text}}');`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "INSERT"); agHelper.RenameWithInPane("insertRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.ToggleUsePreparedStatement(false); }); @@ -82,7 +83,7 @@ describe("Postgres - Datatype DateTime tests", function() { "intervaler" = '{{Updateintervaler.text}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "UPDATE"); agHelper.RenameWithInPane("updateRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.ToggleUsePreparedStatement(false); }); @@ -91,21 +92,21 @@ describe("Postgres - Datatype DateTime tests", function() { WHERE serialId = {{Table1.selectedRow.serialid}};`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "DELETE"); agHelper.RenameWithInPane("deleteRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("7. Creating DELETE query for complete table empty - datetimetypes", () => { query = `DELETE FROM public."datetimetypes"`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "DELETE"); agHelper.RenameWithInPane("deleteAllRecords"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("8. Creating DROP table query - datetimetypes", () => { query = `drop table public."datetimetypes"`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "DELETE"); agHelper.RenameWithInPane("dropTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("9. Validating interval methods", () => { @@ -116,7 +117,7 @@ describe("Postgres - Datatype DateTime tests", function() { EXTRACT (MINUTE FROM INTERVAL '5 hours 21 minutes');`; ee.ActionTemplateMenuByEntityName("public.datetimetypes", "SELECT"); agHelper.RenameWithInPane("intervalRecords"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); dataSources.ReadQueryTableResponse(0).then(($cellData) => { expect($cellData).to.eq( diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Json_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Json_Spec.ts new file mode 100644 index 0000000000..59a0aff7c9 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Json_Spec.ts @@ -0,0 +1,721 @@ +import { ObjectsRegistry } from "../../../../support/Objects/Registry"; + +let guid: any, dsName: any, query: string; +const agHelper = ObjectsRegistry.AggregateHelper, + ee = ObjectsRegistry.EntityExplorer, + dataSources = ObjectsRegistry.DataSources, + propPane = ObjectsRegistry.PropertyPane, + table = ObjectsRegistry.Table, + locator = ObjectsRegistry.CommonLocators, + deployMode = ObjectsRegistry.DeployMode; + +describe("Postgres - Datatype Json & JsonB types tests", function() { + before(() => { + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + dataSources.NavigateToDSCreateNew(); + dataSources.CreatePlugIn("PostgreSQL"); + guid = uid; + agHelper.RenameWithInPane("Postgres " + guid, false); + dataSources.FillPostgresDSForm(); + dataSources.TestSaveDatasource(); + cy.wrap("Postgres " + guid).as("dsName"); + }); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); + }); + + //#region Json Datatype + + it("0. Importing App & setting theme", () => { + cy.fixture("JsonDTdsl").then((val: any) => { + agHelper.AddDsl(val); + }); + ee.NavigateToSwitcher("widgets"); + propPane.ChangeColor(33, "Primary"); + propPane.ChangeColor(39, "Background"); + }); + + it("1. Creating table query - jsonbooks", () => { + query = `CREATE TABLE jsonbooks(serialId SERIAL PRIMARY KEY, details JSON)`; + dataSources.NavigateFromActiveDS(dsName, true); + agHelper.GetNClick(dataSources._templateMenu); + agHelper.RenameWithInPane("createTable"); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + + ee.ActionContextMenuByEntityName(dsName, "Refresh"); + agHelper.AssertElementVisible(ee._entityNameInExplorer("public.jsonbooks")); + }); + + it("2. Creating SELECT query - jsonbooks + Bug 14493", () => { + ee.ActionTemplateMenuByEntityName("public.jsonbooks", "SELECT"); + agHelper.RenameWithInPane("selectRecords"); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); + }); + + it("3. Creating all queries - jsonbooks", () => { + query = `INSERT INTO jsonbooks(details) VALUES('{"customer": "{{InsertJSONForm.formData.customer}}", "title": "{{InsertJSONForm.formData.title}}", "type": {{InsertJSONForm.formData.type}}, "info": {"published": {{InsertJSONForm.formData.info.published}}, "price": {{InsertJSONForm.formData.info.price}}}}');`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("insertRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.ToggleUsePreparedStatement(false); + + query = `UPDATE public."jsonbooks" SET "details" = '{"customer": "{{UpdateJSONForm.formData.customer}}", "title": "{{UpdateJSONForm.formData.title}}", "type": {{UpdateJSONForm.formData.type}}, "info": {"published": {{UpdateJSONForm.formData.info.published}}, "price": {{UpdateJSONForm.formData.info.price}}}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("updateRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.ToggleUsePreparedStatement(false); + + query = `DELETE FROM public."jsonbooks" WHERE serialId ={{Table1.selectedRow.serialid}}`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("deleteRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `DELETE FROM public."jsonbooks"`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("deleteAllRecords"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `drop table public."jsonbooks"`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("dropTable"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + ee.ExpandCollapseEntity("QUERIES/JS", false); + ee.ExpandCollapseEntity(dsName, false); + }); + + it("4. Inserting record - jsonbooks", () => { + ee.SelectEntityByName("Page1"); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Customer", "Lily Bush"); + deployMode.EnterJSONInputValue("Title", "PostgreSQL for Beginners"); + deployMode.SelectJsonFormMultiSelect("Type", ["Programming", "Computer"]); + agHelper.ToggleSwitch("Published", "check", true); + deployMode.EnterJSONInputValue("Price", "150"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(0, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("5. Inserting another record - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Customer", "Josh William"); + deployMode.EnterJSONInputValue("Title", "Ivanhoe"); + deployMode.SelectJsonFormMultiSelect("Type", ["Adventure", "Novel"]); + agHelper.ToggleSwitch("Published", "check", true); + deployMode.EnterJSONInputValue("Price", "400"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("6. Inserting another record - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Customer", "Mary Clark"); + deployMode.EnterJSONInputValue("Title", "The Pragmatic Programmer"); + deployMode.SelectJsonFormMultiSelect("Type", ["Programming"], 0, true); + agHelper.ToggleSwitch("Published", "uncheck", true); + deployMode.EnterJSONInputValue("Price", "360"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(2, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("7. Updating record - jsonbooks", () => { + table.SelectTableRow(1); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Title", " Bill"); //Adding Bill to name + agHelper.ToggleSwitch("Published", "uncheck", true); + deployMode.ClearJSONFieldValue("Price"); + deployMode.EnterJSONInputValue("Price", "660"); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Update did not fail + agHelper.AssertElementVisible(locator._spanButton("Run UpdateQuery")); + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("3"); + }); + table.ReadTableRowColumnData(2, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //Since recently updated column to pushed to last! + }); + table.ReadTableRowColumnData(2, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("8. Validating JSON functions", () => { + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + ee.ExpandCollapseEntity("QUERIES/JS"); + dataSources.NavigateFromActiveDS(dsName, true); + agHelper.RenameWithInPane("verifyJsonFunctions"); + + //Verifying -> - returns results in json format + query = `SELECT details -> 'title' AS "BookTitle" FROM jsonbooks;`; + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["BookTitle"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("PostgreSQL for Beginners"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("The Pragmatic Programmer"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("Ivanhoe Bill"); + }); + + //Verifying ->> - returns result in text format + query = `SELECT details -> 'info' ->> 'price' AS "BookPrice" FROM jsonbooks;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["BookPrice"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("150"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("360"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("660"); + }); + + //Verifying 'CAST' with 'WHERE' clause + query = `SELECT details -> 'customer' AS "P+ Customer", details -> 'info' ->> 'price' as "Book Price" FROM jsonbooks where CAST (details -> 'info' ->> 'price' as INTEGER) > 360;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["P+ Customer", "Book Price"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("Josh William"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("660"); + }); + + //Verifying Aggregate functions + query = `SELECT MIN (CAST (details -> 'info' ->> 'price' as INTEGER)), MAX (CAST (details -> 'info' ->> 'price' as INTEGER)), SUM (CAST (details -> 'info' ->> 'price' as INTEGER)), AVG (CAST (details -> 'info' ->> 'price' as INTEGER)), count(*) FROM jsonbooks;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "min", + "max", + "sum", + "avg", + "count", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("150"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("660"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("1170"); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq("390"); + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).to.eq("3"); + }); + + agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("QUERIES/JS", false); + }); + + it("9. Deleting records - jsonbooks", () => { + ee.SelectEntityByName("Page1"); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + agHelper.ValidateNetworkStatus("@postExecute", 200); + agHelper.ValidateNetworkStatus("@postExecute", 200); + agHelper.Sleep(2500); //Allwowing time for delete to be success + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).not.to.eq("3"); //asserting 2nd record is deleted + }); + table.ReadTableRowColumnData(1, 0, 200).then(($cellData) => { + expect($cellData).to.eq("2"); + }); + }); + + it("10. Deleting all records from table - jsonbooks", () => { + agHelper.GetNClick(locator._deleteIcon); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); + }); + + it("11. Inserting another record (to check serial column) - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Customer", "Bob Sim"); + deployMode.EnterJSONInputValue("Title", "Treasure Island"); + deployMode.SelectJsonFormMultiSelect("Type", ["Novel"]); + agHelper.ToggleSwitch("Published", "uncheck", true); + + deployMode.EnterJSONInputValue("Price", "80"); + agHelper.AssertElementVisible(locator._visibleTextDiv("Out of range!")); + deployMode.ClearJSONFieldValue("Price"); + deployMode.EnterJSONInputValue("Price", "800"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(0, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("12. Validate Drop of the Newly Created - jsonbooks - Table from Postgres datasource", () => { + deployMode.NavigateBacktoEditor(); + ee.ExpandCollapseEntity("QUERIES/JS"); + ee.SelectEntityByName("dropTable"); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); //Success response for dropped table! + }); + ee.ExpandCollapseEntity("QUERIES/JS", false); + ee.ExpandCollapseEntity("DATASOURCES"); + ee.ExpandCollapseEntity(dsName); + ee.ActionContextMenuByEntityName(dsName, "Refresh"); + agHelper.AssertElementAbsence(ee._entityNameInExplorer("public.jsonbooks")); + ee.ExpandCollapseEntity(dsName, false); + ee.ExpandCollapseEntity("DATASOURCES", false); + }); + + it("13. Verify Deletion of all created queries", () => { + dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists + ee.ExpandCollapseEntity("QUERIES/JS"); + ee.ActionContextMenuByEntityName("createTable", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName( + "deleteAllRecords", + "Delete", + "Are you sure?", + ); + ee.ActionContextMenuByEntityName("deleteRecord", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("dropTable", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("insertRecord", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName( + "selectRecords", + "Delete", + "Are you sure?", + ); + ee.ActionContextMenuByEntityName("updateRecord", "Delete", "Are you sure?"); + }); + + //#endregion + + //#region JsonB Datatype + + it("14. Importing App & setting theme", () => { + cy.fixture("JsonBDTdsl").then((val: any) => { + agHelper.AddDsl(val); + }); + ee.NavigateToSwitcher("widgets"); + propPane.ChangeColor(12, "Primary"); + propPane.ChangeColor(23, "Background"); + }); + + it("15. Creating enum & table queries - jsonBbooks", () => { + query = `CREATE TYPE genres AS ENUM ('Fiction', 'Thriller', 'Horror', 'Marketing & Sales', 'Self-Help', 'Psychology', 'Law', 'Politics', 'Productivity', 'Reference', 'Spirituality');`; + dataSources.NavigateFromActiveDS(dsName, true); + agHelper.GetNClick(dataSources._templateMenu); + agHelper.RenameWithInPane("createEnum"); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + + query = `CREATE TABLE "jsonBbooks" (serialId SERIAL PRIMARY KEY, details JSONB)`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("createTable"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + + ee.ActionContextMenuByEntityName(dsName, "Refresh"); + agHelper.AssertElementVisible( + ee._entityNameInExplorer("public.jsonBbooks"), + ); + }); + + it("16. Creating SELECT query - jsonBbooks + Bug 14493", () => { + ee.ActionTemplateMenuByEntityName("public.jsonBbooks", "SELECT"); + agHelper.RenameWithInPane("selectRecords"); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); + }); + + it("17. Creating all queries - jsonBbooks", () => { + query = `INSERT INTO "jsonBbooks"(details) VALUES('{"title": "{{InsertJSONForm.formData.title}}", "genres": {{InsertJSONForm.formData.genres}}, "info": {"published": {{InsertJSONForm.formData.info.published}}, "publishedDate": "{{InsertJSONForm.formData.info.publishedDate}}"}}');`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("insertRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.ToggleUsePreparedStatement(false); + + query = `UPDATE public."jsonBbooks" SET "details" = '{"title": "{{UpdateJSONForm.formData.title}}", "genres": {{UpdateJSONForm.formData.genres}}, "info": {"published": {{UpdateJSONForm.formData.info.published}}, "publishedDate": "{{UpdateJSONForm.formData.info.publishedDate}}"}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("updateRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.ToggleUsePreparedStatement(false); + + query = `SELECT * from enum_range(NULL::genres)`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("getEnum"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `DELETE FROM public."jsonBbooks" WHERE serialId ={{Table1.selectedRow.serialid}}`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("deleteRecord"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `DELETE FROM public."jsonBbooks"`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("deleteAllRecords"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `drop table public."jsonBbooks"`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("dropTable"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + query = `drop type genres`; + ee.CreateNewDsQuery(dsName); + agHelper.RenameWithInPane("dropEnum"); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + + ee.ExpandCollapseEntity("QUERIES/JS", false); + ee.ExpandCollapseEntity(dsName, false); + }); + + it("18. Inserting record - jsonbooks", () => { + ee.SelectEntityByName("Page1"); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Title", "Sleeping Beauties"); + agHelper.ToggleSwitch("Published", "check", true); + agHelper.GetNClick( + deployMode._jsonFormDatepickerFieldByName("Published Date"), + ); + agHelper.GetNClick(locator._datePicker(5)); + deployMode.SelectJsonFormMultiSelect("Genres", [ + "Fiction", + "Thriller", + "Horror", + ]); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(0, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("19. Inserting another record - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Title", "Deep Work"); + agHelper.ToggleSwitch("Published", "check", true); + agHelper.GetNClick( + deployMode._jsonFormDatepickerFieldByName("Published Date"), + ); + agHelper.GetNClick(locator._datePicker(15)); + deployMode.SelectJsonFormMultiSelect("Genres", [ + "Productivity", + "Reference", + ]); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("20. Inserting another record - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Title", "Siddhartha"); + agHelper.ToggleSwitch("Published", "uncheck", true); + agHelper.GetNClick( + deployMode._jsonFormDatepickerFieldByName("Published Date"), + ); + agHelper.GetNClick(locator._datePicker(15)); + deployMode.SelectJsonFormMultiSelect("Genres", ["Fiction", "Spirituality"]); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(2, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("21. Updating record - jsonbooks", () => { + //table.SelectTableRow(0); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.ClearJSONFieldValue("Title"); + deployMode.EnterJSONInputValue("Title", "The Dictator''s Handbook"); //Adding Bill to name + agHelper.ToggleSwitch("Published", "uncheck", true); + agHelper.GetNClick( + deployMode._jsonFormDatepickerFieldByName("Published Date"), + ); + agHelper.GetNClick(locator._datePicker(25)); + deployMode.SelectJsonFormMultiSelect( + "Genres", + ["Fiction", "Thriller", "Horror"], + 0, + false, + ); + deployMode.SelectJsonFormMultiSelect("Genres", ["Law", "Politics"]); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence(locator._toastMsg); //Assert that Update did not fail + agHelper.AssertElementVisible(locator._spanButton("Run UpdateQuery")); + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("3"); + }); + table.ReadTableRowColumnData(2, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //Since recently updated column to pushed to last! + }); + table.ReadTableRowColumnData(2, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("22. Validating JSON functions", () => { + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + ee.ExpandCollapseEntity("QUERIES/JS"); + dataSources.NavigateFromActiveDS(dsName, true); + agHelper.RenameWithInPane("verifyJsonBFunctions"); + + //Verifying @> contains + query = `SELECT '["Fiction", "Thriller", "Horror"]'::jsonb @> '["Fiction", "Horror"]'::jsonb as "Result1", '["Fiction", "Horror"]'::jsonb @> '["Fiction", "Thriller", "Horror"]'::jsonb as "Result2", '{"name": "Alice", "agent": {"bot": true} }'::jsonb -> 'agent' ->> 'bot' is not null as "Filter"`; + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["Result1", "Result2", "Filter"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("true"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("false"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("true"); + }); + + //Verifying ->> - returns result in text format & checks contains + query = `SELECT details->'title' as "BookTitle", details -> 'info' ->> 'publishedDate' as "Published Date" FROM "jsonBbooks" WHERE details->'genres' @> '["Fiction"]'::jsonb;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["BookTitle", "Published Date"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("Siddhartha"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("2022-07-15"); + }); + + //Verifying Top Level key is present + query = `SELECT '{"book": {"title": "War and Peace"}}'::jsonb @> '{"book": {}}'::jsonb as "Top Level Key"; `; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["Top Level Key"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("true"); + }); + + //Verifying jsonb functions + query = `select jsonb_each( '{"name": "Alice", "agent": {"bot": true} }'::jsonb), jsonb_object_keys( '{"name": "Alice", "agent": {"bot": true} }'::jsonb), jsonb_extract_path( '{"name": "Alice", "agent": {"bot": true} }'::jsonb, 'agent', 'bot');`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["jsonb_each", "jsonb_object_keys", "jsonb_extract_path"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq('(name,"""Alice""")'); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("name"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("true"); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq('(agent,"{""bot"": true}")'); + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).to.eq("agent"); + }); + dataSources.ReadQueryTableResponse(5).then(($cellData) => { + expect($cellData).to.eq("true"); + }); + + agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("QUERIES/JS", false); + }); + + it("23. Deleting records - jsonbooks", () => { + ee.SelectEntityByName("Page1"); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + agHelper.ValidateNetworkStatus("@postExecute", 200); + agHelper.ValidateNetworkStatus("@postExecute", 200); + agHelper.Sleep(2500); //Allwowing time for delete to be success + table.ReadTableRowColumnData(1, 0, 2000).then(($cellData) => { + expect($cellData).not.to.eq("3"); //asserting 2nd record is deleted + }); + table.ReadTableRowColumnData(1, 0, 200).then(($cellData) => { + expect($cellData).to.eq("1"); + }); + }); + + it("24. Deleting all records from table - jsonbooks", () => { + agHelper.GetNClick(locator._deleteIcon); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); + }); + + it("25. Inserting another record (to check serial column) - jsonbooks", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisible(locator._modal); + + deployMode.EnterJSONInputValue("Title", "Influence"); + agHelper.ToggleSwitch("Published", "check", true); + agHelper.GetNClick( + deployMode._jsonFormDatepickerFieldByName("Published Date"), + ); + agHelper.GetNClick(locator._datePicker(16)); + deployMode.SelectJsonFormMultiSelect("Genres", ["Marketing & Sales", "Self-Help", "Psychology"]); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisible(locator._spanButton("Run InsertQuery")); + table.ReadTableRowColumnData(0, 0, 2000).then(($cellData) => { + expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); + }); + + it("26. Validate Drop of the Newly Created - jsonbooks - Table from Postgres datasource", () => { + deployMode.NavigateBacktoEditor(); + ee.ExpandCollapseEntity("QUERIES/JS"); + ee.SelectEntityByName("dropTable"); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); //Success response for dropped table! + }); + ee.ExpandCollapseEntity("QUERIES/JS", false); + ee.ExpandCollapseEntity("DATASOURCES"); + ee.ExpandCollapseEntity(dsName); + ee.ActionContextMenuByEntityName(dsName, "Refresh"); + agHelper.AssertElementAbsence(ee._entityNameInExplorer("public.jsonBbooks")); + ee.ExpandCollapseEntity(dsName, false); + ee.ExpandCollapseEntity("DATASOURCES", false); + }); + + it("27. Verify Deletion of all created queries", () => { + dataSources.DeleteDatasouceFromWinthinDS(dsName, 409); //Since all queries exists + ee.ExpandCollapseEntity("QUERIES/JS"); + ee.ActionContextMenuByEntityName("createEnum", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("createTable", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName( + "deleteAllRecords", + "Delete", + "Are you sure?", + ); + ee.ActionContextMenuByEntityName("deleteRecord", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("dropTable", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("dropEnum", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("getEnum", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName("insertRecord", "Delete", "Are you sure?"); + ee.ActionContextMenuByEntityName( + "selectRecords", + "Delete", + "Are you sure?", + ); + ee.ActionContextMenuByEntityName("updateRecord", "Delete", "Are you sure?"); + }); + + //#endregion + + it("28. Verify Deletion of datasource", () => { + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + ee.ExpandCollapseEntity("QUERIES/JS"); + dataSources.DeleteDatasouceFromWinthinDS(dsName, 200); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Numeric_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Numeric_Spec.ts index 3794622584..24198ae277 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Numeric_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/DataTypes/Numeric_Spec.ts @@ -14,7 +14,7 @@ describe("Postgres - Datatype Numeric tests", function() { cy.fixture("NumericDTdsl").then((val: any) => { agHelper.AddDsl(val); }); - propPane.ChangeTheme("Modern"); + propPane.ChangeTheme("Moon"); }); it("1. Create Postgress DS", function() { @@ -38,9 +38,10 @@ describe("Postgres - Datatype Numeric tests", function() { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("createTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); cy.get(".CodeMirror textarea").focus(); dataSources.RunQuery(); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementVisible( @@ -62,7 +63,7 @@ describe("Postgres - Datatype Numeric tests", function() { VALUES ({{Insertbigint.text}}, {{Insertdecimal.text}}, {{Insertnumeric.text}})`; ee.ActionTemplateMenuByEntityName("public.numerictypes", "INSERT"); agHelper.RenameWithInPane("insertRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("5. Creating UPDATE query - numerictypes", () => { @@ -73,7 +74,7 @@ describe("Postgres - Datatype Numeric tests", function() { WHERE serialid = {{Table1.selectedRow.serialid}};`; ee.ActionTemplateMenuByEntityName("public.numerictypes", "UPDATE"); agHelper.RenameWithInPane("updateRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("5. Creating DELETE query with condition - numerictypes", () => { @@ -81,21 +82,21 @@ describe("Postgres - Datatype Numeric tests", function() { WHERE serialId ={{Table1.selectedRow.serialid}}`; ee.ActionTemplateMenuByEntityName("public.numerictypes", "DELETE"); agHelper.RenameWithInPane("deleteRecord"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("6. Creating DELETE query for complete table empty - numerictypes", () => { query = `DELETE FROM public."numerictypes"`; ee.ActionTemplateMenuByEntityName("public.numerictypes", "DELETE"); agHelper.RenameWithInPane("deleteAllRecords"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); }); it("7. Creating DROP table query - numerictypes", () => { query = `drop table public."numerictypes"`; ee.ActionTemplateMenuByEntityName("public.numerictypes", "DELETE"); agHelper.RenameWithInPane("dropTable"); - agHelper.EnterValue(query); + dataSources.EnterQuery(query); ee.ExpandCollapseEntity("QUERIES/JS", false); ee.ExpandCollapseEntity(dsName, false); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ActiveDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ActiveDatasource_spec.js index 2b4350f3c4..e97dc2ca6a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ActiveDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/ActiveDatasource_spec.js @@ -1,11 +1,15 @@ const datasourceEditor = require("../../../../locators/DatasourcesEditor.json"); +import { ObjectsRegistry } from "../../../../support/Objects/Registry"; + +let dataSources = ObjectsRegistry.DataSources; + let datasourceName, actionName; + describe("Mongo Active datasource test cases", function() { before(() => { cy.NavigateToDatasourceEditor(); - cy.get(datasourceEditor.MongoDB).click(); - cy.getPluginFormsAndCreateDatasource(); + dataSources.CreatePlugIn("MongoDB"); cy.fillMongoDatasourceForm(); cy.get(datasourceEditor.saveBtn).click({ force: true }); cy.wait("@createDatasource").then((httpResponse) => { diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js index d16724e887..5f80129525 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js @@ -10,7 +10,7 @@ describe("Create a rest datasource", function() { it("Create a rest datasource + Bug 14566", function() { cy.NavigateToAPI_Panel(); - cy.CreateAPI("Testapi"); + cy.CreateAPI(); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); cy.assertPageSave(); cy.get(".t--store-as-datasource") diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Mongo_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Mongo_Spec.ts index faa100b75b..1465455203 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Mongo_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Mongo_Spec.ts @@ -24,7 +24,7 @@ describe("Validate Mongo CRUD with JSON Form", () => { }); it("1. Create DS & then Add new Page and generate CRUD template using created datasource", () => { - propPane.ChangeTheme("Modern"); + propPane.ChangeTheme("Water Lily"); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { @@ -45,7 +45,6 @@ describe("Validate Mongo CRUD with JSON Form", () => { cy.wrap("Mongo " + guid).as("dsName"); }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains(dataSources._dropdownOption, "pokemon"); GenerateCRUDNValidateDeployPage( @@ -101,7 +100,6 @@ describe("Validate Mongo CRUD with JSON Form", () => { agHelper.GetNClick(dataSources._generatePageBtn); agHelper.ValidateNetworkStatus("@replaceLayoutWithCRUDPage", 201); //agHelper.ValidateToastMessage("Successfully generated a page");// Commenting this since FindQuery failure appears sometimes - agHelper.WaitUntilToastDisappear("Successfully generated a page"); agHelper.ValidateNetworkStatus("@getActions", 200); agHelper.ValidateNetworkStatus("@postExecute", 200); agHelper.ValidateNetworkStatus("@updateLayout", 200); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts index 8f130cb5a5..950ef5a588 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/MySQL_Spec.ts @@ -44,7 +44,6 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains( dataSources._dropdownOption, @@ -95,7 +94,6 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains(dataSources._dropdownOption, "customers"); @@ -162,13 +160,14 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("CreateProductLines"); - agHelper.EnterValue(tableCreateQuery); + dataSources.EnterQuery(tableCreateQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); //failing sometimes! dataSources.RunQuery(); agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("DATASOURCES") ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementVisible(ee._entityNameInExplorer("productlines")); @@ -303,7 +302,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("CreateStores"); - agHelper.EnterValue(tableCreateQuery); + dataSources.EnterQuery(tableCreateQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); @@ -583,12 +582,13 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("DropStores"); - agHelper.EnterValue(deleteTblQuery); + dataSources.EnterQuery(deleteTblQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); dataSources.RunQuery(); agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementAbsence(ee._entityNameInExplorer("Stores")); @@ -599,7 +599,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("DropStores"); - agHelper.EnterValue(deleteTblQuery); + dataSources.EnterQuery(deleteTblQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts index 96afc5f889..dde7414956 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/GenerateCRUD/Postgres_Spec.ts @@ -37,7 +37,6 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains(dataSources._dropdownOption, "film"); @@ -90,7 +89,6 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains(dataSources._dropdownOption, "suppliers"); @@ -105,7 +103,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { cy.get("@dsName").then(($dsName) => { dsName = $dsName; }); - propPane.ChangeTheme("Modern"); + propPane.ChangeTheme("Sunrise"); }); it("3. Generate CRUD page from datasource present in ACTIVE section", function() { @@ -166,13 +164,14 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("CreateVessels"); - agHelper.EnterValue(tableCreateQuery); + dataSources.EnterQuery(tableCreateQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); //failing sometimes! dataSources.RunQuery(); agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementVisible(ee._entityNameInExplorer("public.vessels")); @@ -276,7 +275,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { WHERE "ship_id" = {{data_table.selectedRow.ship_id}};`; ee.SelectEntityByName("UpdateQuery", "QUERIES/JS"); - agHelper.EnterValue(updateQuery); + dataSources.EnterQuery(updateQuery); agHelper.AssertAutoSave(); ee.ExpandCollapseEntity("QUERIES/JS", false); }); @@ -518,7 +517,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { );`; ee.SelectEntityByName("InsertQuery", "QUERIES/JS"); - agHelper.EnterValue(insertQuery); + dataSources.EnterQuery(insertQuery); agHelper.AssertAutoSave(); ee.ExpandCollapseEntity("QUERIES/JS", false); }); @@ -688,12 +687,13 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("DropVessels"); - agHelper.EnterValue(deleteTblQuery); + dataSources.EnterQuery(deleteTblQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); dataSources.RunQuery(); agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementAbsence(ee._entityNameInExplorer("public.vessels")); @@ -704,7 +704,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { dataSources.NavigateFromActiveDS(dsName, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("DropVessels"); - agHelper.EnterValue(deleteTblQuery); + dataSources.EnterQuery(deleteTblQuery); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts index b9869870de..1015cb68cb 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts @@ -50,7 +50,7 @@ describe("JSObjects OnLoad Actions tests", function() { agHelper.RenameWithInPane("GetUser"); cy.get("@jsObjName").then((jsObjName) => { jsName = jsObjName; - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{" + jsObjName + ".getId.data}}", @@ -418,7 +418,7 @@ describe("JSObjects OnLoad Actions tests", function() { dataSources.NavigateFromActiveDS(guid, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("getCitiesList"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT distinct city FROM public.city order by city ASC", ); @@ -460,7 +460,7 @@ describe("JSObjects OnLoad Actions tests", function() { // dataSources.NavigateToActiveDSQueryPane(guid); // agHelper.GetNClick(dataSources._templateMenu); // agHelper.RenameWithInPane("getCountry"); - // agHelper.EnterValue( + // dataSources.EnterQuery( // "SELECT country FROM public.city as City join public.country Country on City.country_id=Country.country_id where City.city = {{" + // jsObjName + // ".getSelectedCity()}}", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts index 935ed012cd..ef740ff871 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Params/PassingParams_Spec.ts @@ -31,7 +31,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", dataSources.NavigateFromActiveDS(guid, true); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("ParamsTest"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{this?.params?.condition || '1=1'}} order by id", ); jsEditor.CreateJSObject( @@ -73,7 +73,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("2. With Optional chaining : {{ (function() { return this?.params?.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(function() { return this?.params?.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -88,7 +88,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("3. With Optional chaining : {{ (() => { return this?.params?.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(() => { return this?.params?.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -103,7 +103,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("4. With Optional chaining : {{ this?.params.condition }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{this?.params.condition || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -118,7 +118,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("5. With Optional chaining : {{ (function() { return this?.params.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(function() { return this?.params.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -133,7 +133,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("6. With Optional chaining : {{ (() => { return this?.params.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(() => { return this?.params.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -148,7 +148,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("7. With No Optional chaining : {{ this.params.condition }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{this.params.condition || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -163,7 +163,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("8. With No Optional chaining : {{ (function() { return this.params.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(function() { return this.params.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -178,7 +178,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("9. With No Optional chaining : {{ (() => { return this.params.condition })() }}", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(() => { return this.params.condition })() || '1=1'}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); @@ -193,7 +193,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("10. With Optional chaining : {{ this.params.condition }} && direct paramter passed", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(() => { return this.params.condition })() || '7'}} order by id", ); @@ -212,7 +212,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", it("11. With Optional chaining : {{ this.params.condition }} && no optional paramter passed", function() { ee.SelectEntityByName("ParamsTest", "QUERIES/JS"); - agHelper.EnterValue( + dataSources.EnterQuery( "SELECT * FROM public.users where id = {{(() => { return this.params.condition })()}} order by id", ); deployMode.DeployApp(locator._spanButton("Submit")); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.ts index 9e5814da54..f3551dc0c0 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.ts @@ -44,7 +44,6 @@ describe("Validate Mongo Query Pane Validations", () => { }); agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated - agHelper.WaitUntilToastDisappear("datasource updated successfully"); agHelper.GetNClick(dataSources._selectTableDropdown); agHelper.GetNClickByContains(dataSources._dropdownOption, "friends"); @@ -643,15 +642,16 @@ describe("Validate Mongo Query Pane Validations", () => { dataSources.NavigateFromActiveDS(dsName, true); dataSources.ValidateNSelectDropdown("Commands", "Find Document(s)", "Raw"); + agHelper.RenameWithInPane("DropAuthorNAwards"); //Due to template appearing after renaming agHelper.GetNClick(dataSources._templateMenu); - agHelper.RenameWithInPane("DropAuthorNAwards"); - agHelper.EnterValue(dropCollection); + dataSources.EnterQuery(dropCollection); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); dataSources.RunQuery(); agHelper.ActionContextMenuWithInPane("Delete"); + ee.ExpandCollapseEntity("DATASOURCES"); ee.ExpandCollapseEntity(dsName); ee.ActionContextMenuByEntityName(dsName, "Refresh"); agHelper.AssertElementAbsence(ee._entityNameInExplorer("AuthorNAwards")); @@ -663,7 +663,7 @@ describe("Validate Mongo Query Pane Validations", () => { dataSources.ValidateNSelectDropdown("Commands", "Find Document(s)", "Raw"); agHelper.GetNClick(dataSources._templateMenu); agHelper.RenameWithInPane("DropAuthorNAwards"); - agHelper.EnterValue(dropCollection); + dataSources.EnterQuery(dropCollection); cy.get(".CodeMirror textarea").focus(); //agHelper.VerifyEvaluatedValue(tableCreateQuery); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/MySQL_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/MySQL_Spec.ts index 78c3ca24c4..f98224d36c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/MySQL_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/QueryPane/MySQL_Spec.ts @@ -68,12 +68,13 @@ describe("Validate MySQL query UI flows - Bug 14054", () => { }); it("4. Verify Deletion of the datasource", () => { - ee.ActionContextMenuByEntityName(dsName, "Delete", "Are you sure?") + ee.SelectEntityByName(dsName, "DATASOURCES"); + ee.ActionContextMenuByEntityName(dsName, "Delete", "Are you sure?"); agHelper.ValidateNetworkStatus("@deleteDatasource", 200); }); function runQueryNValidate(query: string, columnHeaders: string[]) { - agHelper.EnterValue(query); + dataSources.EnterQuery(query); dataSources.RunQuery(); dataSources.AssertQueryResponseHeaders(columnHeaders); } diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/EmptyApp.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/EmptyApp.snap.png deleted file mode 100644 index 2720adbb8f..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/EmptyApp.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/apppage.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/apppage.snap.png deleted file mode 100644 index 075928e3fd..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/apppage.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/emptyAppBuilder.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/emptyAppBuilder.snap.png deleted file mode 100644 index b44fc5ea46..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/emptyAppBuilder.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/quickPageWizard.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/quickPageWizard.snap.png deleted file mode 100644 index 3fca4d3b3c..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/AppPageLayout_spec.js/quickPageWizard.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineDisabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineDisabled.snap.png deleted file mode 100644 index 258fc20508..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineDisabled.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineEnabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineEnabled.snap.png deleted file mode 100644 index 3e104bd4d7..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/LayoutValidation/WidgetsLayout_spec.js/inlineEnabled.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/EmptyApp.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/EmptyApp.snap.png deleted file mode 100644 index 7e4ec198ec..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/EmptyApp.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png deleted file mode 100644 index c18778170c..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineDisabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineDisabled.snap.png deleted file mode 100644 index d95de82ed9..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineDisabled.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineEnabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineEnabled.snap.png deleted file mode 100644 index 6d4561aad9..0000000000 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/WidgetsLayout_spec.js/inlineEnabled.snap.png and /dev/null differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/EmptyApp.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/EmptyApp.snap.png new file mode 100644 index 0000000000..29374b72e0 Binary files /dev/null and b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/EmptyApp.snap.png differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/Profile.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/Profile.snap.png similarity index 100% rename from app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/Profile.snap.png rename to app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/Profile.snap.png diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/apppage.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/apppage.snap.png similarity index 100% rename from app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/apppage.snap.png rename to app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/apppage.snap.png diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png new file mode 100644 index 0000000000..db7791f627 Binary files /dev/null and b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/emptyAppBuilder.snap.png differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/loginpage.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/loginpage.snap.png similarity index 100% rename from app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/loginpage.snap.png rename to app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/loginpage.snap.png diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/quickPageWizard.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/quickPageWizard.snap.png similarity index 61% rename from app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/quickPageWizard.snap.png rename to app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/quickPageWizard.snap.png index 473bbbad40..20c3bc5b7d 100644 Binary files a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/SnapshotTests/AppPageLayout_spec.js/quickPageWizard.snap.png and b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js/quickPageWizard.snap.png differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineDisabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineDisabled.snap.png new file mode 100644 index 0000000000..cb8bcf1345 Binary files /dev/null and b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineDisabled.snap.png differ diff --git a/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineEnabled.snap.png b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineEnabled.snap.png new file mode 100644 index 0000000000..62b2ece769 Binary files /dev/null and b/app/client/cypress/snapshots/Smoke_TestSuite/ClientSideTests/VisualTests/WidgetsLayout_spec.js/inlineEnabled.snap.png differ diff --git a/app/client/cypress/support/ApiCommands.js b/app/client/cypress/support/ApiCommands.js index 2f613aca4e..aa50e8ad13 100644 --- a/app/client/cypress/support/ApiCommands.js +++ b/app/client/cypress/support/ApiCommands.js @@ -59,8 +59,10 @@ Cypress.Commands.add("CreateAPI", (apiname) => { cy.get(explorer.blankAPI).click({ force: true }); cy.wait("@createNewApi"); cy.get(apiwidget.resourceUrl).should("be.visible"); - cy.renameWithInPane(apiname); - cy.WaitAutoSave(); + if (apiname) { + cy.renameWithInPane(apiname); + cy.WaitAutoSave(); + } // Added because api name edit takes some time to // reflect in api sidebar after the call passes. // eslint-disable-next-line cypress/no-unnecessary-waiting diff --git a/app/client/cypress/support/Objects/CommonLocators.ts b/app/client/cypress/support/Objects/CommonLocators.ts index b25524ac69..b8f79f5673 100644 --- a/app/client/cypress/support/Objects/CommonLocators.ts +++ b/app/client/cypress/support/Objects/CommonLocators.ts @@ -76,4 +76,5 @@ export class CommonLocators { _deleteIcon = "button .bp3-icon-delete" _datePickerValue = "div[data-testid='datepicker-container'] input" _switchToggle = (switchName: string) => "//div[contains(@class, 't--switch-widget-label')][text()='"+switchName+"']/parent::label/span" + _jsonToggle = (fieldName: string) => `//p[text()='${fieldName}']/parent::div//following-sibling::div//input[@type='checkbox']`; } diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index 2a1d339043..8b52234717 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -139,7 +139,11 @@ export class AggregateHelper { }); } - public WaitUntilToastDisappear(msgToCheckforDisappearance: string | "", index = 0 , length = 1) { + public WaitUntilToastDisappear( + msgToCheckforDisappearance: string | "", + index = 0, + length = 1, + ) { this.ValidateToastMessage(msgToCheckforDisappearance, index, length); cy.waitUntil(() => cy.get(this.locator._toastMsg), { errorMsg: msgToCheckforDisappearance + " did not disappear", @@ -444,8 +448,11 @@ export class AggregateHelper { public ToggleSwitch( switchName: string, toggle: "check" | "uncheck" = "check", + jsonSwitch = false, ) { - const locator = cy.xpath(this.locator._switchToggle(switchName)); + const locator = jsonSwitch + ? cy.xpath(this.locator._jsonToggle(switchName)) + : cy.xpath(this.locator._switchToggle(switchName)); const parentLoc = locator.parent("label"); if (toggle == "check") parentLoc.then(($parent) => { @@ -551,10 +558,6 @@ export class AggregateHelper { this.UpdateCodeInput($field, valueToEnter); }, ); - } else { - cy.get(this.locator._codeEditorTarget).then(($field: any) => { - this.UpdateCodeInput($field, valueToEnter); - }); } this.AssertAutoSave(); } diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 18c15f4423..13a6465d0a 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -225,6 +225,7 @@ export class DataSources { public SaveDatasource() { cy.get(this._saveDs).click(); this.agHelper.ValidateNetworkStatus("@saveDatasource", 200); + this.agHelper.WaitUntilToastDisappear("datasource updated successfully"); // cy.wait("@saveDatasource") // .then((xhr) => { @@ -274,8 +275,10 @@ export class DataSources { ? this._createQuery : this._datasourceCardGeneratePageBtn; - this.ee.SelectEntityByName(datasourceName, "DATASOURCES"); - this.ee.ExpandCollapseEntity(datasourceName, false); + this.ee.NavigateToSwitcher("explorer"); + this.ee.ExpandCollapseEntity("DATASOURCES", false); + //this.ee.SelectEntityByName(datasourceName, "DATASOURCES"); + //this.ee.ExpandCollapseEntity(datasourceName, false); this.NavigateToDSCreateNew(); this.agHelper.GetNClick(this._activeTab); cy.get(this._datasourceCard) @@ -289,11 +292,6 @@ export class DataSources { this.agHelper.Sleep(2000); //for the CreateQuery/GeneratePage page to load } - public NavigateToActiveDSviaEntityExplorer(datasourceName: string) { - this.ee.SelectEntityByName(datasourceName, "DATASOURCES"); - cy.get(this._createQuery).click({ force: true }); - } - public ValidateNSelectDropdown( ddTitle: string, currentValue = "", @@ -382,4 +380,11 @@ export class DataSources { this.agHelper.AssertAutoSave(); } + + public EnterQuery(query: string) { + cy.get(this.locator._codeEditorTarget).then(($field: any) => { + this.agHelper.UpdateCodeInput($field, query); + }); + this.agHelper.AssertAutoSave(); + } } diff --git a/app/client/cypress/support/Pages/DeployModeHelper.ts b/app/client/cypress/support/Pages/DeployModeHelper.ts index 57d31ec10e..50f0a520b8 100644 --- a/app/client/cypress/support/Pages/DeployModeHelper.ts +++ b/app/client/cypress/support/Pages/DeployModeHelper.ts @@ -13,7 +13,11 @@ export class DeployMode { _jsonFormDatepickerFieldByName = (fieldName: string) => `//p[text()='${fieldName}']/ancestor::div[@direction='column']//div[@data-testid='datepicker-container']//input`; _jsonSelectDropdown = "button.select-button"; + private _jsonFormMultiSelectByName = (fieldName: string) => + `//p[text()='${fieldName}']/ancestor::div[@direction='column']//div[@data-testid='multiselect-container']//div[contains(@class, 'rc-select-show-arrow')]`; _clearDropdown = "button.select-button span.cancel-icon"; + private _jsonFormMultiSelectOptions = (option: string) => + `//div[@title='${option}']//input[@type='checkbox']/ancestor::div[@title='${option}']`; //refering PublishtheApp from command.js public DeployApp( @@ -90,7 +94,46 @@ export class DeployMode { .eq(index) .scrollIntoView() .click(); - cy.get(this.locator._selectOptionValue(dropdownOption)).click({ force: true }); + cy.get(this.locator._selectOptionValue(dropdownOption)).click({ + force: true, + }); this.agHelper.Sleep(); //for selected value to reflect! } + + public SelectJsonFormMultiSelect( + name: string, + options: string[], + index = 0, + check = true, + ) { + cy.xpath(this._jsonFormMultiSelectByName(name)) + .eq(index) + .scrollIntoView() + .click(); + this.agHelper.Sleep(500); + + if (check) { + options.forEach(($each) => { + cy.get(this.locator._multiSelectOptions($each)) + .check({ force: true }) + .wait(800); + cy.xpath(this._jsonFormMultiSelectOptions($each)).should( + "have.class", + "rc-select-item-option-selected", + ); + }); + } else { + options.forEach(($each) => { + cy.get(this.locator._multiSelectOptions($each)) + .uncheck({ force: true }) + .wait(800); + cy.xpath(this._jsonFormMultiSelectOptions($each)).should( + "not.have.class", + "rc-select-item-option-selected", + ); + }); + } + // //closing multiselect dropdown + cy.get("body").type("{esc}"); + } } diff --git a/app/client/cypress/support/themeCommands.js b/app/client/cypress/support/themeCommands.js index 10cbd58a30..eca86ba3b5 100644 --- a/app/client/cypress/support/themeCommands.js +++ b/app/client/cypress/support/themeCommands.js @@ -10,7 +10,7 @@ Cypress.Commands.add("borderMouseover", (index, text) => { cy.get(themelocator.border) .eq(index) .trigger("mouseover"); - cy.wait(2000); + cy.wait(1000); cy.get(themelocator.popover).contains(text); }); @@ -18,7 +18,7 @@ Cypress.Commands.add("shadowMouseover", (index, text) => { cy.xpath(themelocator.shadow) .eq(index) .trigger("mouseover"); - cy.wait(2000); + cy.wait(1000); cy.get(themelocator.popover).contains(text); });