diff --git a/app/client/cypress/fixtures/exportedApp.json b/app/client/cypress/fixtures/exportedApp.json new file mode 100644 index 0000000000..cd7f013bba --- /dev/null +++ b/app/client/cypress/fixtures/exportedApp.json @@ -0,0 +1,313 @@ +{ + "exportedApplication": { + "userPermissions": [ + "canComment:applications", + "manage:applications", + "export:applications", + "read:applications", + "publish:applications", + "makePublic:applications" + ], + "name": "2eacca10", + "isPublic": false, + "appIsExample": false, + "unreadCommentThreads": 0, + "color": "#F1DEFF", + "icon": "cat", + "new": true + }, + "datasourceList": [], + "pageList": [ + { + "userPermissions": [ + "read:pages", + "manage:pages" + ], + "gitSyncId": "61602709ae8b022ed53c23c7_2021-10-08T11:10:01.203693Z", + "unpublishedPage": { + "name": "Page1", + "layouts": [ + { + "id": "61602709ae8b022ed53c23c8", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1292, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container1", + "rightColumn": 8, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "mxbaasg65u", + "containerStyle": "card", + "topRow": 0, + "bottomRow": 9, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "59gdivzv7s", + "rightColumn": 602, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "bxekwxgc1i", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 342, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "children": [ + { + "image": "", + "widgetName": "Image1", + "rightColumn": 10, + "widgetId": "glksllew0g", + "topRow": 2, + "bottomRow": 5, + "parentRowSpace": 38, + "isVisible": true, + "type": "IMAGE_WIDGET", + "parentId": "bxekwxgc1i", + "isLoading": false, + "parentColumnSpace": 34.6875, + "imageShape": "RECTANGLE", + "leftColumn": 6, + "defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png" + } + ] + } + ] + }, + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container3", + "rightColumn": 16, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "i331vll2mg", + "containerStyle": "card", + "topRow": 9, + "bottomRow": 23, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "rhfg2vf1n5", + "rightColumn": 1204, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "rglduihhzk", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 532, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "children": [ + { + "widgetName": "Chart1", + "rightColumn": 8, + "allowHorizontalScroll": false, + "widgetId": "hwi9cwhg43", + "topRow": 1, + "bottomRow": 9, + "parentRowSpace": 38, + "isVisible": true, + "type": "CHART_WIDGET", + "parentId": "rglduihhzk", + "isLoading": false, + "chartData": [ + { + "seriesName": "Sales", + "data": [ + { + "x": "Mon", + "y": 10000 + }, + { + "x": "Tue", + "y": 12000 + }, + { + "x": "Wed", + "y": 32000 + }, + { + "x": "Thu", + "y": 28000 + }, + { + "x": "Fri", + "y": 14000 + }, + { + "x": "Sat", + "y": 19000 + }, + { + "x": "Sun", + "y": 36000 + } + ] + } + ], + "yAxisName": "Total Order Revenue $", + "parentColumnSpace": 71.75, + "chartName": "Sales on working days", + "leftColumn": 2, + "dynamicBindingPathList": [], + "xAxisName": "Last Week", + "chartType": "LINE_CHART" + } + ] + } + ] + }, + { + "backgroundColor": "#FFFFFF", + "widgetName": "Container4", + "rightColumn": 16, + "orientation": "VERTICAL", + "snapColumns": 16, + "widgetId": "qznzsquf70", + "containerStyle": "card", + "topRow": 0, + "bottomRow": 9, + "parentRowSpace": 38, + "isVisible": true, + "type": "CONTAINER_WIDGET", + "isLoading": false, + "parentColumnSpace": 75.25, + "dynamicBindingPathList": [], + "leftColumn": 8, + "children": [ + { + "backgroundColor": "transparent", + "widgetName": "3bn6uv0vy4", + "rightColumn": 602, + "orientation": "VERTICAL", + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "7vm5mdu8ey", + "containerStyle": "none", + "topRow": 0, + "bottomRow": 342, + "parentRowSpace": 1, + "isVisible": true, + "type": "CANVAS_WIDGET", + "canExtend": false, + "isLoading": false, + "parentColumnSpace": 1, + "leftColumn": 0, + "children": [ + { + "widgetName": "Text1", + "rightColumn": 7, + "textAlign": "LEFT", + "widgetId": "9xcfqahpw2", + "topRow": 3, + "bottomRow": 4, + "parentRowSpace": 38, + "isVisible": true, + "type": "TEXT_WIDGET", + "parentId": "bxekwxgc1i", + "isLoading": false, + "parentColumnSpace": 34.6875, + "leftColumn": 3, + "text": "Label" + } + ] + } + ] + } + ] + }, + "layoutOnLoadActions": [], + "new": false + } + ], + "userPermissions": [] + }, + "publishedPage": { + "name": "Page1", + "layouts": [ + { + "id": "61602709ae8b022ed53c23c8", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1254, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 4, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [] + }, + "new": false + } + ], + "userPermissions": [] + }, + "new": true + } + ], + "publishedDefaultPageName": "Page1", + "unpublishedDefaultPageName": "Page1", + "actionList": [], + "actionCollectionList": [], + "decryptedFields": {}, + "publishedLayoutmongoEscapedWidgets": {}, + "unpublishedLayoutmongoEscapedWidgets": {} + } \ No newline at end of file diff --git a/app/client/cypress/fixtures/forkedApp.json b/app/client/cypress/fixtures/forkedApp.json new file mode 100644 index 0000000000..8d92e622ac --- /dev/null +++ b/app/client/cypress/fixtures/forkedApp.json @@ -0,0 +1,685 @@ +{ + "exportedApplication": { + "name": "app", + "isPublic": false, + "appIsExample": false, + "unreadCommentThreads": 0, + "color": "#F4FFDE", + "icon": "single-person", + "slug": "forktest", + "evaluationVersion": 2, + "new": true + }, + "datasourceList": [ + { + "userPermissions": [ + "execute:datasources", + "manage:datasources", + "read:datasources" + ], + "gitSyncId": "61c2d94747cda83965fe72b5_61c5822385c0bd4ccf7d171c", + "name": "mockdata", + "pluginId": "postgres-plugin", + "datasourceConfiguration": { + "connection": { + "mode": "READ_WRITE", + "ssl": { + "authType": "DEFAULT" + } + }, + "endpoints": [ + { + "host": "localhost", + "port": 5432 + } + ], + "sshProxyEnabled": false + }, + "invalids": [], + "messages": [], + "isValid": true, + "new": true + } + ], + "pageList": [ + { + "userPermissions": [ + "read:pages", + "manage:pages" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c580d685c0bd4ccf7d1718", + "unpublishedPage": { + "name": "Page1", + "slug": "page1", + "layouts": [ + { + "id": "Page1", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 816, + "snapColumns": 64, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 590, + "containerStyle": "none", + "snapRows": 125, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 47, + "minHeight": 600, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [ + { + "widgetName": "Table1", + "defaultPageSize": 0, + "columnOrder": [ + "schema_name" + ], + "isVisibleDownload": true, + "dynamicPropertyPathList": [], + "displayName": "Table", + "iconSVG": "/static/media/icon.db8a9cbd.svg", + "topRow": 14, + "bottomRow": 38, + "isSortable": true, + "parentRowSpace": 10, + "type": "TABLE_WIDGET", + "defaultSelectedRow": "0", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 12.5625, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [ + { + "key": "tableData" + }, + { + "key": "primaryColumns.schema_name.computedValue" + } + ], + "leftColumn": 4, + "primaryColumns": { + "schema_name": { + "index": 0, + "width": 150, + "id": "schema_name", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textSize": "PARAGRAPH", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "schema_name", + "computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.schema_name))}}" + } + }, + "delimiter": ",", + "key": "5ejs55im17", + "derivedColumns": {}, + "rightColumn": 25, + "textSize": "PARAGRAPH", + "widgetId": "uyyp0qxfdq", + "isVisibleFilters": true, + "tableData": "{{get_schema.data}}", + "isVisible": true, + "label": "Data", + "searchKey": "", + "enableClientSideSearch": true, + "version": 3, + "totalRecordsCount": 0, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "horizontalAlignment": "LEFT", + "isVisibleSearch": true, + "isVisiblePagination": true, + "verticalAlignment": "CENTER", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75 + } + }, + { + "widgetName": "Table2", + "defaultPageSize": 0, + "columnOrder": [ + "id", + "title", + "due", + "assignee" + ], + "isVisibleDownload": true, + "dynamicPropertyPathList": [], + "displayName": "Table", + "iconSVG": "/static/media/icon.db8a9cbd.svg", + "topRow": 14, + "bottomRow": 38, + "isSortable": true, + "parentRowSpace": 10, + "type": "TABLE_WIDGET", + "defaultSelectedRow": "0", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 12.5625, + "dynamicTriggerPathList": [], + "dynamicBindingPathList": [ + { + "key": "tableData" + }, + { + "key": "primaryColumns.due.computedValue" + }, + { + "key": "primaryColumns.assignee.computedValue" + }, + { + "key": "primaryColumns.title.computedValue" + }, + { + "key": "primaryColumns.id.computedValue" + } + ], + "leftColumn": 30, + "primaryColumns": { + "due": { + "index": 0, + "width": 150, + "id": "due", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textSize": "PARAGRAPH", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "due", + "computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.due))}}" + }, + "assignee": { + "index": 1, + "width": 150, + "id": "assignee", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textSize": "PARAGRAPH", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "assignee", + "computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.assignee))}}" + }, + "title": { + "index": 2, + "width": 150, + "id": "title", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textSize": "PARAGRAPH", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "title", + "computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.title))}}" + }, + "id": { + "index": 4, + "width": 150, + "id": "id", + "horizontalAlignment": "LEFT", + "verticalAlignment": "CENTER", + "columnType": "text", + "textSize": "PARAGRAPH", + "enableFilter": true, + "enableSort": true, + "isVisible": true, + "isDisabled": false, + "isCellVisible": true, + "isDerived": false, + "label": "id", + "computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.id))}}" + } + }, + "delimiter": ",", + "key": "5ejs55im17", + "derivedColumns": {}, + "rightColumn": 61, + "textSize": "PARAGRAPH", + "widgetId": "r1m4lkt7at", + "isVisibleFilters": true, + "tableData": "{{mockApi.data.headers.info}}", + "isVisible": true, + "label": "Data", + "searchKey": "", + "enableClientSideSearch": true, + "version": 3, + "totalRecordsCount": 0, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "horizontalAlignment": "LEFT", + "isVisibleSearch": true, + "isVisiblePagination": true, + "verticalAlignment": "CENTER", + "columnSizeMap": { + "task": 245, + "step": 62, + "status": 75, + "id": 60 + } + }, + { + "widgetName": "Input1", + "displayName": "Input", + "iconSVG": "/static/media/icon.9f505595.svg", + "topRow": 43, + "bottomRow": 47, + "parentRowSpace": 10, + "autoFocus": false, + "type": "INPUT_WIDGET", + "hideCard": false, + "animateLoading": true, + "parentColumnSpace": 12.5625, + "dynamicTriggerPathList": [], + "resetOnSubmit": true, + "leftColumn": 18, + "dynamicBindingPathList": [ + { + "key": "defaultText" + } + ], + "labelStyle": "", + "inputType": "TEXT", + "isDisabled": false, + "key": "t02w4ix9o5", + "isRequired": false, + "rightColumn": 38, + "widgetId": "9timcor5m5", + "isVisible": true, + "label": "", + "allowCurrencyChange": false, + "version": 1, + "parentId": "0", + "renderMode": "CANVAS", + "isLoading": false, + "iconAlign": "left", + "defaultText": "{{JSObject1.myVar1}}" + } + ] + }, + "layoutOnLoadActions": [ + [ + { + "id": "61c5832685c0bd4ccf7d171f", + "name": "get_schema", + "pluginType": "DB", + "jsonPathKeys": [], + "timeoutInMillisecond": 10000 + } + ], + [ + { + "id": "61c580e385c0bd4ccf7d171b", + "name": "mockApi", + "pluginType": "API", + "jsonPathKeys": [], + "timeoutInMillisecond": 10000 + } + ] + ], + "new": false + } + ], + "userPermissions": [] + }, + "publishedPage": { + "name": "Page1", + "slug": "page1", + "layouts": [ + { + "id": "Page1", + "userPermissions": [], + "dsl": { + "widgetName": "MainContainer", + "backgroundColor": "none", + "rightColumn": 1224, + "snapColumns": 16, + "detachFromLayout": true, + "widgetId": "0", + "topRow": 0, + "bottomRow": 1254, + "containerStyle": "none", + "snapRows": 33, + "parentRowSpace": 1, + "type": "CANVAS_WIDGET", + "canExtend": true, + "version": 4, + "minHeight": 1292, + "parentColumnSpace": 1, + "dynamicBindingPathList": [], + "leftColumn": 0, + "children": [] + }, + "new": false + } + ], + "userPermissions": [] + }, + "new": true + } + ], + "publishedDefaultPageName": "Page1", + "unpublishedDefaultPageName": "Page1", + "actionList": [ + { + "id": "61c580e385c0bd4ccf7d171b", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c580e385c0bd4ccf7d171a", + "pluginType": "API", + "pluginId": "restapi-plugin", + "unpublishedAction": { + "name": "mockApi", + "datasource": { + "userPermissions": [], + "name": "DEFAULT_REST_DATASOURCE", + "pluginId": "restapi-plugin", + "datasourceConfiguration": { + "url": "https://mock-api.appsmith.com" + }, + "invalids": [], + "messages": [], + "isValid": true, + "new": true + }, + "pageId": "Page1", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "path": "/echo/get", + "headers": [ + { + "key": "info", + "value": "[{\"due\":\"2021-11-23\",\"assignee\":\"Dan.Wyman@hotmail.com\",\"title\":\"Recusan\",\"id\":\"1\"},{\"due\":\"2021-11-23\",\"assignee\":\"Dashawn_Maggio30@gmail.com\",\"title\":\"Dignissimos eaque\",\"id\":\"2\"},{\"due\":\"2021-11-24\",\"assignee\":\"Curt50@gmail.com\",\"title\":\"Voluptas explicabo\",\"id\":\"3\"},{\"due\":\"2021-11-23\",\"assignee\":\"Shanna63@hotmail.com\",\"title\":\"Aut omnis.\",\"id\":\"4\"}]" + } + ], + "encodeParamsToggle": true, + "queryParameters": [], + "body": "", + "httpMethod": "GET", + "pluginSpecifiedTemplates": [ + { + "value": true + } + ] + }, + "executeOnLoad": true, + "dynamicBindingPathList": [], + "isValid": true, + "invalids": [], + "messages": [], + "jsonPathKeys": [], + "confirmBeforeExecute": false, + "userPermissions": [], + "validName": "mockApi" + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "messages": [], + "isValid": true, + "new": true + }, + "messages": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + }, + { + "id": "61c5832685c0bd4ccf7d171f", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c5832685c0bd4ccf7d171e", + "pluginType": "DB", + "pluginId": "postgres-plugin", + "unpublishedAction": { + "name": "get_schema", + "datasource": { + "id": "mockdata", + "userPermissions": [], + "pluginId": "postgres-plugin", + "messages": [], + "isValid": true, + "new": false + }, + "pageId": "Page1", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "encodeParamsToggle": true, + "body": "SELECT schema_name FROM information_schema.schemata;", + "pluginSpecifiedTemplates": [ + { + "value": true + } + ] + }, + "executeOnLoad": true, + "dynamicBindingPathList": [], + "isValid": true, + "invalids": [], + "messages": [], + "jsonPathKeys": [], + "confirmBeforeExecute": false, + "userPermissions": [], + "validName": "get_schema" + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "messages": [], + "isValid": true, + "new": true + }, + "messages": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + }, + { + "id": "61c58ced85c0bd4ccf7d1723", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1722", + "pluginType": "JS", + "pluginId": "js-plugin", + "unpublishedAction": { + "name": "myFun1", + "fullyQualifiedName": "JSObject1.myFun1", + "datasource": { + "userPermissions": [], + "name": "UNUSED_DATASOURCE", + "pluginId": "js-plugin", + "messages": [], + "isValid": true, + "new": true + }, + "pageId": "Page1", + "collectionId": "61c58ced85c0bd4ccf7d1727", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "encodeParamsToggle": true, + "body": "() => {\n\t\t//write code here\n\t\treturn JSObject1.myVar1;\n\t}", + "jsArguments": [], + "isAsync": false + }, + "executeOnLoad": false, + "dynamicBindingPathList": [ + { + "key": "body" + } + ], + "isValid": true, + "invalids": [], + "messages": [], + "jsonPathKeys": [ + "() => {\n\t\t//write code here\n\t\treturn JSObject1.myVar1;\n\t}" + ], + "confirmBeforeExecute": false, + "userPermissions": [], + "validName": "JSObject1.myFun1" + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "messages": [], + "isValid": true, + "new": true + }, + "messages": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + }, + { + "id": "61c58ced85c0bd4ccf7d1725", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1724", + "pluginType": "JS", + "pluginId": "js-plugin", + "unpublishedAction": { + "name": "myFun2", + "fullyQualifiedName": "JSObject1.myFun2", + "datasource": { + "userPermissions": [], + "name": "UNUSED_DATASOURCE", + "pluginId": "js-plugin", + "messages": [], + "isValid": true, + "new": true + }, + "pageId": "Page1", + "collectionId": "61c58ced85c0bd4ccf7d1727", + "actionConfiguration": { + "timeoutInMillisecond": 10000, + "paginationType": "NONE", + "encodeParamsToggle": true, + "body": "() => {\n\t\t//write code here\n\t}", + "jsArguments": [], + "isAsync": false + }, + "executeOnLoad": false, + "dynamicBindingPathList": [ + { + "key": "body" + } + ], + "isValid": true, + "invalids": [], + "messages": [], + "jsonPathKeys": [ + "() => {\n\t\t//write code here\n\t}" + ], + "confirmBeforeExecute": false, + "userPermissions": [], + "validName": "JSObject1.myFun2" + }, + "publishedAction": { + "datasource": { + "userPermissions": [], + "messages": [], + "isValid": true, + "new": true + }, + "messages": [], + "confirmBeforeExecute": false, + "userPermissions": [] + }, + "new": false + } + ], + "actionCollectionList": [ + { + "id": "61c58ced85c0bd4ccf7d1727", + "userPermissions": [ + "read:actions", + "execute:actions", + "manage:actions" + ], + "gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1726", + "unpublishedCollection": { + "name": "JSObject1", + "pageId": "Page1", + "pluginId": "js-plugin", + "pluginType": "JS", + "actionIds": [], + "archivedActionIds": [], + "actions": [], + "archivedActions": [], + "body": "export default {\n\tmyVar1: \"Submit\",\n\tmyVar2: {},\n\tmyFun1: () => {\n\t\t//write code here\n\t\treturn this.myVar1;\n\t},\n\tmyFun2: () => {\n\t\t//write code here\n\t}\n}", + "variables": [ + { + "name": "myVar1", + "value": "Submit" + }, + { + "name": "myVar2", + "value": {} + } + ] + }, + "new": false + } + ], + "decryptedFields": { + "mockdata": { + "password": "postgres", + "authType": "com.appsmith.external.models.DBAuth", + "dbAuth": { + "authenticationType": "dbAuth", + "username": "postgres", + "databaseName": "fakeapi" + } + } + }, + "publishedLayoutmongoEscapedWidgets": {}, + "unpublishedLayoutmongoEscapedWidgets": {} +} \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/Application/ImportExportForkApplication_spec.js b/app/client/cypress/integration/Smoke_TestSuite/Application/ImportExportForkApplication_spec.js new file mode 100644 index 0000000000..2a020b043b --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/Application/ImportExportForkApplication_spec.js @@ -0,0 +1,135 @@ +const homePage = require("../../../locators/HomePage.json"); +const dsl = require("../../../fixtures/forkedApp.json"); + +describe("Import, Export and Fork application and validate data binding", function() { + let orgid; + let appid; + let newOrganizationName; + it("Import application and validate data on pageload", function() { + // import application + cy.get(homePage.homeIcon).click(); + cy.get(homePage.optionsIcon) + .first() + .click(); + cy.get(homePage.orgImportAppOption).click({ force: true }); + cy.get(homePage.orgImportAppModal).should("be.visible"); + cy.xpath(homePage.uploadLogo).attachFile("forkedApp.json"); + cy.get(homePage.orgImportAppButton).click({ force: true }); + cy.wait("@importNewApplication").then((interception) => { + let appId = interception.response.body.data.id; + let defaultPage = interception.response.body.data.pages.find( + (eachPage) => !!eachPage.isDefault, + ); + cy.get(homePage.toastMessage).should( + "contain", + "Application imported successfully", + ); + const uuid = () => Cypress._.random(0, 1e4); + const name = uuid(); + cy.wait(2000); + cy.get(homePage.applicationName) + .clear() + .type(`app${name}`); + cy.wrap(`app${name}`).as("appname"); + cy.wait(2000); + // validating data binding for the imported application + cy.xpath("//input[@value='Submit']").should("be.visible"); + cy.xpath("//div[text()='schema_name']").should("be.visible"); + cy.xpath("//div[text()='information_schema']").should("be.visible"); + cy.xpath("//div[text()='title']").should("be.visible"); + cy.xpath("//div[text()='Recusan']").should("be.visible"); + }); + }); + + it("Fork application and validate data binding for the widgets", function() { + // fork application + cy.get(homePage.homeIcon).click(); + cy.get(homePage.searchInput).type(`${this.appname}`); + cy.wait(2000); + cy.get(homePage.applicationCard) + .first() + .trigger("mouseover"); + cy.get(homePage.appMoreIcon) + .first() + .click({ force: true }); + cy.get(homePage.forkAppFromMenu).click({ force: true }); + cy.get(homePage.forkAppOrgList) + .children() + .last() + .click({ force: true }); + cy.get(homePage.forkAppOrgButton).click({ force: true }); + cy.wait(4000); + // validating data binding for the forked application + cy.xpath("//input[@value='Submit']").should("be.visible"); + cy.xpath("//div[text()='schema_name']").should("be.visible"); + cy.xpath("//div[text()='information_schema']").should("be.visible"); + cy.xpath("//div[text()='title']").should("be.visible"); + cy.xpath("//div[text()='Recusan']").should("be.visible"); + }); + + it("Export and import application and validate data binding for the widgets", function() { + cy.NavigateToHome(); + cy.get(homePage.searchInput) + .clear() + .type(`${this.appname}`); + cy.wait(2000); + cy.get(homePage.applicationCard) + .first() + .trigger("mouseover"); + cy.get(homePage.appMoreIcon) + .first() + .click({ force: true }); + // export application + cy.get(homePage.exportAppFromMenu).click({ force: true }); + cy.get(homePage.searchInput).clear(); + cy.get(`a[id=t--export-app-link]`).then((anchor) => { + const url = anchor.prop("href"); + cy.request(url).then(({ body, headers }) => { + expect(headers).to.have.property("content-type", "application/json"); + expect(headers).to.have.property( + "content-disposition", + `attachment; filename*=UTF-8''${this.appname}.json`, + ); + cy.writeFile("cypress/fixtures/exportedApp.json", body, "utf-8"); + cy.generateUUID().then((uid) => { + orgid = uid; + localStorage.setItem("OrgName", orgid); + cy.createOrg(); + cy.wait("@createOrg").then((createOrgInterception) => { + newOrganizationName = createOrgInterception.response.body.data.name; + cy.renameOrg(newOrganizationName, orgid); + cy.get(homePage.orgImportAppOption).click({ force: true }); + + cy.get(homePage.orgImportAppModal).should("be.visible"); + cy.xpath(homePage.uploadLogo).attachFile("exportedApp.json"); + // import exported application in new organization + cy.get(homePage.orgImportAppButton).click({ force: true }); + cy.wait("@importNewApplication").then((interception) => { + let appId = interception.response.body.data.id; + let defaultPage = interception.response.body.data.pages.find( + (eachPage) => !!eachPage.isDefault, + ); + cy.get(homePage.toastMessage).should( + "contain", + "Application imported successfully", + ); + // validating data binding for imported application + cy.xpath("//input[@value='Submit']").should("be.visible"); + cy.xpath("//div[text()='schema_name']").should("be.visible"); + cy.xpath("//div[text()='information_schema']").should( + "be.visible", + ); + cy.xpath("//div[text()='title']").should("be.visible"); + cy.xpath("//div[text()='Recusan']").should("be.visible"); + + cy.url().should( + "include", + `/applications/${appId}/pages/${defaultPage.id}/edit`, + ); + }); + }); + }); + }); + }); + }); +});