test: Automated few tests for AForce Migration scenarios + Flaky fixes (#12231)

This commit is contained in:
Aishwarya-U-R 2022-03-31 17:21:08 +05:30 committed by GitHub
parent 186a97c699
commit 9bbd671b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 14430 additions and 1282 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

@ -2,91 +2,713 @@
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 776,
"rightColumn": 647,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1290,
"bottomRow": 1070,
"containerStyle": "none",
"snapRows": 125,
"snapRows": 104,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 46,
"minHeight": 1292,
"version": 53,
"minHeight": 1050,
"parentColumnSpace": 1,
"dynamicBindingPathList": [
],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "Button1",
"onClick": "{{CatImage.run();\nCatFacts.run();\nDogImage.run();\nDogFacts.run();}}",
"buttonColor": "#03B365",
"dynamicPropertyPathList": [
"template": {
"Image1Copy": {
"widgetName": "Image1Copy",
"displayName": "Image",
"iconSVG": "/static/media/icon.52d8fb96.svg",
"topRow": 1,
"bottomRow": 19,
"parentRowSpace": 10,
"type": "IMAGE_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"imageShape": "RECTANGLE",
"leftColumn": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"defaultImage": "https://assets.appsmith.com/widgets/default.png",
"key": "k7gqsx8va7",
"image": "{{List1.listData.map((currentItem) => currentItem.image)}}",
"rightColumn": 13,
"objectFit": "contain",
"widgetId": "6xs9n3qas8",
"logBlackList": {
"isVisible": true,
"defaultImage": true,
"imageShape": true,
"maxZoomLevel": true,
"enableRotation": true,
"enableDownload": true,
"objectFit": true,
"image": true,
"widgetName": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"maxZoomLevel": 1,
"enableDownload": false,
"enableRotation": false
},
"Canvas1": {
"widgetName": "Canvas1",
"displayName": "Canvas",
"topRow": 0,
"bottomRow": 390,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": false,
"hideCard": true,
"dropDisabled": true,
"openParentPropertyPane": true,
"minHeight": 400,
"noPad": true,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
"mno4dkclkn"
],
"key": "st5e69fis5",
"rightColumn": 472.125,
"detachFromLayout": true,
"widgetId": "i7op8tv8mv",
"containerStyle": "none",
"isVisible": true,
"version": 1,
"parentId": "lkyh2v8k8s",
"renderMode": "CANVAS",
"isLoading": false
},
"Container1": {
"boxShadow": "NONE",
"widgetName": "Container1",
"borderColor": "transparent",
"disallowCopy": true,
"isCanvas": true,
"displayName": "Container",
"iconSVG": "/static/media/icon.1977dca3.svg",
"topRow": 0,
"bottomRow": 22,
"dragDisabled": true,
"type": "CONTAINER_WIDGET",
"hideCard": false,
"openParentPropertyPane": true,
"isDeletable": false,
"animateLoading": true,
"leftColumn": 0,
"children": [
"ukkqmnxanx"
],
"borderWidth": "0",
"key": "c509lus1x5",
"disablePropertyPane": true,
"backgroundColor": "white",
"rightColumn": 64,
"widgetId": "mno4dkclkn",
"containerStyle": "card",
"isVisible": true,
"version": 1,
"parentId": "i7op8tv8mv",
"renderMode": "CANVAS",
"isLoading": false,
"borderRadius": "0"
},
"Canvas2": {
"widgetName": "Canvas2",
"detachFromLayout": true,
"displayName": "Canvas",
"widgetId": "ukkqmnxanx",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 210,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"version": 1,
"hideCard": true,
"parentId": "mno4dkclkn",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
"6xs9n3qas8",
"ii4kp8uzl9",
"bx88oni4aa"
],
"key": "st5e69fis5"
},
"Text1": {
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 1,
"bottomRow": 5,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"leftColumn": 14,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "{{List1.listData.map((currentItem) => 'Drink Name: ' + currentItem.name)}}",
"key": "pwuql7fds3",
"rightColumn": 40,
"textAlign": "LEFT",
"widgetId": "ii4kp8uzl9",
"logBlackList": {
"isVisible": true,
"text": true,
"fontSize": true,
"fontStyle": true,
"textAlign": true,
"textColor": true,
"truncateButtonColor": true,
"widgetName": true,
"shouldScroll": true,
"shouldTruncate": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
"Text2": {
"widgetName": "Text2",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 5,
"bottomRow": 19,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"leftColumn": 14,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "{{List1.listData.map((currentItem) => currentItem.instruction)}}",
"key": "pwuql7fds3",
"rightColumn": 62,
"textAlign": "LEFT",
"widgetId": "bx88oni4aa",
"logBlackList": {
"isVisible": true,
"text": true,
"fontSize": true,
"fontStyle": true,
"textAlign": true,
"textColor": true,
"truncateButtonColor": true,
"widgetName": true,
"shouldScroll": true,
"shouldTruncate": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
}
},
"widgetName": "List1",
"listData": "{{CocktailDB.data.drinks.map(item => {\n\treturn {\n\t\timage: item.strDrinkThumb,\n\t\tname: item.strDrink,\n\t\tinstruction: item.strInstructions\n\t}\n})}}",
"isCanvas": true,
"displayName": "List",
"iconSVG": "/static/media/icon.9925ee17.svg",
"topRow": 29,
"bottomRow": 104,
"parentRowSpace": 10,
"type": "LIST_WIDGET",
"hideCard": false,
"gridGap": 0,
"animateLoading": true,
"parentColumnSpace": 19.671875,
"dynamicTriggerPathList": [],
"leftColumn": 12,
"dynamicBindingPathList": [
{
"key": "onClick"
"key": "template.Text1.text"
},
{
"key": "listData"
},
{
"key": "template.Image1Copy.image"
},
{
"key": "template.Text2.text"
},
{
"key": "template.Image1Copy.image"
},
{
"key": "template.Text1.text"
},
{
"key": "template.Text2.text"
}
],
"gridType": "vertical",
"enhancements": true,
"children": [
{
"widgetName": "Canvas1",
"displayName": "Canvas",
"topRow": 0,
"bottomRow": 390,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": false,
"hideCard": true,
"dropDisabled": true,
"openParentPropertyPane": true,
"minHeight": 400,
"noPad": true,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"boxShadow": "NONE",
"widgetName": "Container1",
"borderColor": "transparent",
"disallowCopy": true,
"isCanvas": true,
"displayName": "Container",
"iconSVG": "/static/media/icon.1977dca3.svg",
"topRow": 0,
"bottomRow": 22,
"dragDisabled": true,
"type": "CONTAINER_WIDGET",
"hideCard": false,
"openParentPropertyPane": true,
"isDeletable": false,
"animateLoading": true,
"leftColumn": 0,
"children": [
{
"widgetName": "Canvas2",
"detachFromLayout": true,
"displayName": "Canvas",
"widgetId": "ukkqmnxanx",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 210,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"version": 1,
"hideCard": true,
"parentId": "mno4dkclkn",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Image1Copy",
"displayName": "Image",
"iconSVG": "/static/media/icon.52d8fb96.svg",
"topRow": 1,
"bottomRow": 19,
"parentRowSpace": 10,
"type": "IMAGE_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"imageShape": "RECTANGLE",
"leftColumn": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"defaultImage": "https://assets.appsmith.com/widgets/default.png",
"key": "k7gqsx8va7",
"image": "{{currentItem.image}}",
"rightColumn": 13,
"objectFit": "contain",
"widgetId": "6xs9n3qas8",
"logBlackList": {
"isVisible": true,
"defaultImage": true,
"imageShape": true,
"maxZoomLevel": true,
"enableRotation": true,
"enableDownload": true,
"objectFit": true,
"image": true,
"widgetName": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"maxZoomLevel": 1,
"enableDownload": false,
"enableRotation": false
},
{
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 1,
"bottomRow": 5,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"leftColumn": 14,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "Drink Name: {{currentItem.name}}",
"key": "pwuql7fds3",
"rightColumn": 40,
"textAlign": "LEFT",
"widgetId": "ii4kp8uzl9",
"logBlackList": {
"isVisible": true,
"text": true,
"fontSize": true,
"fontStyle": true,
"textAlign": true,
"textColor": true,
"truncateButtonColor": true,
"widgetName": true,
"shouldScroll": true,
"shouldTruncate": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
{
"widgetName": "Text2",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 5,
"bottomRow": 19,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 10.935302734375,
"dynamicTriggerPathList": [],
"leftColumn": 14,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "{{currentItem.instruction}}",
"key": "pwuql7fds3",
"rightColumn": 62,
"textAlign": "LEFT",
"widgetId": "bx88oni4aa",
"logBlackList": {
"isVisible": true,
"text": true,
"fontSize": true,
"fontStyle": true,
"textAlign": true,
"textColor": true,
"truncateButtonColor": true,
"widgetName": true,
"shouldScroll": true,
"shouldTruncate": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "ukkqmnxanx",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
}
],
"key": "st5e69fis5"
}
],
"borderWidth": "0",
"key": "c509lus1x5",
"disablePropertyPane": true,
"backgroundColor": "white",
"rightColumn": 64,
"widgetId": "mno4dkclkn",
"containerStyle": "card",
"isVisible": true,
"version": 1,
"parentId": "i7op8tv8mv",
"renderMode": "CANVAS",
"isLoading": false,
"borderRadius": "0"
}
],
"key": "st5e69fis5",
"rightColumn": 472.125,
"detachFromLayout": true,
"widgetId": "i7op8tv8mv",
"containerStyle": "none",
"isVisible": true,
"version": 1,
"parentId": "lkyh2v8k8s",
"renderMode": "CANVAS",
"isLoading": false
}
],
"privateWidgets": {
"Image1Copy": true,
"Text1": true,
"Text2": true
},
"key": "zh4de7als8",
"backgroundColor": "transparent",
"rightColumn": 53,
"itemBackgroundColor": "#FFFFFF",
"widgetId": "lkyh2v8k8s",
"isVisible": true,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false
},
{
"widgetName": "Button1",
"buttonColor": "#03B365",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
"topRow": 18,
"bottomRow": 22,
"topRow": 3,
"bottomRow": 7,
"parentRowSpace": 10,
"type": "BUTTON_WIDGET",
"hideCard": false,
"parentColumnSpace": 16.921875,
"animateLoading": true,
"parentColumnSpace": 19.671875,
"dynamicTriggerPathList": [
{
"key": "onClick"
}
],
"leftColumn": 24,
"dynamicBindingPathList": [
],
"text": "Get Facts!",
"leftColumn": 25,
"dynamicBindingPathList": [],
"text": "Invoke APIs!",
"isDisabled": false,
"key": "lys38w8oo5",
"rightColumn": 40,
"key": "f4fix3idzp",
"rightColumn": 41,
"isDefaultClickDisabled": true,
"widgetId": "4q03mtvedv",
"recaptchaV2": false,
"widgetId": "c552h69exh",
"isVisible": true,
"recaptchaType": "V3",
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"buttonVariant": "PRIMARY"
"buttonVariant": "PRIMARY",
"placement": "CENTER",
"onClick": "{{CatImage.run();\nDogImage.run();\nNumberFact.run();\nCocktailDB.run()}}",
"dynamicPropertyPathList": [
{
"key": "onClick"
}
]
},
{
"widgetName": "Image1",
"displayName": "Image",
"iconSVG": "/static/media/icon.52d8fb96.svg",
"topRow": 24,
"bottomRow": 41,
"topRow": 9,
"bottomRow": 28,
"parentRowSpace": 10,
"type": "IMAGE_WIDGET",
"hideCard": false,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [
],
"animateLoading": true,
"parentColumnSpace": 19.671875,
"dynamicTriggerPathList": [],
"imageShape": "RECTANGLE",
"leftColumn": 11,
"leftColumn": 12,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"defaultImage": "https://assets.appsmith.com/widgets/default.png",
"key": "khcxwti5gq",
"key": "k7gqsx8va7",
"image": "{{CatImage.data[0].url}}",
"rightColumn": 31,
"objectFit": "cover",
"widgetId": "t9b2aacss5",
"rightColumn": 24,
"objectFit": "contain",
"widgetId": "14dy28sgfl",
"isVisible": true,
"version": 1,
"parentId": "0",
@ -100,28 +722,27 @@
"widgetName": "Image2",
"displayName": "Image",
"iconSVG": "/static/media/icon.52d8fb96.svg",
"topRow": 24,
"bottomRow": 41,
"topRow": 9,
"bottomRow": 28,
"parentRowSpace": 10,
"type": "IMAGE_WIDGET",
"hideCard": false,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [
],
"animateLoading": true,
"parentColumnSpace": 19.671875,
"dynamicTriggerPathList": [],
"imageShape": "RECTANGLE",
"leftColumn": 33,
"leftColumn": 25,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"defaultImage": "https://assets.appsmith.com/widgets/default.png",
"key": "khcxwti5gq",
"key": "k7gqsx8va7",
"image": "{{DogImage.data.message}}",
"rightColumn": 54,
"objectFit": "cover",
"widgetId": "v4iy6l1z9x",
"rightColumn": 37,
"objectFit": "contain",
"widgetId": "ctl1a3f5iq",
"isVisible": true,
"version": 1,
"parentId": "0",
@ -132,65 +753,34 @@
"enableRotation": false
},
{
"widgetName": "Text1",
"widgetName": "Text3",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 45,
"bottomRow": 65,
"topRow": 9,
"bottomRow": 28,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [
],
"leftColumn": 6,
"animateLoading": true,
"parentColumnSpace": 19.671875,
"dynamicTriggerPathList": [],
"leftColumn": 38,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"text": "{{CatFacts.data.text}}",
"key": "7tipkwe4lq",
"rightColumn": 31,
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "Number fact for you: {{NumberFact.data}}",
"key": "pwuql7fds3",
"rightColumn": 53,
"textAlign": "CENTER",
"widgetId": "d5shcrpvxp",
"widgetId": "mvtnucnzf7",
"isVisible": true,
"fontStyle": "ITALIC,BOLD",
"textColor": "#231F20",
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
{
"widgetName": "Text2",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 45,
"bottomRow": 65,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [
],
"leftColumn": 33,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"text": "{{DogFacts.data.text}}",
"key": "7tipkwe4lq",
"rightColumn": 59,
"textAlign": "CENTER",
"widgetId": "sqllxxccb7",
"isVisible": true,
"fontStyle": "BOLD,ITALIC",
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",

View File

@ -46,4 +46,4 @@
"mockDatabasePassword": "LimitedAccess123#",
"readonly":"readonly",
"authenticatedApiUrl": "https://fakeapi.com"
}
}

View File

@ -0,0 +1,93 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 539,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1320,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 53,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "FilePicker1",
"dynamicPropertyPathList": [],
"displayName": "FilePicker",
"iconSVG": "/static/media/icon.7c5ad9c3.svg",
"topRow": 19,
"bottomRow": 23,
"parentRowSpace": 10,
"allowedFileTypes": [],
"type": "FILE_PICKER_WIDGET_V2",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [
{
"key": "onFilesSelected"
}
],
"leftColumn": 24,
"dynamicBindingPathList": [],
"isDisabled": false,
"key": "p3l7kkj73w",
"onFilesSelected": "",
"isRequired": false,
"rightColumn": 40,
"isDefaultClickDisabled": true,
"widgetId": "fa9qrs8i86",
"isVisible": true,
"label": "Select Files",
"maxFileSize": 5,
"version": 1,
"fileDataType": "Base64",
"parentId": "0",
"selectedFiles": [],
"renderMode": "CANVAS",
"isLoading": false,
"files": [],
"maxNumFiles": 1
},
{
"widgetName": "Image1",
"displayName": "Image",
"iconSVG": "/static/media/icon.52d8fb96.svg",
"topRow": 26,
"bottomRow": 71,
"parentRowSpace": 10,
"type": "IMAGE_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 16.921875,
"dynamicTriggerPathList": [],
"imageShape": "RECTANGLE",
"leftColumn": 18,
"dynamicBindingPathList": [],
"defaultImage": "",
"key": "tfm5uqw4f4",
"image": "",
"rightColumn": 46,
"objectFit": "contain",
"widgetId": "m59cig84vv",
"isVisible": true,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"maxZoomLevel": 1,
"enableDownload": false,
"enableRotation": false
}
]
}
}

View File

@ -1,4 +1,5 @@
import "cypress-xpath";
import "cypress-file-upload";
// data: string;
// cy.fixture("example").then(function (data) {

View File

@ -0,0 +1,564 @@
/// <reference types="Cypress" />
import { ObjectsRegistry } from "../../../support/Objects/Registry";
let homePage = ObjectsRegistry.HomePage,
dataSources = ObjectsRegistry.DataSources,
table = ObjectsRegistry.Table,
agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor;
describe("AForce - Community Issues page validations", function () {
let reconnect = true, selectedRow: number;
it("1. Import application json and validate headers", () => {
homePage.ImportApp("AForceMigrationExport.json", reconnect)
if (reconnect)
dataSources.ReconnectDataSourcePostgres("AForceDB")
//Validate table is not empty!
table.WaitUntilTableLoad()
//Validating order of header columns!
table.AssertTableHeaderOrder("TypeTitleStatus+1CommentorsVotesAnswerUpVoteStatesupvote_ididgithub_issue_idauthorcreated_atdescriptionlabelsstatelinkupdated_at")
//Validating hidden columns:
table.AssertHiddenColumns(['States', 'upvote_id', 'id', 'github_issue_id', 'author', 'created_at', 'description', 'labels', 'state', 'link', 'updated_at'])
});
it("2. Validate table navigation with Server Side pagination enabled with Default selected row", () => {
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Table1")
agHelper.AssertExistingToggleState("serversidepagination", 'checked')
agHelper.EvaluateExistingPropertyFieldValue("Default Selected Row")
.then($selectedRow => {
selectedRow = Number($selectedRow);
table.AssertSelectedRow(selectedRow)
});
agHelper.DeployApp()
table.WaitUntilTableLoad()
//Verify hidden columns are infact hidden in deployed app!
table.AssertTableHeaderOrder("TypeTitleStatus+1CommentorsVotesAnswerUpVote")//from case #1
table.AssertSelectedRow(selectedRow)//Assert default selected row
table.AssertPageNumber(1);
table.NavigateToNextPage()//page 2
agHelper.Sleep(3000)//wait for table navigation to take effect!
table.WaitUntilTableLoad()
table.AssertSelectedRow(selectedRow)
table.NavigateToNextPage()//page 3
agHelper.Sleep(3000)//wait for table navigation to take effect!
table.WaitForTableEmpty()//page 3
table.NavigateToPreviousPage()//page 2
agHelper.Sleep(3000)//wait for table navigation to take effect!
table.WaitUntilTableLoad()
table.AssertSelectedRow(selectedRow)
table.NavigateToPreviousPage()//page 1
agHelper.Sleep(3000)//wait for table navigation to take effect!
table.WaitUntilTableLoad()
table.AssertSelectedRow(selectedRow)
table.AssertPageNumber(1);
})
it("3. Validate table navigation with Server Side pagination disabled with Default selected row selection", () => {
agHelper.NavigateBacktoEditor()
table.WaitUntilTableLoad()
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Table1")
agHelper.ToggleOnOrOff('serversidepagination', 'Off')
agHelper.DeployApp()
table.WaitUntilTableLoad()
table.AssertPageNumber(1, 'Off');
table.AssertSelectedRow(selectedRow)
agHelper.NavigateBacktoEditor()
table.WaitUntilTableLoad()
ee.SelectEntityByName("Table1")
agHelper.ToggleOnOrOff('serversidepagination', 'On')
});
it("4. Change Default selected row in table and verify", () => {
jsEditor.EnterJSContext("defaultselectedrow", "1", true)
agHelper.DeployApp()
table.WaitUntilTableLoad()
table.AssertPageNumber(1);
table.AssertSelectedRow(1)
table.NavigateToNextPage()//page 2
table.AssertPageNumber(2);
table.AssertSelectedRow(1)
agHelper.NavigateBacktoEditor()
table.WaitUntilTableLoad()
});
// it("4. Verify Default search text in table as per 'Default Search Text' property set", () => {
// });
// it.skip("5. Validate Search table with Client Side Search enabled & disabled", () => {
// })
// it.skip("6. Validate Filter table", () => {
// })
// it.skip("7. Validate Filter table", () => {
// })
// it.skip("8. Validate Updating issue from Details tab", () => {
// })
// it.skip("9. Validate Adding a New issue from Add Modal", () => {
// })
// it.skip("10. Validate Deleting the newly created issue", () => {
// //Validating Id column sorting happens as Datatype is Number in app!
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='id']",
// )
// .click()
// .wait(2000);
// cy.readTabledataPublish("0", "1").then((cellData) => {
// expect(cellData).to.be.equal("100");
// });
// cy.readTabledataPublish("1", "1").then((cellData) => {
// expect(cellData).to.be.equal("99");
// });
// cy.readTabledataPublish("2", "1").then((cellData) => {
// expect(cellData).to.be.equal("98");
// });
// //Revert the Id column sorting!
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='id']",
// )
// .click()
// .wait(2000);
// cy.readTabledataPublish("0", "1").then((cellData) => {
// expect(cellData).to.be.equal("1");
// });
// cy.readTabledataPublish("1", "1").then((cellData) => {
// expect(cellData).to.be.equal("2");
// });
// cy.readTabledataPublish("2", "1").then((cellData) => {
// expect(cellData).to.be.equal("3");
// });
// //Validating image column is present:
// cy.getTableDataSelector("0", "10").then((selector) => {
// cy.get(selector + " div")
// .invoke("attr", "class")
// .then((classes) => {
// cy.log("classes are:" + classes);
// expect(classes).to.eq("image-cell");
// });
// });
// //Card Number mapping to text widget!
// cy.isSelectRow(2);
// cy.wait(2500); //time for table row select to reflect!
// cy.readTabledataPublish("2", "0").then((cardNumber) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]")
// .eq(1)
// .invoke("text")
// .then((cardNo) => {
// var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
// expect(cardNumber).match(format);
// expect(cardNumber).to.be.equal(cardNo);
// });
// });
// //Address mapping to text widget!
// cy.readTabledataPublish("2", "4").then((address) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(1)
// .invoke("text")
// .then((addr) => {
// expect(address.replace(/\r?\n|\r/, "")).to.eq(addr);
// });
// });
// //Validating Available limit column computation maintained!
// cy.readTabledataPublish("2", "16").then((availLimit) => {
// cy.readTabledataPublish("2", "13").then((creditLimit) => {
// cy.readTabledataPublish("2", "14").then((outstanding) => {
// expect(Number(availLimit)).to.eq(creditLimit - outstanding);
// });
// });
// });
// //Validating State button click & binding & text widget mapping!
// cy.getTableDataSelector("2", "15").then((selector) => {
// cy.get(selector + " button.bp3-button")
// .click()
// .wait(3000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "State:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500));
// cy.get(selector + " button span")
// .invoke("text")
// .then((statetxt) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(0)
// .invoke("text")
// .then((txtWidtxt) => {
// cy.log("statetxt is:" + statetxt);
// let text =
// statetxt == "Activate" ? "State:Inactive" : "State:Active";
// expect(text).to.eq(txtWidtxt);
// });
// });
// });
// //Validating Image URL click & navigation!
// cy.getTableDataSelector("2", "19").then((selector) => {
// // Stubbing window.open to open in the same tab
// cy.window().then((window) => {
// cy.stub(window, "open").callsFake((url) => {
// window.location.href = url; //.substring(1);
// window.location.target = "_self";
// });
// });
// cy.get(selector + " span.bp3-popover-target span")
// .invoke("text")
// .then((url) => {
// cy.get(selector + " span.bp3-popover-target")
// .click()
// .wait(2000);
// cy.wait("@postExecute");
// cy.url().should("contain", url);
// cy.go(-1);
// });
// });
// // cy.wait(4000);
// // cy.get("div.tableWrap").should("be.visible"); //wait for page load!
// cy.waitUntil(
// () => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"),
// {
// errorMsg: "Page is not loaded evn after 10 secs",
// timeout: 30000,
// interval: 2000,
// },
// ).then(() => cy.wait(1000)); //wait for page load!
// cy.isSelectRow(2); //as aft refresh row selection is also gone
// cy.getTableDataSelector("2", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a",
// )
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Add");
// });
// });
// //Manu Btn validation: - 2nd menu item
// cy.getTableDataSelector("2", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a",
// )
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Reduce");
// });
// });
// //Another row!
// //Card Number mapping to text widget!
// cy.isSelectRow(4);
// cy.wait(2500); //time for table row select to reflect!
// cy.readTabledataPublish("4", "0").then((cardNumber) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]")
// .eq(1)
// .invoke("text")
// .then((cardNo) => {
// var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
// expect(cardNumber).match(format);
// expect(cardNumber).to.be.equal(cardNo);
// });
// });
// //Address mapping to text widget!
// cy.readTabledataPublish("4", "4").then((address) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(1)
// .invoke("text")
// .then((addr) => {
// expect(address.replace(/\r?\n|\r/, "")).to.eq(addr);
// });
// });
// //Validating Available limit column computation maintained!
// cy.readTabledataPublish("4", "16").then((availLimit) => {
// cy.readTabledataPublish("4", "13").then((creditLimit) => {
// cy.readTabledataPublish("4", "14").then((outstanding) => {
// expect(Number(availLimit)).to.eq(creditLimit - outstanding);
// });
// });
// });
// //Validating State button click & binding & text widget mapping!
// cy.getTableDataSelector("4", "15").then((selector) => {
// cy.get(selector + " button.bp3-button")
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "State:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500));
// cy.get(selector + " button span")
// .invoke("text")
// .then((statetxt) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(0)
// .invoke("text")
// .then((txtWidtxt) => {
// cy.log("statetxt is:" + statetxt);
// let text =
// statetxt == "Activate" ? "State:Inactive" : "State:Active";
// expect(text).to.eq(txtWidtxt);
// });
// });
// });
// //Validating Image URL click & navigation!
// cy.getTableDataSelector("4", "19").then((selector) => {
// // Stubbing window.open to open in the same tab
// cy.window().then((window) => {
// cy.stub(window, "open").callsFake((url) => {
// window.location.href = url; //.substring(1);
// window.location.target = "_self";
// });
// });
// cy.get(selector + " span.bp3-popover-target span")
// .invoke("text")
// .then((url) => {
// cy.get(selector + " span.bp3-popover-target")
// .click()
// .wait(2000);
// cy.wait("@postExecute");
// cy.url().should("contain", url);
// cy.go(-1);
// });
// });
// //cy.wait(4000);
// //cy.get("div.tableWrap").should("be.visible");
// cy.waitUntil(
// () => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"),
// {
// errorMsg: "Page is not loaded evn after 10 secs",
// timeout: 30000,
// interval: 2000,
// },
// ).then(() => cy.wait(1000)); //wait for page load!
// //Manu Btn validation: - 1st menu item
// cy.isSelectRow(4); //as aft refresh row selection is also gone
// cy.getTableDataSelector("4", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a",
// )
// .click()
// .wait(2000); //allow time for n/w to finish
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Add");
// });
// });
// //Manu Btn validation: - 2nd menu item
// cy.getTableDataSelector("4", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a",
// )
// .click()
// .wait(2000); //allow time for n/w to finish
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Reduce");
// });
// });
// });
// //Page 2 Validations:
// cy.selectEntityByName("Change color and font");
// cy.selectEntityByName("WIDGETS");
// cy.selectEntityByName("Table1");
// cy.get(widgetsPage.bold)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true);
// cy.get(widgetsPage.centerAlign)
// .eq(0)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true); //Text align
// cy.get(widgetsPage.centerAlign)
// .eq(1)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true); //Vertical align
// cy.get(widgetsPage.textColor)
// .first()
// .invoke("attr", "value")
// .should("contain", "#2E3D49");
// cy.get(`${widgetsPage.cellBackground} input`)
// .first()
// .invoke("attr", "value")
// .should("contain", "#FFC13D");
// cy.get(widgetsPage.selectedTextSize).should("have.text", "24px");
//});
});

View File

@ -1,36 +1,26 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const testdata = require("../../../../fixtures/testdata.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const {
AggregateHelper,
} = require("../../../../support/Pages/AggregateHelper");
const helper = new AggregateHelper();
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
describe("API Panel Test Functionality ", function() {
it("Test API copy/Move/delete feature", function() {
cy.log("Login Successful");
cy.Createpage("SecondPage");
cy.NavigateToAPI_Panel();
cy.log("Navigation to API Panel screen successful");
cy.CreateAPI("FirstAPI");
cy.enterDatasourceAndPath(testdata.baseUrl, "{{ '/random' }}");
cy.log("Creation of FirstAPI Action successful");
helper.ActionContextMenuByEntityName(
"FirstAPI",
"Copy to page",
"SecondPage",
);
cy.assertPageSave();
cy.get("body").click(0, 0);
ee.expandCollapseEntity("QUERIES/JS");
ee.ActionContextMenuByEntityName("FirstAPI", "Copy to page", "SecondPage");
// click on learn how link
cy.get(".t--learn-how-apis-link").click();
// this should open in a global search modal
cy.get(commonlocators.globalSearchModal);
cy.get("body").click(0, 0);
helper.ActionContextMenuByEntityName(
"FirstAPICopy",
"Move to page",
"Page1",
);
ee.ActionContextMenuByEntityName("FirstAPICopy", "Move to page", "Page1");
cy.wait(2000);
cy.get(".t--entity-name")
.contains("FirstAPICopy")

View File

@ -0,0 +1,136 @@
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
apiPage = ObjectsRegistry.ApiPage,
locator = ObjectsRegistry.CommonLocators;
describe("Validate API request body panel", () => {
it("1. Check whether input and type dropdown selector exist when multi-part is selected", () => {
apiPage.CreateApi("FirstAPI", 'POST');
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('FORM_URLENCODED')
apiPage.CheckElementPresence(apiPage._bodyKey(0))
apiPage.CheckElementPresence(apiPage._bodyValue(0))
apiPage.SelectSubTab('MULTIPART_FORM_DATA')
apiPage.CheckElementPresence(apiPage._bodyKey(0))
apiPage.CheckElementPresence(apiPage._bodyTypeDropdown)
apiPage.CheckElementPresence(apiPage._bodyValue(0))
agHelper.ActionContextMenuWithInPane('Delete')
});
it("2. Checks whether No body error message is shown when None API body content type is selected", function () {
apiPage.CreateApi("FirstAPI", 'GET');
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('NONE')
cy.get(apiPage._noBodyMessageDiv).contains(apiPage._noBodyMessage);
agHelper.ActionContextMenuWithInPane('Delete')
});
it("3. Checks whether header content type is being changed when FORM_URLENCODED API body content type is selected", function () {
apiPage.CreateApi("FirstAPI", 'POST');
apiPage.ValidateHeaderParams({
key: "content-type",
value: "application/json",
});
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('FORM_URLENCODED')
apiPage.ValidateHeaderParams({
key: "content-type",
value: "application/x-www-form-urlencoded",
});
agHelper.ActionContextMenuWithInPane('Delete')
});
it("4. Checks whether header content type is being changed when MULTIPART_FORM_DATA API body content type is selected", function () {
apiPage.CreateApi("FirstAPI", 'POST');
apiPage.ValidateHeaderParams({
key: "content-type",
value: "application/json",
});
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('MULTIPART_FORM_DATA')
apiPage.ValidateHeaderParams({
key: "content-type",
value: "multipart/form-data",
});
agHelper.ActionContextMenuWithInPane('Delete')
});
it("5. Checks whether content type 'FORM_URLENCODED' is preserved when user selects None API body content type", function () {
apiPage.CreateApi("FirstAPI", 'POST');
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('FORM_URLENCODED')
apiPage.SelectSubTab('NONE')
apiPage.ValidateHeaderParams({
key: "content-type",
value: "application/x-www-form-urlencoded",
});
agHelper.ActionContextMenuWithInPane('Delete')
});
it("6. Checks whether content type 'MULTIPART_FORM_DATA' is preserved when user selects None API body content type", function () {
apiPage.CreateApi("FirstAPI", 'POST');
apiPage.SelectAPITab('Body')
apiPage.SelectSubTab('MULTIPART_FORM_DATA')
apiPage.SelectSubTab('NONE')
apiPage.ValidateHeaderParams({
key: "content-type",
value: "multipart/form-data",
});
agHelper.ActionContextMenuWithInPane('Delete')
});
it("7. Checks MultiPart form data for a File Type upload", () => {
let imageNameToUpload = "ConcreteHouse.jpg";
cy.fixture('multiPartFormDataDsl').then((val: any) => {
agHelper.AddDsl(val)
});
apiPage.CreateAndFillApi('https://api.cloudinary.com/v1_1/appsmithautomationcloud/image/upload?upload_preset=fbbhg4xu', 'CloudinaryUploadApi', 'POST')
apiPage.EnterBodyFormData('MULTIPART_FORM_DATA', 'file', '{{FilePicker1.files[0]}}', 'File')
jsEditor.CreateJSObject(`export default {
myVar1: [],
myVar2: {},
upload: async () => {
await CloudinaryUploadApi.run().then(()=> showAlert('Image uploaded to Cloudinary successfully', 'success')).catch(err => showAlert(err.message, 'error'));
await resetWidget('FilePicker1', true);
}
}`, true, true, false);
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.SelectEntityByName("FilePicker1");
jsEditor.EnterJSContext('onfilesselected', `{{JSObject1.upload()}}`, true, true);
ee.SelectEntityByName("Image1");
jsEditor.EnterJSContext('image', '{{CloudinaryUploadApi.data.url}}')
agHelper.ClickButton('Select Files');
agHelper.UploadFile(imageNameToUpload)
agHelper.ValidateToastMessage("Image uploaded to Cloudinary successfully")
agHelper.Sleep()
cy.xpath(apiPage._imageSrc).find('img')
.invoke('attr', 'src').then($src => {
expect($src).not.eq("https://assets.appsmith.com/widgets/default.png")
})
apiPage.CheckElementPresence(locator._spanButton('Select Files'))//verifying if reset!
});
it("8. Checks MultiPart form data for a Array Type upload results in API error", () => {
let imageNameToUpload = "AAAFlowerVase.jpeg";
ee.expandCollapseEntity("QUERIES/JS")//to expand widgets
ee.SelectEntityByName("CloudinaryUploadApi");
apiPage.EnterBodyFormData('MULTIPART_FORM_DATA', 'file', '{{FilePicker1.files[0]}}', 'Array', true)
ee.SelectEntityByName("FilePicker1");
agHelper.ClickButton('Select Files');
agHelper.UploadFile(imageNameToUpload, false)
agHelper.ValidateToastMessage("CloudinaryUploadApi failed to execute")
apiPage.CheckElementPresence(locator._spanButton('Select Files'))//verifying if reset!
agHelper.AssertDebugError("Execution failed with status 400 BAD_REQUEST", '{"error":{"message":"Unsupported source URL: {\\"type\\":\\"image/jpeg\\"')
});
});

View File

@ -1,68 +0,0 @@
const testdata = require("../../../../fixtures/testdata.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
import apiEditor from "../../../../locators/ApiEditor";
describe("API Panel request body", function() {
it("Check whether input and type dropdown selector exist when multi-part is selected", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("FirstAPI");
cy.SelectAction(testdata.postAction);
cy.contains(apiEditor.bodyTab).click();
cy.get(`[data-cy=${testdata.apiContentTypeForm}]`).click();
cy.get(`[data-cy=${testdata.apiContentTypeMultiPart}]`).click();
cy.get(apiwidget.formEncoded).should("be.visible");
cy.get(apiwidget.multipartTypeDropdown).should("be.visible");
cy.DeleteAPI();
});
it("Checks whether No body error message is shown when None API body content type is selected", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("FirstAPI");
cy.SelectAction(testdata.getAction);
cy.contains(apiEditor.bodyTab).click();
cy.get(`[data-cy=${testdata.apiContentTypeNone}]`).click();
cy.get(testdata.noBodyErrorMessageDiv).should("exist");
cy.get(testdata.noBodyErrorMessageDiv).contains(
testdata.noBodyErrorMessage,
);
cy.DeleteAPI();
});
it("Checks whether header content type is being changed when FORM_URLENCODED API body content type is selected", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("FirstAPI");
cy.SelectAction(testdata.postAction);
cy.contains(apiEditor.bodyTab).click({ force: true });
cy.get(`[data-cy=${testdata.apiContentTypeForm}]`).click();
cy.contains(apiEditor.headersTab).click({ force: true });
cy.get(apiwidget.headerKey).contains(testdata.headerKey.toLowerCase());
cy.get(apiwidget.headerValue).contains(testdata.apiFormDataHeaderValue);
cy.DeleteAPI();
});
it("Checks whether content type is preserved when user selects None API body content type", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("FirstAPI");
cy.SelectAction(testdata.postAction);
cy.contains(apiEditor.bodyTab).click({ force: true });
cy.get(`[data-cy=${testdata.apiContentTypeForm}]`).click({ force: true });
cy.get(`[data-cy=${testdata.apiContentTypeNone}]`).click({ force: true });
cy.contains(apiEditor.headersTab).click({ force: true });
cy.get(apiwidget.headerKey).contains(testdata.headerKey.toLowerCase());
cy.get(apiwidget.headerValue).contains(testdata.apiFormDataHeaderValue);
cy.DeleteAPI();
});
});

View File

@ -1,10 +1,9 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators;
describe("Validate Create Api and Bind to Table widget via JSObject", () => {
before(() => {
@ -15,9 +14,9 @@ describe("Validate Create Api and Bind to Table widget via JSObject", () => {
it("1. Bind Input widget with JSObject", function () {
jsEditor.CreateJSObject('return "Success";', false);
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.expandCollapseEntity("Form1")
agHelper.SelectEntityByName("Input2")
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.expandCollapseEntity("Form1")
ee.SelectEntityByName("Input2")
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext("defaulttext", "{{" + jsObjName + ".myFun1()}}")
});
@ -33,8 +32,8 @@ describe("Validate Create Api and Bind to Table widget via JSObject", () => {
it.skip("2. Bug 10284, 11529 - Verify timeout issue with running JS Objects", function () {
jsEditor.CreateJSObject('return "Success";', true);
agHelper.expandCollapseEntity("Form1")
agHelper.SelectEntityByName("Input2")
ee.expandCollapseEntity("Form1")
ee.SelectEntityByName("Input2")
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext("defaulttext", "{{" + jsObjName + ".myFun1()}}")
});

View File

@ -1,14 +1,12 @@
import { ApiPage } from "../../../../support/Pages/ApiPage";
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
const apiPage = new ApiPage();
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let dataSet: any, valueToTest: any, jsName: any;
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators,
apiPage = ObjectsRegistry.ApiPage;
describe("Validate Create Api and Bind to Table widget via JSObject", () => {
before(() => {
@ -38,8 +36,8 @@ describe("Validate Create Api and Bind to Table widget via JSObject", () => {
});
it("2. Validate the Api data is updated on List widget", function () {
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("List1");
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.SelectEntityByName("List1");
jsEditor.EnterJSContext("items", "{{" + jsName as string + ".myFun1()}}")
cy.get(locator._textWidget).should("have.length", 8);
cy.get(locator._textWidget)
@ -61,8 +59,8 @@ describe("Validate Create Api and Bind to Table widget via JSObject", () => {
it("3. Validate the List widget ", function () {
agHelper.NavigateBacktoEditor()
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("List1");
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.SelectEntityByName("List1");
jsEditor.EnterJSContext("itemspacing\\(px\\)", "50")
cy.get(locator._textWidget).should("have.length", 6);
cy.get(locator._textWidget)

View File

@ -1,12 +1,10 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let dataSet: any;
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators;
describe("Loadash basic test with input Widget", () => {
@ -21,16 +19,16 @@ describe("Loadash basic test with input Widget", () => {
});
it("1. Input widget test with default value for atob method", () => {
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Input1")
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Input1")
jsEditor.EnterJSContext("defaulttext", dataSet.defaultInputBinding + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("2. Input widget test with default value for btoa method", function () {
agHelper.SelectEntityByName("Input2")
ee.SelectEntityByName("Input2")
jsEditor.EnterJSContext("defaulttext", dataSet.loadashInput + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("3. Publish and validate the data displayed in input widgets value for aToB and bToa", function () {

View File

@ -1,12 +1,10 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let dataSet: any;
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators;
describe("Validate basic binding of Input widget to Input widget", () => {
@ -21,16 +19,16 @@ describe("Validate basic binding of Input widget to Input widget", () => {
});
it("1. Input widget test with default value from another Input widget", () => {
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Input1")
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Input1")
jsEditor.EnterJSContext("defaulttext", dataSet.defaultInputBinding + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("2. Binding second input widget with first input widget and validating", function () {
agHelper.SelectEntityByName("Input2")
ee.SelectEntityByName("Input2")
jsEditor.EnterJSContext("defaulttext", dataSet.momentInput + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("3. Publish widget and validate the data displayed in input widgets", function () {

View File

@ -1,12 +1,10 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
import { ApiPage } from "../../../../support/Pages/ApiPage";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
const apiPage = new ApiPage();
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators,
apiPage = ObjectsRegistry.ApiPage;
describe("Validate basic operations on Entity explorer JSEditor structure", () => {
@ -15,22 +13,20 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', "{{storeValue('date', Date()).then(() => showAlert(appsmith.store.date))}}", true, true);
agHelper.ClickButton('Submit')
cy.log("Date is:" + date)
cy.get(locator._toastMsg)
.should("have.length", 1)
.should("contain.text", date);
})
agHelper.ValidateToastMessage(date)
});
it("2. Verify resolve & chaining via direct Promises", () => {
cy.fixture("promisesBtnDsl").then((val: any) => {
agHelper.AddDsl(val);
});
agHelper.expandCollapseEntity("WIDGETS");
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS");
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
`{{
@ -43,9 +39,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
}).catch(err => { showAlert(err, 'error') });
}}`, true, true);
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg)
.should("have.length", 1)
.should("contain.text", "We are on planet Earth");
agHelper.ValidateToastMessage('We are on planet Earth')
});
it("3. Verify Async Await in direct Promises", () => {
@ -61,8 +55,8 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
key: "name",
value: "{{this.params.country}}",
}); // verifies Bug 10055
agHelper.expandCollapseEntity("WIDGETS");
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS");
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
`{{(async function(){
@ -93,8 +87,8 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
"https://source.unsplash.com/collection/8439505",
"Christmas",
);
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
`{{
@ -107,7 +101,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
true,
true,
);
agHelper.SelectEntityByName("Image1");
ee.SelectEntityByName("Image1");
jsEditor.EnterJSContext("image", `{{Christmas.data}}`, true);
agHelper.WaitUntilEleDisappear(
locator._toastMsg,
@ -126,15 +120,13 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
apiPage.CreateAndFillApi("https://favqs.com/api/qotd", "InspiringQuotes");
jsEditor.CreateJSObject(`const user = 'You';
return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + " is " + JSON.stringify(res.quote.body), 'success') }).catch(() => showAlert("Unable to fetch quote for " + user, 'warning'))`);
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".myFun1()}}", true, true);
})
agHelper.ClickButton("Submit");
cy.get(locator._toastMsg)
.should("have.length", 1)
.should("contain.text", "Today's quote for You");
agHelper.ValidateToastMessage("Today's quote for You")
});
it("6. Verify Promise.race via direct Promises", () => {
@ -143,8 +135,8 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
});
apiPage.CreateAndFillApi("https://api.agify.io?name={{this.params.person}}", "Agify")
apiPage.ValidateQueryParams({ key: "name", value: "{{this.params.person}}" }); // verifies Bug 10055
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', `{{ Promise.race([Agify.run({ person: 'Melinda' }), Agify.run({ person: 'Trump' })]).then((res) => { showAlert('Winner is ' + JSON.stringify(res.name), 'success') }) }} `, true, true);
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).contains(/Melinda|Trump/g)
@ -158,8 +150,8 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
"https://api.jikan.moe/v3/search/anime?q={{this.params.name}}",
"GetAnime",
);
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("List1");
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("List1");
jsEditor.EnterJSContext(
"items",
`[{
@ -183,7 +175,7 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
locator._toastMsg,
"will be executed automatically on page load",
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
`{{
@ -207,8 +199,8 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS")//to expand widgets
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', `{{
(function () {
let agifyy = [];
@ -221,7 +213,7 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
})()
}} `, true, true);
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).should("have.text", "cat,dog,camel,rabbit,rat")
agHelper.ValidateToastMessage("cat,dog,camel,rabbit,rat")
});
it("9. Bug 10150: Verify Promise.all via JSObjects", () => {
@ -240,9 +232,9 @@ showAlert("Running all api's", "warning");
return Promise.all(allFuncs).then(() =>
showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Please check your api's again", "error")); `)
agHelper.expandCollapseEntity("WIDGETS")
ee.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{storeValue('date', Date()).then(() => { showAlert(appsmith.store.date, 'success'); return " + jsObjName + ".myFun1()})}}", true, true);
});
@ -275,8 +267,8 @@ showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Ple
return Promise.any([this.func2(), this.func3(), this.func1()]).then((value) => showAlert("Resolved promise is:" + value))
}
}`, true, true)
agHelper.expandCollapseEntity('WIDGETS')
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity('WIDGETS')
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".runAny()}}", true, true);
});
@ -291,8 +283,8 @@ showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Ple
cy.fixture("promisesBtnDsl").then((dsl: any) => {
agHelper.AddDsl(dsl);
});
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
"{{resetWidget('Input1').then(() => showAlert(Input1.text))}}",
@ -302,10 +294,7 @@ showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Ple
agHelper.DeployApp();
cy.get(locator._inputWidgetInDeployed).type("Update value");
agHelper.ClickButton("Submit");
cy.get(locator._toastMsg)
.should("have.length", 1)
.should("contain.text", "Test");
agHelper.ValidateToastMessage("Test")
agHelper.NavigateBacktoEditor()
})
@ -316,12 +305,12 @@ showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Ple
});
jsEditor.CreateJSObject(`const user = 'You';
InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + " is " + JSON.stringify(res.quote.body), 'success') }).catch(() => showAlert("Unable to fetch quote for " + user, 'warning'))`);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".myFun1()}}", true, true);
});
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).should("contain.text", "Today's quote for You");
agHelper.ValidateToastMessage("Today's quote for You")
});
})

View File

@ -1,13 +1,11 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let dataSet: any;
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators;
describe("Validate basic binding of Input widget to Input widget", () => {
before(() => {
@ -21,16 +19,16 @@ describe("Validate basic binding of Input widget to Input widget", () => {
});
it("1. Input widget test with default value for atob method", () => {
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Input1")
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Input1")
jsEditor.EnterJSContext("defaulttext", dataSet.atobInput + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("2. Input widget test with default value for btoa method", function () {
agHelper.SelectEntityByName("Input2")
ee.SelectEntityByName("Input2")
jsEditor.EnterJSContext("defaulttext", dataSet.btoaInput + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("3. Publish and validate the data displayed in input widgets value for aToB and bToa", function () {

View File

@ -66,6 +66,7 @@ describe("Comments", function() {
.its("length")
.should("eq", 2);
});
it("Completing comments tour adds bot comment in first thread", function() {
cy.generateUUID().then((uid) => {
cy.Signup(`${uid}@appsmithtest.com`, uid);

View File

@ -1,12 +1,10 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
let dataSet: any, dsl: any;
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators;
describe("Input widget test with default value from chart datapoint", () => {
@ -21,14 +19,14 @@ describe("Input widget test with default value from chart datapoint", () => {
});
it("1. Input widget test with default value from another Input widget", () => {
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Input1")
ee.expandCollapseEntity("WIDGETS")
ee.SelectEntityByName("Input1")
jsEditor.EnterJSContext("defaulttext", dataSet.bindChartData + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')
agHelper.ValidateNetworkStatus('@updateLayout')
});
it("2. Chart with datapoint feature validation", function () {
agHelper.SelectEntityByName("Chart1")
ee.SelectEntityByName("Chart1")
agHelper.SelectPropertiesDropDown("ondatapointclick", "Show message")
agHelper.EnterActionValue("Message", dataSet.bindingDataPoint)
agHelper.XpathNClick("(//*[local-name()='rect'])[13]")
@ -40,7 +38,7 @@ describe("Input widget test with default value from chart datapoint", () => {
})
it("3. Chart with seriesTitle feature validation", function () {
agHelper.SelectEntityByName("Input2")
ee.SelectEntityByName("Input2")
jsEditor.EnterJSContext("defaulttext", dataSet.bindingSeriesTitle + "}}");
cy.get(locator._inputWidget).last().should("have.value", dsl.dsl.children[0].chartData[0].seriesName);
});

View File

@ -1,19 +1,19 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const locator = new CommonLocators();
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
locator = ObjectsRegistry.CommonLocators;
describe("DocumentViewer Widget Functionality", () => {
it("1. Add new DocumentViewer and verify in canvas", () => {
agHelper.DragDropWidgetNVerify("documentviewerwidget", 300, 300);
ee.DragDropWidgetNVerify("documentviewerwidget", 300, 300);
});
it("2. Modify visibility & Publish app & verify", () => {
agHelper.NavigateToExplorer();
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOrDisable("visible", false);
ee.NavigateToSwitcher('explorer')
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOnOrOff("visible", 'Off');
agHelper.DeployApp();
cy.get(locator._widgetInDeployed("documentviewerwidget")).should(
"not.exist",
@ -22,9 +22,9 @@ describe("DocumentViewer Widget Functionality", () => {
});
it("3. Change visibility & Publish app & verify again", () => {
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOrDisable("visible");
ee.expandCollapseEntity("WIDGETS"); //to expand widgets
ee.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOnOrOff("visible", 'On');
agHelper.DeployApp();
cy.get(locator._widgetInDeployed("documentviewerwidget")).should("exist");
});

View File

@ -1,11 +1,9 @@
const explorer = require("../../../../locators/explorerlocators.json");
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
const firstApiName = "First";
const secondApiName = "Second";
const {
AggregateHelper,
} = require("../../../../support/Pages/AggregateHelper");
const helper = new AggregateHelper();
describe("Api Naming conflict on a page test", function() {
it("expects actions on the same page cannot have identical names", function() {
@ -17,7 +15,7 @@ describe("Api Naming conflict on a page test", function() {
// create another API
cy.NavigateToAPI_Panel();
cy.CreateAPI(secondApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
ee.expandCollapseEntity("QUERIES/JS", true);
// try to rename one of the APIs with an existing API name
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
@ -46,11 +44,11 @@ describe("Api Naming conflict on different pages test", function() {
cy.log("Login Successful");
// create a new API
cy.CreateAPI(firstApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
ee.expandCollapseEntity("QUERIES/JS", true);
// create a new page and an API on that page
cy.Createpage("Page2");
cy.CreateAPI(firstApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
ee.expandCollapseEntity("QUERIES/JS", true);
cy.get(".t--entity-name")
.contains(firstApiName)
.should("exist");
@ -73,7 +71,7 @@ describe("Api Naming conflict on different pages test", function() {
describe("Entity Naming conflict test", function() {
it("expects JS objects and actions to not have identical names on the same page.", function() {
cy.log("Login Successful");
helper.expandCollapseEntity("QUERIES/JS", true);
ee.expandCollapseEntity("QUERIES/JS", true);
// create JS object and name it
cy.createJSObject('return "Hello World";');

View File

@ -4,9 +4,9 @@ const datasource = require("../../../../locators/DatasourcesEditor.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const pages = require("../../../../locators/Pages.json");
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
const AHelper = new AggregateHelper();
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
const pageid = "MyPage";
let datasourceName;
@ -93,7 +93,7 @@ describe("Entity explorer tests related to query and datasource", function() {
cy.EvaluateCurrentValue("select * from users");
cy.get(".t--action-name-edit-field").click({ force: true });
AHelper.ActionContextMenuByEntityName("Query1", "Show Bindings");
ee.ActionContextMenuByEntityName("Query1", "Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(5);
expect($lis.eq(0)).to.contain("{{Query1.isLoading}}");
@ -102,9 +102,9 @@ describe("Entity explorer tests related to query and datasource", function() {
expect($lis.eq(3)).to.contain("{{Query1.run()}}");
expect($lis.eq(4)).to.contain("{{Query1.clear()}}");
});
AHelper.ActionContextMenuByEntityName("Query1", "Edit Name");
ee.ActionContextMenuByEntityName("Query1", "Edit Name");
cy.EditApiNameFromExplorer("MyQuery");
AHelper.ActionContextMenuByEntityName("MyQuery", "Move to page", pageid);
ee.ActionContextMenuByEntityName("MyQuery", "Move to page", pageid);
cy.get(".t--entity-name")
.contains("MyQuery")
.click();

View File

@ -1,9 +1,6 @@
const testdata = require("../../../../fixtures/testdata.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const explorer = require("../../../../locators/explorerlocators.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const dsl = require("../../../../fixtures/formWidgetdsl.json");
const pageid = "MyPage";

View File

@ -2,9 +2,9 @@ const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const dsl = require("../../../../fixtures/formWithInputdsl.json");
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
const AgHelper = new AggregateHelper();
let ee = ObjectsRegistry.EntityExplorer;
const pageid = "MyPage";
before(() => {
@ -42,9 +42,9 @@ describe("Test Suite to validate copy/delete/undo functionalites", function() {
200,
);
cy.get("body").type(`{${modifierKey}}z`);
AgHelper.expandCollapseEntity("WIDGETS");
AgHelper.expandCollapseEntity("FormTest");
AgHelper.ActionContextMenuByEntityName("FormTestCopy", "Show Bindings");
ee.expandCollapseEntity("WIDGETS");
ee.expandCollapseEntity("FormTest");
ee.ActionContextMenuByEntityName("FormTestCopy", "Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{FormTestCopy.isVisible}}");

View File

@ -9,7 +9,7 @@ describe("Phone input widget - ", () => {
cy.addDsl(dsl);
});
it("Add new dropdown widget", () => {
it("1. Add new dropdown widget", () => {
cy.get(explorer.addWidget).click();
cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 });
cy.get(`.t--widget-${widgetName}`).should("exist");
@ -21,7 +21,7 @@ describe("Phone input widget - ", () => {
);
});
it("should check for the format and dialCode", () => {
it("2. Should check for the format and dialCode", () => {
cy.get(`.t--widget-${widgetName} input`).clear();
cy.wait(500);
cy.get(`.t--widget-${widgetName} input`).type("9999999999");
@ -80,7 +80,7 @@ describe("Phone input widget - ", () => {
cy.get(".t--input-country-code-change").should("contain", "🇮🇳+91");
});
it("should check that widget input resets on submit", () => {
it("3. Should check that widget input resets on submit", () => {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
@ -94,9 +94,11 @@ describe("Phone input widget - ", () => {
cy.addSuccessMessage("Submitted!!");
cy.get(widgetInput).clear();
cy.wait(300);
cy.get(widgetInput).type("1234567890");
cy.wait(300);
cy.wait(500);
cy.get(widgetInput)
.click()
.type("1234567890");
cy.wait(500);
cy.get(".t--widget-textwidget").should("contain", "1234567890:1234567890");
cy.get(widgetInput).type("{enter}");
cy.wait(300);

View File

@ -5,10 +5,9 @@ const pages = require("../../../../locators/Pages.json");
const testdata = require("../../../../fixtures/testdata.json");
describe("Rest Bugs tests", function() {
//Skipping until api endpoint fixed
it.skip("Bug 5550: Not able to run APIs in parallel", function() {
it("Bug 5550: Not able to run APIs in parallel", function() {
cy.addDsl(dslParallel);
cy.wait(5000); //settling time for dsl!
cy.wait(8000); //settling time for dsl!
cy.get(".bp3-spinner").should("not.exist");
//Api 1
@ -20,56 +19,90 @@ describe("Rest Bugs tests", function() {
//Api 2
cy.NavigateToAPI_Panel();
cy.CreateAPI("CatFacts");
cy.enterDatasource(
"https://cat-fact.herokuapp.com/facts/random?animal_type=cat",
);
cy.assertPageSave();
cy.get("body").click(0, 0);
//Api 3
cy.NavigateToAPI_Panel();
cy.CreateAPI("DogImage");
cy.enterDatasource("https://dog.ceo/api/breeds/image/random");
cy.assertPageSave();
//important - needed for autosave of API before running
cy.get("body").click(0, 0);
//Api 3
cy.NavigateToAPI_Panel();
cy.CreateAPI("NumberFact");
cy.enterDatasource("http://numbersapi.com/random/math");
cy.assertPageSave();
cy.get("body").click(0, 0);
//Api 4
cy.NavigateToAPI_Panel();
cy.CreateAPI("DogFacts");
cy.CreateAPI("CocktailDB");
cy.enterDatasource(
"https://cat-fact.herokuapp.com/facts/random?animal_type=dog",
"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita",
);
cy.assertPageSave();
cy.get("body").click(0, 0);
cy.contains(commonlocators.entityName, "Page1").click({ force: true });
cy.clickButton("Get Facts!");
cy.contains(commonlocators.entityName, "Page1")
.click({ force: true })
.wait(2000);
cy.clickButton("Invoke APIs!");
cy.wait(12000); // for all api calls to complete!
cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
expect(response.body.data.isExecutionSuccess).to.eq(true);
expect(response.body.data.body[0].url.length).to.be.above(0);
});
//Cat Image
cy.xpath("//img/parent::div")
.eq(0)
.find("img")
.invoke("attr", "src")
.then(($src) => {
expect($src).not.eq("https://assets.appsmith.com/widgets/default.png");
expect($src).contains("cat");
});
cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
expect(response.body.data.isExecutionSuccess).to.eq(true);
expect(response.body.data.body.type).to.eq("cat");
});
// cy.wait("@postExecute").then(({ response }) => {
// expect(response.body.data.isExecutionSuccess).to.eq(true);
// expect(response.body.data.body[0].url.length).to.be.above(0); //Cat image
// });
cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
expect(response.body.data.isExecutionSuccess).to.eq(true);
expect(response.body.data.body.message.length).to.be.above(0);
});
// cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
// expect(response.body.data.isExecutionSuccess).to.eq(true);
// expect(response.body.data.body.message.length).to.be.above(0); //Dog Image
// });
cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
//cy.log("Response is :"+ JSON.stringify(response.body))
//Dog Image
cy.xpath("//img/parent::div")
.eq(1)
.find("img")
.invoke("attr", "src")
.then(($src) => {
expect($src).not.eq("https://assets.appsmith.com/widgets/default.png");
expect($src).contains("dog");
});
expect(response.body.data.isExecutionSuccess).to.eq(true);
expect(response.body.data.body.type).to.eq("dog");
});
// cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
// expect(response.body.data.isExecutionSuccess).to.eq(true);
// expect(response.body.data.body.length).to.be.above(0); //Number fact
// });
cy.get(".t--draggable-textwidget")
.eq(0)
.invoke("text")
.then(($txt) => expect($txt).to.have.length.greaterThan(25));
// cy.wait("@postExecute", { timeout: 8000 }).then(({ response }) => {
// //cy.log("Response is :"+ JSON.stringify(response.body))
// expect(response.body.data.isExecutionSuccess).to.eq(true);
// expect(response.body.data.request.url.length).to.be.above(0); //Cocktail
// });
//Cocktail DB
cy.xpath("//img/parent::div")
.eq(2)
.find("img")
.invoke("attr", "src")
.then(($src) => {
expect($src).not.eq("https://assets.appsmith.com/widgets/default.png");
expect($src).contains("cocktail");
});
//Spread to check later!
// cy.wait(['@postExecute', '@postExecute', '@postExecute', '@postExecute'], { timeout: 8000 }).spread(

View File

@ -1,8 +1,11 @@
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const datasourceFormData = require("../../../../fixtures/datasources.json");
const datasourceEditor = require("../../../../locators/DatasourcesEditor.json");
describe("Authenticated API Datasource", function() {
it("Can create New Authentication API datasource", function() {
const URL = datasourceFormData["authenticatedApiUrl"];
it("1. Bug: 12045 - No Blank screen diplay after New Authentication API datasource creation", function() {
cy.NavigateToAPI_Panel();
cy.get(apiwidget.createAuthApiDatasource).click({ force: true });
cy.wait("@createDatasource").should(
@ -10,9 +13,17 @@ describe("Authenticated API Datasource", function() {
"response.body.responseMeta.status",
201,
);
cy.renameDatasource("FakeAuthenticatedApi");
cy.fillAuthenticatedAPIForm();
cy.saveDatasource();
const URL = datasourceFormData["authenticatedApiUrl"];
cy.contains(URL);
});
it("2. Bug: 12045 - No Blank screen diplay after editing/opening existing Authentication API datasource", function() {
cy.xpath("//span[text()='EDIT']/parent::a").click();
cy.get(datasourceEditor.url).type("/users");
cy.saveDatasource();
cy.contains(URL + "/users");
cy.deleteDatasource("FakeAuthenticatedApi");
});
});

View File

@ -3,9 +3,8 @@ const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const explorer = require("../../../../locators/explorerlocators.json");
const pageid = "MyPage";
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
const AHelper = new AggregateHelper();
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
describe("Entity explorer API pane related testcases", function() {
it("Empty Message validation for Widgets/API/Queries", function() {
@ -33,7 +32,7 @@ describe("Entity explorer API pane related testcases", function() {
);
cy.ResponseStatusCheck(testdata.successStatusCode);
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
AHelper.ActionContextMenuByEntityName("FirstAPI", "Show Bindings");
ee.ActionContextMenuByEntityName("FirstAPI", "Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(5);
expect($lis.eq(0)).to.contain("{{FirstAPI.isLoading}}");
@ -49,14 +48,14 @@ describe("Entity explorer API pane related testcases", function() {
cy.get(".t--entity-name")
.contains("Page1")
.click();
AHelper.ActionContextMenuByEntityName("FirstAPI", "Edit Name");
ee.ActionContextMenuByEntityName("FirstAPI", "Edit Name");
cy.EditApiNameFromExplorer("SecondAPI");
cy.xpath(apiwidget.popover)
.last()
.should("be.hidden")
.invoke("show")
.click({ force: true });
AHelper.ActionContextMenuByEntityName("SecondAPI", "Move to page", pageid);
ee.ActionContextMenuByEntityName("SecondAPI", "Move to page", pageid);
cy.get(".t--entity-name")
.contains("SecondAPI")
.should("exist");

View File

@ -1,8 +1,9 @@
const queryLocators = require("../../../../locators/QueryEditor.json");
const datasource = require("../../../../locators/DatasourcesEditor.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
const agHelper = new AggregateHelper();
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
const pageid = "MyPage";
let updatedName;
@ -55,7 +56,7 @@ describe("Entity explorer tests related to copy query", function() {
datasourceName = httpResponse.response.body.data.name;
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
agHelper.ActionContextMenuByEntityName("Query1", "Show Bindings");
ee.ActionContextMenuByEntityName("Query1", "Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(5);
expect($lis.eq(0)).to.contain("{{Query1.isLoading}}");
@ -71,13 +72,13 @@ describe("Entity explorer tests related to copy query", function() {
cy.get(".t--entity-name")
.contains("Page1")
.click({ force: true });
agHelper.ActionContextMenuByEntityName("Query1", "Copy to page", pageid);
ee.ActionContextMenuByEntityName("Query1", "Copy to page", pageid);
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
cy.get(".t--entity-name")
.contains("Query1")
.click({ force: true });
cy.runQuery();
agHelper.ActionContextMenuByEntityName("Query1", "Show Bindings");
ee.ActionContextMenuByEntityName("Query1", "Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis.eq(0)).to.contain("{{Query1.isLoading}}");
expect($lis.eq(1)).to.contain("{{Query1.data}}");
@ -100,11 +101,7 @@ describe("Entity explorer tests related to copy query", function() {
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
cy.EditEntityNameByDoubleClick(datasourceName, updatedName);
cy.wait(1000);
agHelper.ActionContextMenuByEntityName(
updatedName,
"Delete",
"Are you sure?",
);
ee.ActionContextMenuByEntityName(updatedName, "Delete", "Are you sure?");
cy.wait(1000);
//This is check to make sure if a datasource is active 409
cy.wait("@deleteDatasource").should(
@ -116,6 +113,6 @@ describe("Entity explorer tests related to copy query", function() {
cy.get(".t--entity-name")
.contains("Query1")
.click();
agHelper.ActionContextMenuByEntityName("Query1", "Delete", "Are you sure?");
ee.ActionContextMenuByEntityName("Query1", "Delete", "Are you sure?");
});
});

View File

@ -1,27 +1,27 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
let agHelper = ObjectsRegistry.AggregateHelper,
ee = ObjectsRegistry.EntityExplorer,
jsEditor = ObjectsRegistry.JSEditor;
describe("Validate basic operations on Entity explorer JSEditor structure", () => {
const pageId = "Page1";
it("1. Validate JSObject creation & Run", () => {
jsEditor.CreateJSObject('return "Hello World";');
agHelper.expandCollapseEntity("QUERIES/JS");
agHelper.ValidateEntityPresenceInExplorer("JSObject1");
ee.expandCollapseEntity("QUERIES/JS");
ee.AssertEntityPresenceInExplorer("JSObject1");
jsEditor.validateDefaultJSObjProperties("JSObject1");
});
it("2. Validate Rename JSObject from Form Header", function() {
jsEditor.RenameJSObjFromForm("RenamedJSObject");
agHelper.ValidateEntityPresenceInExplorer("RenamedJSObject");
ee.AssertEntityPresenceInExplorer("RenamedJSObject");
jsEditor.validateDefaultJSObjProperties("RenamedJSObject");
});
it("3. Validate Copy JSObject", function() {
agHelper.ActionContextMenuByEntityName(
ee.ActionContextMenuByEntityName(
"RenamedJSObject",
"Copy to page",
pageId,
@ -31,40 +31,40 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
"response.body.responseMeta.status",
201,
);
agHelper.ValidateEntityPresenceInExplorer("RenamedJSObjectCopy");
ee.AssertEntityPresenceInExplorer("RenamedJSObjectCopy");
jsEditor.validateDefaultJSObjProperties("RenamedJSObjectCopy");
});
it("4. Validate Rename JSObject from Entity Explorer", function() {
jsEditor.RenameJSObjFromExplorer("RenamedJSObject", "ExplorerRenamed");
agHelper.ValidateEntityPresenceInExplorer("ExplorerRenamed");
ee.AssertEntityPresenceInExplorer("ExplorerRenamed");
jsEditor.validateDefaultJSObjProperties("ExplorerRenamed");
});
it("5. Validate Move JSObject", function() {
const newPageId = "Page2";
agHelper.AddNewPage();
agHelper.ValidateEntityPresenceInExplorer(newPageId);
agHelper.SelectEntityByName(pageId);
agHelper.expandCollapseEntity("QUERIES/JS");
agHelper.ActionContextMenuByEntityName(
ee.AssertEntityPresenceInExplorer(newPageId);
ee.SelectEntityByName(pageId);
ee.expandCollapseEntity("QUERIES/JS");
ee.ActionContextMenuByEntityName(
"RenamedJSObjectCopy",
"Move to page",
newPageId,
);
agHelper.SelectEntityByName(newPageId);
agHelper.ValidateEntityPresenceInExplorer("RenamedJSObjectCopy");
ee.SelectEntityByName(newPageId);
ee.AssertEntityPresenceInExplorer("RenamedJSObjectCopy");
jsEditor.validateDefaultJSObjProperties("RenamedJSObjectCopy");
});
it("6. Validate Deletion of JSObject", function() {
agHelper.SelectEntityByName(pageId);
agHelper.expandCollapseEntity("QUERIES/JS");
agHelper.ActionContextMenuByEntityName(
ee.SelectEntityByName(pageId);
ee.expandCollapseEntity("QUERIES/JS");
ee.ActionContextMenuByEntityName(
"ExplorerRenamed",
"Delete",
"Are you sure?",
);
agHelper.ValidateEntityAbsenceInExplorer("ExplorerRenamed");
ee.AssertEntityAbsenceInExplorer("ExplorerRenamed");
});
});

View File

@ -1,13 +1,12 @@
import { ApiPage } from "../../../../support/Pages/ApiPage";
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { HomePage } from "../../../../support/Pages/HomePage";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const apiPage = new ApiPage();
const agHelper = new AggregateHelper();
const homePage = new HomePage();
let dsl: any;
let agHelper = ObjectsRegistry.AggregateHelper,
homePage = ObjectsRegistry.HomePage,
ee = ObjectsRegistry.EntityExplorer,
apiPage = ObjectsRegistry.ApiPage;
describe("Layout OnLoad Actions tests", function() {
let dsl: any;
before(() => {
cy.fixture("onPageLoadActionsDsl").then((val: any) => {
dsl = val;
@ -16,8 +15,8 @@ describe("Layout OnLoad Actions tests", function() {
it("1. Bug 8595: OnPageLoad execution - when No api to run on Pageload", function() {
agHelper.AddDsl(dsl);
agHelper.SelectEntityByName("WIDGETS");
agHelper.SelectEntityByName("Page1");
ee.SelectEntityByName("WIDGETS");
ee.SelectEntityByName("Page1");
cy.url().then((url) => {
const pageid = url.split("/")[4]?.split("-").pop();
cy.log(pageid + "page id");
@ -55,8 +54,8 @@ describe("Layout OnLoad Actions tests", function() {
apiPage.CreateAndFillApi("https://api.genderize.io", "Genderize");
apiPage.EnterParams("name", "{{RandomUser.data.results[0].name.first}}");
apiPage.RunAPI();
agHelper.SelectEntityByName("WIDGETS");
agHelper.SelectEntityByName("Page1");
ee.SelectEntityByName("WIDGETS");
ee.SelectEntityByName("Page1");
cy.url().then((url) => {
const pageid = url.split("/")[4]?.split("-").pop();
@ -132,8 +131,8 @@ describe("Layout OnLoad Actions tests", function() {
value: "{{RandomUser.data.results[0].name.first}}",
}); // verifies Bug 10055
apiPage.RunAPI();
agHelper.SelectEntityByName("WIDGETS");
agHelper.SelectEntityByName("Page1");
ee.SelectEntityByName("WIDGETS");
ee.SelectEntityByName("Page1");
cy.url().then((url) => {
const pageid = url.split("/")[4]?.split("-").pop();

View File

@ -1,13 +1,10 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { HomePage } from "../../../../support/Pages/HomePage";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const homePage = new HomePage();
let orgid: any, appid: any;
let agHelper = ObjectsRegistry.AggregateHelper,
homePage = ObjectsRegistry.HomePage;
describe("Create new org and invite user & validate all roles", () => {
let orgid: any;
let appid: any;
it("1. Create new Organization, Share with a user from UI & verify", () => {
homePage.NavigateToHome()
agHelper.GenerateUUID()

View File

@ -1,12 +1,12 @@
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { JSEditor } from "../../../../support/Pages/JSEditor";
import { DataSources } from "../../../../support/Pages/DataSources";
import { CommonLocators } from "../../../../support/Objects/CommonLocators";
import { ObjectsRegistry } from "../../../../support/Objects/Registry"
const agHelper = new AggregateHelper();
const jsEditor = new JSEditor();
const dataSources = new DataSources();
const locator = new CommonLocators();
let guid: any;
let agHelper = ObjectsRegistry.AggregateHelper,
dataSources = ObjectsRegistry.DataSources,
jsEditor = ObjectsRegistry.JSEditor,
locator = ObjectsRegistry.CommonLocators,
ee = ObjectsRegistry.EntityExplorer,
table = ObjectsRegistry.Table;
describe("[Bug] - 10784 - Passing params from JS to SQL query should not break", () => {
before(() => {
@ -15,10 +15,8 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
});
});
let guid: any;
it("1. With Optional chaining : {{ this?.params?.condition }}", function() {
agHelper.NavigateToDSCreateNew();
it("1. With Optional chaining : {{ this?.params?.condition }}", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("PostgreSQL");
dataSources.FillPostgresDSForm();
agHelper.GenerateUUID();
@ -37,8 +35,8 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params1.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
});
agHelper.expandCollapseEntity("WIDGETS");
agHelper.SelectEntityByName("Button1");
ee.expandCollapseEntity("WIDGETS");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -47,12 +45,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params1.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
@ -61,12 +59,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
});
it("2. With Optional chaining : {{ (function() { return this?.params?.condition })() }}", function() {
it("2. With Optional chaining : {{ (function() { return this?.params?.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params2");
@ -77,7 +75,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params2.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -86,12 +84,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params2.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
@ -100,12 +98,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
});
it("3. With Optional chaining : {{ (() => { return this?.params?.condition })() }}", function() {
it("3. With Optional chaining : {{ (() => { return this?.params?.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params3");
@ -116,7 +114,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params3.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -125,12 +123,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params3.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
@ -139,12 +137,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
});
it("4. With Optional chaining : {{ this?.params.condition }}", function() {
it("4. With Optional chaining : {{ this?.params.condition }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params4");
@ -155,7 +153,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params4.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -164,12 +162,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params4.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
@ -178,12 +176,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
});
it("5. With Optional chaining : {{ (function() { return this?.params.condition })() }}", function() {
it("5. With Optional chaining : {{ (function() { return this?.params.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params5");
@ -194,7 +192,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params5.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -203,12 +201,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params5.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
@ -217,12 +215,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
});
it("6. With Optional chaining : {{ (() => { return this?.params.condition })() }}", function() {
it("6. With Optional chaining : {{ (() => { return this?.params.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params6");
@ -233,7 +231,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params6.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -242,12 +240,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params6.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
@ -256,12 +254,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
});
it("7. With No Optional chaining : {{ this.params.condition }}", function() {
it("7. With No Optional chaining : {{ this.params.condition }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params7");
@ -272,7 +270,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params7.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -281,12 +279,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params7.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
@ -295,12 +293,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
});
it("8. With No Optional chaining : {{ (function() { return this.params.condition })() }}", function() {
it("8. With No Optional chaining : {{ (function() { return this.params.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params8");
@ -311,7 +309,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params8.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -320,12 +318,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params8.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
@ -334,12 +332,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
});
it("9. With No Optional chaining : {{ (() => { return this.params.condition })() }}", function() {
it("9. With No Optional chaining : {{ (() => { return this.params.condition })() }}", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params9");
@ -350,7 +348,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params9.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -359,12 +357,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params9.data}}");
agHelper.ClickButton("Submit");
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("9");
});
@ -373,12 +371,12 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("8");
});
});
it("10. With Optional chaining : {{ this?.params?.condition }} && no optional paramter passed", function() {
it("10. With Optional chaining : {{ this?.params?.condition }} && no optional paramter passed", function () {
dataSources.NavigateToActiveDSQueryPane(guid);
agHelper.GetNClick(dataSources._templateMenu);
agHelper.RenameWithInPane("Params10");
@ -389,7 +387,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
'Params10.run(() => {},() => {},{"condition": selRecordFilter.selectedOptionValue})',
);
agHelper.SelectEntityByName("Button1");
ee.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext(
"onclick",
@ -398,7 +396,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
true,
);
});
agHelper.SelectEntityByName("Table1");
ee.SelectEntityByName("Table1");
jsEditor.EnterJSContext("tabledata", "{{Params10.data}}");
//When No selected option passed
@ -408,7 +406,7 @@ describe("[Bug] - 10784 - Passing params from JS to SQL query should not break",
agHelper.ClickButton("Submit");
agHelper.Sleep(2000);
agHelper.ValidateNetworkExecutionSuccess("@postExecute");
agHelper.ReadTableRowColumnData(0, 0).then((cellData) => {
table.ReadTableRowColumnData(0, 0).then((cellData) => {
expect(cellData).to.be.equal("7");
});
});

View File

@ -2,10 +2,10 @@ const queryLocators = require("../../../../locators/QueryEditor.json");
const generatePage = require("../../../../locators/GeneratePage.json");
const datasource = require("../../../../locators/DatasourcesEditor.json");
import homePage from "../../../../locators/HomePage";
import { AggregateHelper } from "../../../../support/Pages/AggregateHelper";
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let ee = ObjectsRegistry.EntityExplorer;
let datasourceName;
const agHelper = new AggregateHelper();
describe("Create a query with a mongo datasource, run, save and then delete the query", function() {
beforeEach(() => {
@ -228,7 +228,7 @@ describe("Create a query with a mongo datasource, run, save and then delete the
it("9. Bug 7399: Validate Form based & Raw command based templates", function() {
let id;
agHelper.expandCollapseEntity(`${datasourceName}`);
ee.expandCollapseEntity(`${datasourceName}`);
cy.xpath(queryLocators.listingAndReviewContext)
.invoke("show")
.click({ force: true });

View File

@ -400,7 +400,7 @@ describe("Validate CRUD queries for Amazon S3 along with UI flow verifications",
//Verifying Searching File from UI
cy.xpath(queryLocators.searchFilefield)
.type("CRUD")
.wait(500); //for search to finish
.wait(7000); //for search to finish
expect(
cy.xpath(
"//div[@data-cy='overlay-comments-wrapper']//span[text()='CRUDNewPageFile']",

View File

@ -1,507 +0,0 @@
// const widgetsPage = require("../../../locators/Widgets.json");
// import homePage from "../../locators/HomePage";
// describe("Migration Validate", function () {
// it("1. Import application and Validate Migration 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("TableMigrationAppExported.json")
// .wait(500);
// cy.get(homePage.orgImportAppButton)
// .trigger("click")
// .wait(500);
// cy.get(homePage.orgImportAppModal).should("not.exist");
// 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",
// );
// //Renaming imported app!
// 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 - Page1
// //Validating Latitude & Longitude are hidden columns:
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='latitude']/parent::div/parent::div",
// )
// .invoke("attr", "class")
// .then((classes) => {
// cy.log("classes are:" + classes);
// expect(classes).includes("hidden-header");
// });
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='longitude']/parent::div/parent::div",
// )
// .invoke("attr", "class")
// .then((classes) => {
// cy.log("classes are:" + classes);
// expect(classes).includes("hidden-header");
// });
// //Validating order of header row!
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]",
// )
// .invoke("text")
// .then((x) => {
// expect(x).to.eq(
// "Card NumberidNameاسمaddress住所PhoneemailCompanyjobimagessnPin CodeCreditLimitOutstandingStateAvailable LimitCard TypeChange Credit limitimageURLlatitudelongitude",
// );
// cy.log("header set is:" + x);
// });
// //Validating Id column sorting happens as Datatype is Number in app!
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='id']",
// )
// .click()
// .wait(2000);
// cy.readTabledataPublish("0", "1").then((cellData) => {
// expect(cellData).to.be.equal("100");
// });
// cy.readTabledataPublish("1", "1").then((cellData) => {
// expect(cellData).to.be.equal("99");
// });
// cy.readTabledataPublish("2", "1").then((cellData) => {
// expect(cellData).to.be.equal("98");
// });
// //Revert the Id column sorting!
// cy.xpath(
// "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='id']",
// )
// .click()
// .wait(2000);
// cy.readTabledataPublish("0", "1").then((cellData) => {
// expect(cellData).to.be.equal("1");
// });
// cy.readTabledataPublish("1", "1").then((cellData) => {
// expect(cellData).to.be.equal("2");
// });
// cy.readTabledataPublish("2", "1").then((cellData) => {
// expect(cellData).to.be.equal("3");
// });
// //Validating image column is present:
// cy.getTableDataSelector("0", "10").then((selector) => {
// cy.get(selector + " div")
// .invoke("attr", "class")
// .then((classes) => {
// cy.log("classes are:" + classes);
// expect(classes).to.eq("image-cell");
// });
// });
// //Card Number mapping to text widget!
// cy.isSelectRow(2);
// cy.wait(2500); //time for table row select to reflect!
// cy.readTabledataPublish("2", "0").then((cardNumber) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]")
// .eq(1)
// .invoke("text")
// .then((cardNo) => {
// var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
// expect(cardNumber).match(format);
// expect(cardNumber).to.be.equal(cardNo);
// });
// });
// //Address mapping to text widget!
// cy.readTabledataPublish("2", "4").then((address) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(1)
// .invoke("text")
// .then((addr) => {
// expect(address.replace(/\r?\n|\r/, "")).to.eq(addr);
// });
// });
// //Validating Available limit column computation maintained!
// cy.readTabledataPublish("2", "16").then((availLimit) => {
// cy.readTabledataPublish("2", "13").then((creditLimit) => {
// cy.readTabledataPublish("2", "14").then((outstanding) => {
// expect(Number(availLimit)).to.eq(creditLimit - outstanding);
// });
// });
// });
// //Validating State button click & binding & text widget mapping!
// cy.getTableDataSelector("2", "15").then((selector) => {
// cy.get(selector + " button.bp3-button")
// .click()
// .wait(3000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "State:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500));
// cy.get(selector + " button span")
// .invoke("text")
// .then((statetxt) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(0)
// .invoke("text")
// .then((txtWidtxt) => {
// cy.log("statetxt is:" + statetxt);
// let text =
// statetxt == "Activate" ? "State:Inactive" : "State:Active";
// expect(text).to.eq(txtWidtxt);
// });
// });
// });
// //Validating Image URL click & navigation!
// cy.getTableDataSelector("2", "19").then((selector) => {
// // Stubbing window.open to open in the same tab
// cy.window().then((window) => {
// cy.stub(window, "open").callsFake((url) => {
// window.location.href = url; //.substring(1);
// window.location.target = "_self";
// });
// });
// cy.get(selector + " span.bp3-popover-target span")
// .invoke("text")
// .then((url) => {
// cy.get(selector + " span.bp3-popover-target")
// .click()
// .wait(2000);
// cy.wait("@postExecute");
// cy.url().should("contain", url);
// cy.go(-1);
// });
// });
// // cy.wait(4000);
// // cy.get("div.tableWrap").should("be.visible"); //wait for page load!
// cy.waitUntil(
// () => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"),
// {
// errorMsg: "Page is not loaded evn after 10 secs",
// timeout: 30000,
// interval: 2000,
// },
// ).then(() => cy.wait(1000)); //wait for page load!
// cy.isSelectRow(2); //as aft refresh row selection is also gone
// cy.getTableDataSelector("2", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a",
// )
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Add");
// });
// });
// //Manu Btn validation: - 2nd menu item
// cy.getTableDataSelector("2", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a",
// )
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Reduce");
// });
// });
// //Another row!
// //Card Number mapping to text widget!
// cy.isSelectRow(4);
// cy.wait(2500); //time for table row select to reflect!
// cy.readTabledataPublish("4", "0").then((cardNumber) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]")
// .eq(1)
// .invoke("text")
// .then((cardNo) => {
// var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
// expect(cardNumber).match(format);
// expect(cardNumber).to.be.equal(cardNo);
// });
// });
// //Address mapping to text widget!
// cy.readTabledataPublish("4", "4").then((address) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(1)
// .invoke("text")
// .then((addr) => {
// expect(address.replace(/\r?\n|\r/, "")).to.eq(addr);
// });
// });
// //Validating Available limit column computation maintained!
// cy.readTabledataPublish("4", "16").then((availLimit) => {
// cy.readTabledataPublish("4", "13").then((creditLimit) => {
// cy.readTabledataPublish("4", "14").then((outstanding) => {
// expect(Number(availLimit)).to.eq(creditLimit - outstanding);
// });
// });
// });
// //Validating State button click & binding & text widget mapping!
// cy.getTableDataSelector("4", "15").then((selector) => {
// cy.get(selector + " button.bp3-button")
// .click()
// .wait(2000);
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "State:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500));
// cy.get(selector + " button span")
// .invoke("text")
// .then((statetxt) => {
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]")
// .eq(0)
// .invoke("text")
// .then((txtWidtxt) => {
// cy.log("statetxt is:" + statetxt);
// let text =
// statetxt == "Activate" ? "State:Inactive" : "State:Active";
// expect(text).to.eq(txtWidtxt);
// });
// });
// });
// //Validating Image URL click & navigation!
// cy.getTableDataSelector("4", "19").then((selector) => {
// // Stubbing window.open to open in the same tab
// cy.window().then((window) => {
// cy.stub(window, "open").callsFake((url) => {
// window.location.href = url; //.substring(1);
// window.location.target = "_self";
// });
// });
// cy.get(selector + " span.bp3-popover-target span")
// .invoke("text")
// .then((url) => {
// cy.get(selector + " span.bp3-popover-target")
// .click()
// .wait(2000);
// cy.wait("@postExecute");
// cy.url().should("contain", url);
// cy.go(-1);
// });
// });
// //cy.wait(4000);
// //cy.get("div.tableWrap").should("be.visible");
// cy.waitUntil(
// () => cy.get("div.tableWrap", { timeout: 30000 }).should("be.visible"),
// {
// errorMsg: "Page is not loaded evn after 10 secs",
// timeout: 30000,
// interval: 2000,
// },
// ).then(() => cy.wait(1000)); //wait for page load!
// //Manu Btn validation: - 1st menu item
// cy.isSelectRow(4); //as aft refresh row selection is also gone
// cy.getTableDataSelector("4", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a",
// )
// .click()
// .wait(2000); //allow time for n/w to finish
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Add");
// });
// });
// //Manu Btn validation: - 2nd menu item
// cy.getTableDataSelector("4", "18").then((selector) => {
// cy.get(selector + " button")
// .click()
// .wait(1000);
// cy.xpath(
// "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a",
// )
// .click()
// .wait(2000); //allow time for n/w to finish
// cy.waitUntil(
// () =>
// cy
// .xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .should("contain.text", "CreditLimit:"),
// {
// errorMsg: "Execute call did not complete evn after 10 secs",
// timeout: 20000,
// interval: 1000,
// },
// ).then(() => cy.wait(500)); //allow time for n/w to finish
// cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]", {
// timeout: 30000,
// })
// .eq(0)
// .invoke("text")
// .then((addreduce) => {
// expect(addreduce).to.eq("CreditLimit:Reduce");
// });
// });
// });
// //Page 2 Validations:
// cy.selectEntityByName("Change color and font");
// cy.selectEntityByName("WIDGETS");
// cy.selectEntityByName("Table1");
// cy.get(widgetsPage.bold)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true);
// cy.get(widgetsPage.centerAlign)
// .eq(0)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true); //Text align
// cy.get(widgetsPage.centerAlign)
// .eq(1)
// .invoke("attr", "aria-selected")
// .then((sel) => expect(Boolean(sel)).to.be.true); //Vertical align
// cy.get(widgetsPage.textColor)
// .first()
// .invoke("attr", "value")
// .should("contain", "#2E3D49");
// cy.get(`${widgetsPage.cellBackground} input`)
// .first()
// .invoke("attr", "value")
// .should("contain", "#FFC13D");
// cy.get(widgetsPage.selectedTextSize).should("have.text", "24px");
// });
// });

View File

@ -57,6 +57,12 @@ module.exports = (on, config) => {
return launchOptions;
}
if (browser.name === "electron") {
// && browser.isHeadless) {
launchOptions.preferences.fullscreen = true;
launchOptions.preferences.darkTheme = true;
}
return launchOptions;
});

View File

@ -1,13 +1,10 @@
export class CommonLocators {
_addNewDataSource = ".datasources .t--entity-add-btn"
_integrationCreateNew = "[data-cy=t--tab-CREATE_NEW]"
_loading = "#loading"
_spinner = ".bp3-spinner"
_queryName = ".t--action-name-edit-field span"
_queryNameTxt = ".t--action-name-edit-field input"
_dsName = ".t--edit-datasource-name span"
_dsNameTxt = ".t--edit-datasource-name input"
_homeIcon = ".t--appsmith-logo"
_homePageAppCreateBtn = ".t--applications-container .createnew"
_saveStatusSuccess = ".t--save-status-success"
_codeMirrorTextArea = ".CodeMirror textarea"
_codeMirrorCode = ".CodeMirror-code"
@ -24,10 +21,20 @@ export class CommonLocators {
_newPage = ".pages .t--entity-add-btn"
_toastMsg = ".t--toast-action"
_empty = "span[name='no-response']"
_contextMenuInPane = "span[name='context-menu']"
_visibleTextDiv = (divText: string) => "//div[text()='" + divText + "']"
_openWidget = ".widgets .t--entity-add-btn"
_dropHere = "#comment-overlay-wrapper-0"
_activeTab = "span:contains('Active')"
_createQuery = ".t--create-query"
_crossBtn = "span.cancel-icon"
_createNew = ".t--entity-add-btn.group.files"
_uploadFiles = "div.uppy-Dashboard-AddFiles input"
_uploadBtn = "button.uppy-StatusBar-actionBtn--upload"
_debuggerIcon = ".t--debugger svg"
_errorTab = "[data-cy=t--tab-ERROR]"
_debugErrorMsg = ".t--debugger-message"
_debuggerLabel = "span.debugger-label"
_entityNameInExplorer = (entityNameinLeftSidebar: string) => "//div[contains(@class, 't--entity-name')][text()='" + entityNameinLeftSidebar + "']"
_expandCollapseArrow = (entityNameinLeftSidebar: string) => "//div[text()='" + entityNameinLeftSidebar + "']/ancestor::div/preceding-sibling::a[contains(@class, 't--entity-collapse-toggle')]"
_entityProperties = (entityNameinLeftSidebar: string) => "//div[text()='" + entityNameinLeftSidebar + "']/ancestor::div[contains(@class, 't--entity-item')]/following-sibling::div//div[contains(@class, 't--entity-property')]//code"
@ -45,13 +52,11 @@ export class CommonLocators {
_widgetInCanvas = (widgetType: string) => `.t--draggable-${widgetType}`
_widgetInDeployed = (widgetType: string) => `.t--widget-${widgetType}`
_propertyToggle = (controlToToggle: string) => ".t--property-control-" + controlToToggle + " input[type='checkbox']"
_propertyToggleValue = (controlToToggle: string) => "//div[contains(@class, 't--property-control-" + controlToToggle + "')]//input[@type='checkbox']/parent::label"
_openNavigationTab = (tabToOpen: string) => `#switcher--${tabToOpen}`
_selectWidgetDropdown = (widgetType: string) => "//div[contains(@class, 't--draggable-" + widgetType + "')]//button"
_createNewPlgin = (pluginName: string) => ".t--plugin-name:contains('" + pluginName + "')"
_inputFieldByName = (fieldName: string) => "//p[text()='" + fieldName + "']/parent::label/following-sibling::div"
_existingFieldValueByName = (fieldName: string) => "//label[text()='" + fieldName + "']/ancestor::div//div[contains(@class,'CodeMirror-code')]"
_evaluatedCurrentValue = "div:last-of-type .t--CodeEditor-evaluatedValue > div:last-of-type pre"
_tableRowColumn = (rowNum: number, colNum: number) => `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div div`
_crossBtn = "span.cancel-icon"
_createNew = ".t--entity-add-btn.group.files"
}

View File

@ -0,0 +1,75 @@
import { AggregateHelper } from "../Pages/AggregateHelper";
import { JSEditor } from "../Pages/JSEditor";
import { EntityExplorer } from "../Pages/EntityExplorer";
import { CommonLocators } from "./CommonLocators";
import { ApiPage } from "../Pages/ApiPage";
import { HomePage } from "../Pages/HomePage";
import { DataSources } from "../Pages/DataSources";
import { Table } from "../Pages/Table";
export class ObjectsRegistry {
private static aggregateHelper__: AggregateHelper;
static get AggregateHelper(): AggregateHelper {
if (ObjectsRegistry.aggregateHelper__ === undefined) {
ObjectsRegistry.aggregateHelper__ = new AggregateHelper()
}
return ObjectsRegistry.aggregateHelper__;
}
private static jsEditor__: JSEditor;
static get JSEditor(): JSEditor {
if (ObjectsRegistry.jsEditor__ === undefined) {
ObjectsRegistry.jsEditor__ = new JSEditor()
}
return ObjectsRegistry.jsEditor__;
}
private static commonLocators__: CommonLocators;
static get CommonLocators(): CommonLocators {
if (ObjectsRegistry.commonLocators__ === undefined) {
ObjectsRegistry.commonLocators__ = new CommonLocators()
}
return ObjectsRegistry.commonLocators__;
}
private static entityExplorer__: EntityExplorer;
static get EntityExplorer(): EntityExplorer {
if (ObjectsRegistry.entityExplorer__ === undefined) {
ObjectsRegistry.entityExplorer__ = new EntityExplorer()
}
return ObjectsRegistry.entityExplorer__;
}
private static apiPage__: ApiPage;
static get ApiPage(): ApiPage {
if (ObjectsRegistry.apiPage__ === undefined) {
ObjectsRegistry.apiPage__ = new ApiPage()
}
return ObjectsRegistry.apiPage__;
}
private static homePage__: HomePage;
static get HomePage(): HomePage {
if (ObjectsRegistry.homePage__ === undefined) {
ObjectsRegistry.homePage__ = new HomePage()
}
return ObjectsRegistry.homePage__;
}
private static dataSources__: DataSources;
static get DataSources(): DataSources {
if (ObjectsRegistry.dataSources__ === undefined) {
ObjectsRegistry.dataSources__ = new DataSources()
}
return ObjectsRegistry.dataSources__;
}
private static table__: Table;
static get Table(): Table {
if (ObjectsRegistry.table__ === undefined) {
ObjectsRegistry.table__ = new Table()
}
return ObjectsRegistry.table__;
}
}

View File

@ -1,9 +1,8 @@
import 'cypress-wait-until';
const uuid = require("uuid");
import { CommonLocators } from "../Objects/CommonLocators";
const locator = new CommonLocators();
import { ObjectsRegistry } from '../Objects/Registry';
export class AggregateHelper {
private locator = ObjectsRegistry.CommonLocators;
public AddDsl(dsl: string) {
let currentURL;
@ -29,20 +28,7 @@ export class AggregateHelper {
});
});
this.Sleep(5000)//settling time for dsl
}
public NavigateToDSCreateNew() {
this.NavigateToDSAdd()
cy.get(locator._integrationCreateNew)
.should("be.visible")
.click({ force: true });
cy.get(locator._loading).should("not.exist");
}
public NavigateToDSAdd() {
cy.get(locator._addNewDataSource).last().scrollIntoView()
.should("be.visible")
.click({ force: true });
cy.get(this.locator._loading).should("not.exist");//Checks the spinner is gone & dsl loaded!
}
public StartServerAndRoutes() {
@ -52,8 +38,8 @@ export class AggregateHelper {
}
public RenameWithInPane(renameVal: string, query = true) {
let name = query ? locator._queryName : locator._dsName;
let text = query ? locator._queryNameTxt : locator._dsNameTxt;
let name = query ? this.locator._queryName : this.locator._dsName;
let text = query ? this.locator._queryNameTxt : this.locator._dsNameTxt;
cy.get(name).click({ force: true });
cy.get(text)
.clear({ force: true })
@ -62,30 +48,14 @@ export class AggregateHelper {
.blur();
}
public WaitAutoSave() {
public AssertAutoSave() {
// wait for save query to trigger & n/w call to finish occuring
cy.get(locator._saveStatusSuccess, { timeout: 40000 }).should("exist");
}
public SelectEntityByName(entityNameinLeftSidebar: string) {
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar), { timeout: 30000 })
.last()
.click({ multiple: true })
this.Sleep()
}
public NavigateToExplorer() {
cy.get(locator._openNavigationTab('explorer')).click()
}
public ValidateEntityPresenceInExplorer(entityNameinLeftSidebar: string) {
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar))
.should("have.length", 1);
cy.get(this.locator._saveStatusSuccess, { timeout: 40000 }).should("exist");
}
public ValidateCodeEditorContent(selector: string, contentToValidate: any) {
cy.get(selector).within(() => {
cy.get(locator._codeMirrorCode).should("have.text", contentToValidate);
cy.get(this.locator._codeMirrorCode).should("have.text", contentToValidate);
});
}
@ -94,31 +64,21 @@ export class AggregateHelper {
cy.intercept("POST", "/api/v1/applications/publish/*").as("publishApp");
// Wait before publish
this.Sleep(2000)
this.WaitAutoSave()
this.AssertAutoSave()
// Stubbing window.open to open in the same tab
cy.window().then((window) => {
cy.stub(window, "open").callsFake((url) => {
window.location.href = Cypress.config().baseUrl + url.substring(1);
});
});
cy.get(locator._publishButton).click();
cy.wait("@publishApp");
cy.get(this.locator._publishButton).click();
cy.log("Pagename: " + localStorage.getItem("PageName"));
}
public expandCollapseEntity(entityName: string, expand = true) {
cy.xpath(locator._expandCollapseArrow(entityName)).invoke('attr', 'name').then((arrow) => {
if (expand && arrow == 'arrow-right')
cy.xpath(locator._expandCollapseArrow(entityName)).trigger('click', { multiple: true }).wait(1000);
else if (!expand && arrow == 'arrow-down')
cy.xpath(locator._expandCollapseArrow(entityName)).trigger('click', { multiple: true }).wait(1000);
else
this.Sleep()
})
cy.wait("@publishApp").its("request.url").should("not.contain", "edit")
//cy.wait('@publishApp').wait('@publishApp') //waitng for 2 calls to complete
}
public AddNewPage() {
cy.get(locator._newPage)
cy.get(this.locator._newPage)
.first()
.click();
cy.wait("@createPage").should(
@ -128,8 +88,14 @@ export class AggregateHelper {
);
}
public ValidateToastMessage(text: string, length = 1, index = 1) {
cy.get(this.locator._toastMsg)
.should("have.length", length)
.should("contain.text", text);
}
public ClickButton(btnVisibleText: string) {
cy.xpath(locator._spanButton(btnVisibleText))
cy.xpath(this.locator._spanButton(btnVisibleText))
.scrollIntoView()
.click({ force: true });
}
@ -148,22 +114,22 @@ export class AggregateHelper {
});
}
public WaitUntilEleDisappear(selector: string, msgToCheckforDisappearance: string, timeout = 1000) {
public WaitUntilEleDisappear(selector: string, msgToCheckforDisappearance: string) {
cy.waitUntil(() => cy.get(selector).contains(msgToCheckforDisappearance).should("have.length", 0),
{
errorMsg: msgToCheckforDisappearance + " did not disappear",
timeout: 5000,
interval: 1000
}).then(() => this.Sleep(timeout))
}).then(() => this.Sleep())
}
public WaitUntilEleAppear(selector: string, timeout = 500) {
public WaitUntilEleAppear(selector: string) {
cy.waitUntil(() => cy.get(selector, { timeout: 50000 }).should("have.length.greaterThan", 0),
{
errorMsg: "Element did not appear",
timeout: 5000,
interval: 1000
}).then(() => this.Sleep(timeout))
}).then(() => this.Sleep(500))
}
public ValidateNetworkExecutionSuccess(aliasName: string, expectedRes = true) {
@ -174,15 +140,15 @@ export class AggregateHelper {
)
}
public ValidateNetworkStatus(aliasName: string, expectedRes = 200) {
public ValidateNetworkDataSuccess(aliasName: string, expectedRes = true) {
cy.wait(aliasName).should(
"have.nested.property",
"response.body.responseMeta.status",
"response.body.data.success",
expectedRes,
)
}
public ValidateNetworkCallRespPut(aliasName: string, expectedStatus = 200) {
public ValidateNetworkStatus(aliasName: string, expectedStatus = 200) {
cy.wait(aliasName).should(
"have.nested.property",
"response.body.responseMeta.status",
@ -191,24 +157,24 @@ export class AggregateHelper {
}
public SelectPropertiesDropDown(endp: string, ddOption: string,) {
cy.xpath(locator._selectPropDropdown(endp))
cy.xpath(this.locator._selectPropDropdown(endp))
.first()
.scrollIntoView()
.click()
cy.get(locator._dropDownValue(ddOption)).click()
cy.get(this.locator._dropDownValue(ddOption)).click()
}
public SelectDropDown(endp: string, ddOption: string,) {
cy.xpath(locator._selectWidgetDropdown(endp))
cy.xpath(this.locator._selectWidgetDropdown(endp))
.first()
.scrollIntoView()
.click()
cy.get(locator._selectOptionValue(ddOption)).click({ force: true })
cy.get(this.locator._selectOptionValue(ddOption)).click({ force: true })
this.Sleep(2000)
}
public EnterActionValue(actionName: string, value: string, paste = true) {
cy.xpath(locator._actionTextArea(actionName))
cy.xpath(this.locator._actionTextArea(actionName))
.first()
.focus()
.type("{uparrow}", { force: true })
@ -216,7 +182,7 @@ export class AggregateHelper {
cy.focused().then(($cm: any) => {
if ($cm.contents != "") {
cy.log("The field is not empty");
cy.xpath(locator._actionTextArea(actionName))
cy.xpath(this.locator._actionTextArea(actionName))
.first()
.click({ force: true })
.focused()
@ -225,7 +191,7 @@ export class AggregateHelper {
});
}
this.Sleep()
cy.xpath(locator._actionTextArea(actionName))
cy.xpath(this.locator._actionTextArea(actionName))
.first()
.then((el: any) => {
const input = cy.get(el);
@ -238,7 +204,7 @@ export class AggregateHelper {
});
}
});
this.WaitAutoSave()
this.AssertAutoSave()
})
}
@ -253,36 +219,29 @@ export class AggregateHelper {
cy.get(selector).click({ force: true });
}
public DragDropWidgetNVerify(widgetType: string, x: number, y: number) {
cy.get(locator._openNavigationTab('widgets')).click({ force: true })
this.Sleep()
cy.get(locator._widgetPageIcon(widgetType)).first()
.trigger("dragstart", { force: true })
.trigger("mousemove", x, y, { force: true });
cy.get(locator._dropHere)
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
.trigger("mouseup", x, y, { eventConstructor: "MouseEvent" });
this.WaitAutoSave()//settling time for widget on canvas!
cy.get(locator._widgetInCanvas(widgetType)).should('exist')
}
public ToggleOrDisable(propertyName: string, check = true) {
if (check) {
cy.get(locator._propertyToggle(propertyName))
public ToggleOnOrOff(propertyName: string, toggle: 'On' | 'Off') {
if (toggle == 'On') {
cy.get(this.locator._propertyToggle(propertyName))
.check({ force: true })
.should("be.checked");
}
else {
cy.get(locator._propertyToggle(propertyName))
cy.get(this.locator._propertyToggle(propertyName))
.uncheck({ force: true })
.should("not.checked");
}
this.WaitAutoSave()
this.AssertAutoSave()
}
public AssertExistingToggleState(propertyName: string, toggle: 'checked' | 'unchecked') {
cy.xpath(this.locator._propertyToggleValue(propertyName)).invoke("attr", "class")
.then((classes) => {
expect(classes).includes(toggle);
});
}
public NavigateBacktoEditor() {
cy.get(locator._backToEditor).click({ force: true });
cy.get(this.locator._backToEditor).click({ force: true });
this.Sleep(2000)
}
@ -293,54 +252,27 @@ export class AggregateHelper {
}
public GetObjectName() {
//cy.get(locator._queryName).invoke("text").then((text) => cy.wrap(text).as("queryName")); or below syntax
return cy.get(locator._queryName).invoke("text");
//cy.get(this.locator._queryName).invoke("text").then((text) => cy.wrap(text).as("queryName")); or below syntax
return cy.get(this.locator._queryName).invoke("text");
}
public Sleep(timeout = 1000) {
cy.wait(timeout)
}
public NavigateToHome() {
cy.get(locator._homeIcon).click({ force: true });
this.Sleep(3000);
cy.wait("@applications");
cy.get(locator._homePageAppCreateBtn)
.should("be.visible")
.should("be.enabled");
}
public CreateNewApplication() {
cy.get(locator._homePageAppCreateBtn).click({ force: true });
cy.wait("@createNewApplication").should(
"have.nested.property",
"response.body.responseMeta.status",
201,
);
}
public ActionContextMenuByEntityName(
entityNameinLeftSidebar: string,
action = "Delete",
subAction = "") {
this.Sleep();
cy.xpath(locator._contextMenu(entityNameinLeftSidebar))
.last()
.click({ force: true });
cy.xpath(locator._contextMenuItem(action))
.click({ force: true })
this.Sleep(500)
public ActionContextMenuWithInPane(action: 'Copy to page' | 'Move to page' | 'Delete', subAction = "") {
cy.get(this.locator._contextMenuInPane).click()
cy.xpath(this.locator._visibleTextDiv(action)).should('be.visible').click()
if (action == 'Delete') {
cy.xpath(this.locator._visibleTextDiv('Are you sure?')).click()
this.ValidateNetworkStatus("@deleteAction");
}
if (subAction) {
cy.xpath(locator._contextMenuItem(subAction))
.click({ force: true })
cy.xpath(this.locator._visibleTextDiv(subAction)).click()
this.Sleep(500)
}
}
public ValidateEntityAbsenceInExplorer(entityNameinLeftSidebar: string) {
cy.xpath(locator._entityNameInExplorer(entityNameinLeftSidebar)).should('not.exist');
}
public TypeValueNValidate(valueToType: string, fieldName = "") {
this.EnterValue(valueToType, fieldName)
this.VerifyEvaluatedValue(valueToType);
@ -348,11 +280,11 @@ export class AggregateHelper {
public EnterValue(valueToType: string, fieldName = "") {
if (fieldName) {
cy.xpath(locator._inputFieldByName(fieldName)).then(($field: any) => {
cy.xpath(this.locator._inputFieldByName(fieldName)).then(($field: any) => {
this.UpdateCodeInput($field, valueToType);
});
} else {
cy.get(locator._codeEditorTarget).then(($field: any) => {
cy.get(this.locator._codeEditorTarget).then(($field: any) => {
this.UpdateCodeInput($field, valueToType);
});
}
@ -373,11 +305,11 @@ export class AggregateHelper {
public VerifyEvaluatedValue(currentValue: string) {
this.Sleep(3000);
cy.get(locator._evaluatedCurrentValue)
cy.get(this.locator._evaluatedCurrentValue)
.first()
.should("be.visible")
.should("not.have.text", "undefined");
cy.get(locator._evaluatedCurrentValue)
cy.get(this.locator._evaluatedCurrentValue)
.first()
.click({ force: true })
.then(($text) => {
@ -385,7 +317,47 @@ export class AggregateHelper {
});
}
public ReadTableRowColumnData(rowNum: number, colNum: number) {
return cy.get(locator._tableRowColumn(rowNum, colNum)).invoke("text");
public EvaluateExistingPropertyFieldValue(fieldName = "", currentValue = "") {
let toValidate = false;
if (currentValue) toValidate = true;
if (fieldName) {
cy.xpath(this.locator._existingFieldValueByName(fieldName)).eq(0).click();
} else {
cy.xpath(this.locator._codeMirrorCode).click();
}
this.Sleep(3000); //Increasing wait time to evaluate non-undefined values
const val = cy
.get(this.locator._evaluatedCurrentValue)
.first()
.should("be.visible")
.invoke("text");
if (toValidate) expect(val).to.eq(currentValue);
return val;
}
public UploadFile(fixtureName: string, execStat = true) {
cy.get(this.locator._uploadFiles).attachFile(fixtureName).wait(1000);
cy.get(this.locator._uploadBtn).click().wait(3000);
this.ValidateNetworkExecutionSuccess("@postExecute", execStat);
}
public AssertDebugError(label: string, messgae: string) {
cy.get(this.locator._debuggerIcon)
.should("be.visible")
.click({ force: true });
cy.get(this.locator._errorTab)
.should("be.visible")
.click({ force: true });
cy.get(this.locator._debuggerLabel).eq(0)
.invoke("text")
.then(($text) => {
expect($text).to.eq(label);
});
cy.get(this.locator._debugErrorMsg).eq(0)
.invoke("text")
.then(($text) => {
expect($text).contains(messgae);
});
}
}

View File

@ -1,10 +1,7 @@
import { AggregateHelper } from "./AggregateHelper";
import { CommonLocators } from "../Objects/CommonLocators";
const agHelper = new AggregateHelper();
const locator = new CommonLocators()
import { ObjectsRegistry } from "../Objects/Registry"
export class ApiPage {
public agHelper = ObjectsRegistry.AggregateHelper
public locator = ObjectsRegistry.CommonLocators;
private _createapi = ".t--createBlankApiCard"
private _resourceUrl = ".t--dataSourceField"
@ -12,22 +9,32 @@ export class ApiPage {
private _headerValue = (index: number) => ".t--actionConfiguration\\.headers\\[0\\]\\.value\\." + index + ""
private _paramKey = (index: number) => ".t--actionConfiguration\\.queryParameters\\[0\\]\\.key\\." + index + ""
private _paramValue = (index: number) => ".t--actionConfiguration\\.queryParameters\\[0\\]\\.value\\." + index + ""
private _paramsTab = "//li//span[text()='Params']"
_bodyKey = (index: number) => ".t--actionConfiguration\\.bodyFormData\\[0\\]\\.key\\." + index + ""
_bodyValue = (index: number) => ".t--actionConfiguration\\.bodyFormData\\[0\\]\\.value\\." + index + ""
_bodyTypeDropdown = "//span[text()='Type'][@class='bp3-button-text']/parent::button"
private _apiRunBtn = ".t--apiFormRunBtn"
private _queryTimeout = "//input[@name='actionConfiguration.timeoutInMillisecond']"
private _apiTab = (tabValue: string) => "span:contains('" + tabValue + "')"
_responseBody = ".CodeMirror-code span.cm-string.cm-property"
private _blankAPI = "span:contains('New Blank API')"
private _apiVerbDropdown = ".t--apiFormHttpMethod"
private _verbToSelect = (verb: string) => "//div[contains(@class, 't--dropdown-option')]//span[contains(text(),'" + verb + "')]"
private _bodySubTab = (subTab: string) => `[data-cy='tab--${subTab}']`
_visibleTextSpan = (spanText: string) => "//span[text()='" + spanText + "']"
_visibleTextDiv = (divText: string) => "//div[text()='" + divText + "']"
_noBodyMessageDiv = "#NoBodyMessageDiv"
_noBodyMessage = "This request does not have a body"
_imageSrc = "//img/parent::div"
private _trashDelete = "span[name='delete']"
CreateAndFillApi(url: string, apiname: string = "", queryTimeout = 30000) {
cy.get(locator._createNew).click({ force: true });
CreateApi(apiName: string = "", apiVerb: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' = 'GET',) {
cy.get(this.locator._createNew).click({ force: true });
cy.get(this._blankAPI).click({ force: true });
agHelper.ValidateNetworkStatus("@createNewApi", 201)
this.agHelper.ValidateNetworkStatus("@createNewApi", 201)
// cy.get("@createNewApi").then((response: any) => {
// expect(response.response.body.responseMeta.success).to.eq(true);
// cy.get(agHelper._actionName)
// cy.get(this.agHelper._actionName)
// .click()
// .invoke("text")
// .then((text) => {
@ -36,12 +43,18 @@ export class ApiPage {
// });
// }); // to check if Api1 = Api1 when Create Api invoked
if (apiname)
agHelper.RenameWithInPane(apiname)
if (apiName)
this.agHelper.RenameWithInPane(apiName)
cy.get(this._resourceUrl).should("be.visible");
if (apiVerb != 'GET')
this.SelectAPIVerb(apiVerb)
}
CreateAndFillApi(url: string, apiname: string = "", apiVerb: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' = 'GET', queryTimeout = 30000) {
this.CreateApi(apiname, apiVerb)
this.EnterURL(url)
agHelper.WaitAutoSave()
agHelper.Sleep(2000);// Added because api name edit takes some time to reflect in api sidebar after the call passes.
this.agHelper.AssertAutoSave()
this.agHelper.Sleep(2000);// Added because api name edit takes some time to reflect in api sidebar after the call passes.
cy.get(this._apiRunBtn).should("not.be.disabled");
this.SetAPITimeout(queryTimeout)
}
@ -51,58 +64,103 @@ export class ApiPage {
.first()
.click({ force: true })
.type(url, { parseSpecialCharSequences: false });
agHelper.WaitAutoSave()
this.agHelper.AssertAutoSave()
}
EnterHeader(hKey: string, hValue: string) {
cy.get(this._apiTab('Headers')).eq(0).should('be.visible').click();
this.SelectAPITab('Headers');
cy.get(this._headerKey(0))
.first()
.click({ force: true })
.type(hKey, { parseSpecialCharSequences: false });
.type(hKey, { parseSpecialCharSequences: false })
.type("{esc}");
cy.get(this._headerValue(0))
.first()
.click({ force: true })
.type(hValue, { parseSpecialCharSequences: false });
agHelper.WaitAutoSave()
.type(hValue, { parseSpecialCharSequences: false })
.type("{esc}");
this.agHelper.AssertAutoSave()
}
EnterParams(pKey: string, pValue: string) {
cy.xpath(this._paramsTab)
.should("be.visible")
.click({ force: true });
this.SelectAPITab('Params')
cy.get(this._paramKey(0))
.first()
.click({ force: true })
.type(pKey, { parseSpecialCharSequences: false });
.type(pKey, { parseSpecialCharSequences: false })
.type("{esc}");
cy.get(this._paramValue(0))
.first()
.click({ force: true })
.type(pValue, { parseSpecialCharSequences: false });
agHelper.WaitAutoSave()
.type(pValue, { parseSpecialCharSequences: false })
.type("{esc}");
this.agHelper.AssertAutoSave()
}
EnterBodyFormData(subTab: 'FORM_URLENCODED' | 'MULTIPART_FORM_DATA', bKey: string, bValue: string, type = "", toTrash = false) {
this.SelectAPITab('Body')
this.SelectSubTab(subTab)
if (toTrash)
{
cy.get(this._trashDelete).click()
cy.xpath(this._visibleTextSpan('Add more')).click()
}
cy.get(this._bodyKey(0))
.first()
.click({ force: true })
.type(bKey, { parseSpecialCharSequences: false })
.type("{esc}");
if (type) {
cy.xpath(this._bodyTypeDropdown).eq(0).click()
cy.xpath(this._visibleTextDiv(type)).click()
}
cy.get(this._bodyValue(0))
.first()
.click({ force: true })
.type(bValue, { parseSpecialCharSequences: false })
.type("{esc}");
this.agHelper.AssertAutoSave()
}
RunAPI() {
cy.get(this._apiRunBtn).click({ force: true });
agHelper.ValidateNetworkExecutionSuccess("@postExecute")
this.agHelper.ValidateNetworkExecutionSuccess("@postExecute")
}
SetAPITimeout(timeout: number) {
cy.get(this._apiTab('Settings')).click();
this.SelectAPITab('Settings');
cy.xpath(this._queryTimeout)
.clear()
.type(timeout.toString());
this.SelectAPITab('Headers');
}
cy.get(this._apiTab('Headers')).eq(0).click();
SelectAPITab(tabName: 'Headers' | 'Params' | 'Body' | 'Pagination' | 'Authentication' | 'Settings') {
cy.xpath(this._visibleTextSpan(tabName)).should('be.visible').eq(0).click();
}
SelectSubTab(subTabName: 'NONE' | 'JSON' | 'FORM_URLENCODED' | 'MULTIPART_FORM_DATA' | 'RAW') {
cy.get(this._bodySubTab(subTabName)).eq(0).should('be.visible').click();
}
public CheckElementPresence(selector: string) {
if (selector.startsWith("//"))
cy.xpath(selector).should('be.visible')
else
cy.get(selector).should('be.visible')
}
ValidateQueryParams(param: { key: string; value: string; }) {
cy.xpath(this._paramsTab)
.should("be.visible")
.click({ force: true });
this.SelectAPITab('Params')
this.agHelper.ValidateCodeEditorContent(this._paramKey(0), param.key)
this.agHelper.ValidateCodeEditorContent(this._paramValue(0), param.value)
}
agHelper.ValidateCodeEditorContent(this._paramKey(0), param.key)
agHelper.ValidateCodeEditorContent(this._paramValue(0), param.value)
ValidateHeaderParams(header: { key: string; value: string; }) {
this.SelectAPITab('Headers')
this.agHelper.ValidateCodeEditorContent(this._headerKey(0), header.key)
this.agHelper.ValidateCodeEditorContent(this._headerValue(0), header.value)
}
ReadApiResponsebyKey(key: string) {
@ -117,4 +175,9 @@ export class ApiPage {
cy.wrap(apiResp).as("apiResp")
});
}
}
public SelectAPIVerb(verb: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH') {
cy.get(this._apiVerbDropdown).click()
cy.xpath(this._verbToSelect(verb)).should('be.visible').click()
}
}

View File

@ -1,12 +1,13 @@
import { CommonLocators } from "../Objects/CommonLocators";
import datasourceFormData from "../../fixtures/datasources.json";
import { AggregateHelper } from "./AggregateHelper";
const agHelper = new AggregateHelper();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../Objects/Registry"
export class DataSources {
private agHelper = ObjectsRegistry.AggregateHelper
private locator = ObjectsRegistry.CommonLocators;
private _dsCreateNewTab = "[data-cy=t--tab-CREATE_NEW]"
private _addNewDataSource = ".datasources .t--entity-add-btn"
private _createNewPlgin = (pluginName: string) => ".t--plugin-name:contains('" + pluginName + "')"
private _host = "input[name='datasourceConfiguration.endpoints[0].host']"
private _port = "input[name='datasourceConfiguration.endpoints[0].port']"
private _databaseName = "input[name='datasourceConfiguration.authentication.databaseName']"
@ -17,9 +18,27 @@ export class DataSources {
private _saveDs = ".t--save-datasource"
private _datasourceCard = ".t--datasource"
_templateMenu = ".t--template-menu"
_visibleTextSpan = (spanText: string) => "//span[contains(text(),'" + spanText + "')]"
_dropdownTitle = (ddTitle: string) => "//p[contains(text(),'" + ddTitle + "')]/parent::label/following-sibling::div/div/div"
_reconnectModal = "div.reconnect-datasource-modal"
_activeDSListReconnectModal = (dbName: string) => "//div[contains(@class, 't--ds-list')]//span[text()='" + dbName + "']"
public NavigateToDSAdd() {
cy.get(this._addNewDataSource).last().scrollIntoView()
.should("be.visible")
.click({ force: true });
}
public CreatePlugIn(pluginName: string) {
cy.get(locator._createNewPlgin(pluginName)).click();
cy.get(this._createNewPlgin(pluginName)).click();
}
public NavigateToDSCreateNew() {
this.NavigateToDSAdd()
cy.get(this._dsCreateNewTab)
.should("be.visible")
.click({ force: true });
cy.get(this.locator._loading).should("not.exist");
}
public FillPostgresDSForm(shouldAddTrailingSpaces = false) {
@ -40,32 +59,52 @@ export class DataSources {
public TestDatasource(expectedRes = true) {
cy.get(this._testDs).click();
cy.wait("@testDatasource").should(
"have.nested.property",
"response.body.data.success",
expectedRes,
);
this.agHelper.ValidateNetworkDataSuccess("@testDatasource", expectedRes)
}
public SaveDatasource() {
cy.get(this._saveDs).click();
cy.wait("@saveDatasource")
.then((xhr) => {
cy.log(JSON.stringify(xhr.response!.body));
}).should("have.nested.property", "response.body.responseMeta.status", 200);
this.agHelper.ValidateNetworkStatus("@saveDatasource", 200)
// cy.wait("@saveDatasource")
// .then((xhr) => {
// cy.log(JSON.stringify(xhr.response!.body));
// }).should("have.nested.property", "response.body.responseMeta.status", 200);
}
public NavigateToActiveDSQueryPane(datasourceName: string) {
agHelper.NavigateToDSAdd()
agHelper.GetNClick(locator._activeTab)
this.NavigateToDSAdd()
this.agHelper.GetNClick(this.locator._activeTab)
cy.get(this._datasourceCard)
.contains(datasourceName)
.scrollIntoView()
.should("be.visible")
.closest(this._datasourceCard)
.within(() => {
cy.get(locator._createQuery).click({ force: true });
cy.get(this.locator._createQuery).click({ force: true });
})
agHelper.Sleep(2000); //for the CreateQuery page to load
this.agHelper.Sleep(2000); //for the CreateQuery page to load
}
public ValidateNSelectDropdown(ddTitle: string, currentValue = "", newValue = "") {
let toChange = false;
if (currentValue)
cy.xpath(this._visibleTextSpan(currentValue)).scrollIntoView().should("be.visible", currentValue + " dropdown value not present")
if (newValue) toChange = true;
if (toChange) {
cy.xpath(this._dropdownTitle(ddTitle)).click(); //to expand the dropdown
cy.xpath(this._visibleTextSpan(newValue)).last().click({ force: true }); //to select the new value
}
}
public ReconnectDataSourcePostgres(dbName: string) {
cy.get(this._reconnectModal).should('exist')
cy.xpath(this._activeDSListReconnectModal("PostgreSQL")).should('be.visible')
cy.xpath(this._activeDSListReconnectModal(dbName)).should('be.visible')//.click()
this.ValidateNSelectDropdown("Connection Mode", "", "Read / Write")
this.FillPostgresDSForm()
cy.get(this._saveDs).click();
}
}

View File

@ -0,0 +1,67 @@
import { ObjectsRegistry } from "../Objects/Registry"
export class EntityExplorer {
public agHelper = ObjectsRegistry.AggregateHelper
public locator = ObjectsRegistry.CommonLocators;
public SelectEntityByName(entityNameinLeftSidebar: string) {
cy.xpath(this.locator._entityNameInExplorer(entityNameinLeftSidebar), { timeout: 30000 })
.last()
.click({ multiple: true })
this.agHelper.Sleep()
}
public NavigateToSwitcher(navigationTab: 'explorer' | 'widgets') {
cy.get(this.locator._openNavigationTab(navigationTab)).click()
}
public AssertEntityPresenceInExplorer(entityNameinLeftSidebar: string) {
cy.xpath(this.locator._entityNameInExplorer(entityNameinLeftSidebar))
.should("have.length", 1);
}
public AssertEntityAbsenceInExplorer(entityNameinLeftSidebar: string) {
cy.xpath(this.locator._entityNameInExplorer(entityNameinLeftSidebar)).should('not.exist');
}
public expandCollapseEntity(entityName: string, expand = true) {
cy.xpath(this.locator._expandCollapseArrow(entityName)).invoke('attr', 'name').then((arrow) => {
if (expand && arrow == 'arrow-right')
cy.xpath(this.locator._expandCollapseArrow(entityName)).trigger('click', { multiple: true }).wait(1000);
else if (!expand && arrow == 'arrow-down')
cy.xpath(this.locator._expandCollapseArrow(entityName)).trigger('click', { multiple: true }).wait(1000);
else
this.agHelper.Sleep()
})
}
public ActionContextMenuByEntityName(entityNameinLeftSidebar: string, action = "Delete", subAction = "") {
this.agHelper.Sleep();
cy.xpath(this.locator._contextMenu(entityNameinLeftSidebar))
.last()
.click({ force: true });
cy.xpath(this.locator._contextMenuItem(action))
.click({ force: true })
this.agHelper.Sleep(500)
if (subAction) {
cy.xpath(this.locator._contextMenuItem(subAction))
.click({ force: true })
this.agHelper.Sleep(500)
}
}
public DragDropWidgetNVerify(widgetType: string, x: number, y: number) {
this.NavigateToSwitcher('widgets')
this.agHelper.Sleep()
cy.get(this.locator._widgetPageIcon(widgetType)).first()
.trigger("dragstart", { force: true })
.trigger("mousemove", x, y, { force: true });
cy.get(this.locator._dropHere)
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
.trigger("mouseup", x, y, { eventConstructor: "MouseEvent" });
this.agHelper.AssertAutoSave()//settling time for widget on canvas!
cy.get(this.locator._widgetInCanvas(widgetType)).should('exist')
}
}

View File

@ -1,11 +1,9 @@
import { AggregateHelper } from "./AggregateHelper";
import { CommonLocators } from "../Objects/CommonLocators";
const agHelper = new AggregateHelper();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../Objects/Registry"
export class HomePage {
private agHelper = ObjectsRegistry.AggregateHelper;
private locator = ObjectsRegistry.CommonLocators;
private _username = "input[name='username']"
private _password = "input[name='password']"
private _submitBtn = "button[type='submit']"
@ -39,11 +37,13 @@ export class HomePage {
private _userRoleDropDown = (email: string, role: string) => "//td[text()='" + email + "']/following-sibling::td//span[text()='" + role + "']"
//private _userRoleDropDown = (email: string) => "//td[text()='" + email + "']/following-sibling::td"
private _leaveOrgConfirmModal = ".t--member-delete-confirmation-modal"
private _orgImportAppModal = ".t--import-application-modal"
private _leaveOrgConfirmButton = "[data - cy= t--org-leave - button]"
private _lastOrgInHomePage = "//div[contains(@class, 't--org-section')][last()]//span/span"
_editPageLanding = "//h2[text()='Drag and drop a widget here']"
_usersEmailList = "[data-colindex='1']"
private _orgImport = "[data-cy=t--org-import-app]"
private _uploadFile = "//div/form/input"
public CreateNewOrg(orgNewName: string) {
let oldName: string = ""
@ -52,7 +52,7 @@ export class HomePage {
.first()
.click({ force: true });
cy.wait("@createOrg")
agHelper.Sleep(2000)
this.agHelper.Sleep(2000)
cy.xpath(this._lastOrgInHomePage).first().then($ele => {
oldName = $ele.text();
cy.log("oldName is : " + oldName);
@ -69,7 +69,7 @@ export class HomePage {
cy.get(this._renameOrgInput)
.should("be.visible")
.type(newOrgName.concat("{enter}"));
agHelper.Sleep(2000)
this.agHelper.Sleep(2000)
cy.wait("@updateOrganization").should(
"have.nested.property",
"response.body.responseMeta.status",
@ -101,9 +101,9 @@ export class HomePage {
.click({ force: true })
.type(email);
cy.xpath(this._selectRole).first().click({ force: true });
agHelper.Sleep(500)
this.agHelper.Sleep(500)
cy.xpath(this._userRole(role)).click({ force: true });
agHelper.ClickButton('Invite')
this.agHelper.ClickButton('Invite')
cy.wait("@mockPostInvite")
.its("request.headers")
.should("have.property", "origin", "Cypress");
@ -117,21 +117,17 @@ export class HomePage {
public NavigateToHome() {
cy.get(this._homeIcon).click({ force: true });
agHelper.Sleep(3000)
this.agHelper.Sleep(3000)
//cy.wait("@applications"); this randomly fails & introduces flakyness hence commenting!
cy.get(this._homePageAppCreateBtn).should("be.visible").should("be.enabled");
}
public CreateNewApplication() {
cy.get(this._homePageAppCreateBtn).first().click({ force: true })
cy.wait("@createNewApplication").should(
"have.nested.property",
"response.body.responseMeta.status",
201,
);
cy.get(locator._loading).should("not.exist");
this.agHelper.ValidateNetworkStatus("@createNewApplication", 201)
cy.get(this.locator._loading).should("not.exist");
}
//Maps to CreateAppForOrg in command.js
public CreateAppInOrg(orgName: string, appname: string) {
cy.xpath(this._newOrganizationCreateNewApp(orgName))
@ -143,8 +139,8 @@ export class HomePage {
"response.body.responseMeta.status",
201,
);
cy.get(locator._loading).should("not.exist");
agHelper.Sleep(2000)
cy.get(this.locator._loading).should("not.exist");
this.agHelper.Sleep(2000)
this.RenameApplication(appname)
cy.get(this._buildFromScratchActionCard).click();
cy.wait("@updateApplication").should(
@ -170,11 +166,11 @@ export class HomePage {
//Maps to LogOut in command.js
public LogOutviaAPI() {
cy.request("POST", "/api/v1/logout");
agHelper.Sleep()//for logout to complete!
this.agHelper.Sleep()//for logout to complete!
}
public LogintoApp(uname: string, pswd: string, role: 'App Viewer' | 'Developer' | 'Administrator' = 'Administrator') {
agHelper.Sleep() //waiting for window to load
this.agHelper.Sleep() //waiting for window to load
cy.window().its("store").invoke("dispatch", { type: "LOGOUT_USER_INIT" });
cy.wait("@postLogout");
cy.visit("/user/login");
@ -182,16 +178,16 @@ export class HomePage {
cy.get(this._password).type(pswd);
cy.get(this._submitBtn).click();
cy.wait("@getUser");
agHelper.Sleep(3000)
this.agHelper.Sleep(3000)
if (role != 'App Viewer')
cy.get(this._homePageAppCreateBtn).should("be.visible").should("be.enabled");
}
public FilterApplication(appName: string, orgId: string) {
cy.get(this._searchInput).type(appName);
agHelper.Sleep(2000)
this.agHelper.Sleep(2000)
cy.get(this._appContainer).contains(orgId);
cy.xpath(locator._spanButton('Share'))
cy.xpath(this.locator._spanButton('Share'))
.first()
.should("be.visible")
}
@ -202,7 +198,7 @@ export class HomePage {
.should("be.visible")
.first()
.click();
cy.get(locator._loading).should("not.exist");
cy.get(this.locator._loading).should("not.exist");
cy.wait("@getPagesForViewApp").should(
"have.nested.property",
"response.body.responseMeta.status",
@ -249,7 +245,7 @@ export class HomePage {
"response.body.responseMeta.status",
200,
);
agHelper.Sleep(2500)//wait for members page to load!
this.agHelper.Sleep(2500)//wait for members page to load!
}
public UpdateUserRoleInOrg(orgName: string, email: string, currentRole: string, newRole: string) {
@ -257,9 +253,27 @@ export class HomePage {
cy.xpath(this._userRoleDropDown(email, currentRole)).first().trigger('click');
//cy.xpath(this._userRoleDropDown(email)).first().click({force: true});
cy.get(this._visibleTextSpan(newRole)).last().click({ force: true });
agHelper.Sleep()
this.agHelper.Sleep()
this.NavigateToHome()
}
public ImportApp(fixtureJson: string, reconnect = false) {
cy.get(this._homeIcon).click();
cy.get(this._optionsIcon).first().click();
cy.get(this._orgImport).click({ force: true });
cy.get(this._orgImportAppModal).should("be.visible");
cy.xpath(this._uploadFile).attachFile(fixtureJson).wait(500);
cy.get(this._orgImportAppModal).should("not.exist");
if (!reconnect) {
this.AssertImport()
}
}
public AssertImport() {
this.agHelper.ValidateToastMessage("Application imported successfully")
this.agHelper.Sleep(5000)//for imported app to settle!
cy.get(this.locator._loading).should("not.exist");
}
}

View File

@ -1,63 +1,64 @@
import { AggregateHelper } from "./AggregateHelper";
import { CommonLocators } from "../Objects/CommonLocators";
import apiwidget from "../../locators/apiWidgetslocator.json";
const agHelper = new AggregateHelper();
const locator = new CommonLocators();
import { ObjectsRegistry } from "../Objects/Registry"
export class JSEditor {
public agHelper = ObjectsRegistry.AggregateHelper
public locator = ObjectsRegistry.CommonLocators;
public ee = ObjectsRegistry.EntityExplorer;
private _runButton = "//li//*[local-name() = 'svg' and @class='run-button']";
private _jsObjName = ".t--js-action-name-edit-field span";
private _jsObjTxt = ".t--js-action-name-edit-field input";
private _newJSobj = "span:contains('New JS Object')"
private _bindingsClose = ".t--entity-property-close"
private _propertyList = ".t--entity-property"
public NavigateToJSEditor() {
cy.get(locator._createNew)
cy.get(this.locator._createNew)
.last()
.click({ force: true });
cy.get(this._newJSobj).click({ force: true });
//cy.waitUntil(() => cy.get(locator._toastMsg).should('not.be.visible')) // fails sometimes
agHelper.WaitUntilEleDisappear(locator._toastMsg, 'created successfully', 1000)
//cy.waitUntil(() => cy.get(this.locator._toastMsg).should('not.be.visible')) // fails sometimes
this.agHelper.WaitUntilEleDisappear(this.locator._toastMsg, 'created successfully')
}
public CreateJSObject(JSCode: string, paste = true, completeReplace = false) {
public CreateJSObject(JSCode: string, paste = true, completeReplace = false, toRun = true) {
this.NavigateToJSEditor();
if (!completeReplace) {
cy.get(locator._codeMirrorTextArea)
cy.get(this.locator._codeMirrorTextArea)
.first()
.focus()
.type("{downarrow}{downarrow}{downarrow}{downarrow} ")
}
else {
cy.get(locator._codeMirrorTextArea)
.first()
.focus()
.type("{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}")
.type("{shift}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}", { force: true })
.type("{backspace}",{ force: true });
cy.get(this.locator._codeMirrorTextArea)
.first()
.focus()
.type("{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}")
.type("{shift}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}{uparrow}", { force: true })
.type("{backspace}", { force: true });
// .type("{uparrow}", { force: true })
// .type("{ctrl}{shift}{downarrow}", { force: true })
// .type("{del}",{ force: true });
// cy.get(locator._codeEditorTarget).contains('export').click().closest(locator._codeEditorTarget)
// cy.get(this.locator._codthis.eeditorTarget).contains('export').click().closest(this.locator._codthis.eeditorTarget)
// .type("{uparrow}", { force: true })
// .type("{ctrl}{shift}{downarrow}", { force: true })
// .type("{backspace}",{ force: true });
//.type("{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}{downarrow} ")
}
}
cy.get(locator._codeMirrorTextArea)
cy.get(this.locator._codeMirrorTextArea)
.first()
.then((el: any) => {
const input = cy.get(el);
if (paste) {
//input.invoke("val", value);
agHelper.Paste(el, JSCode)
this.agHelper.Paste(el, JSCode)
} else {
input.type(JSCode, {
parseSpecialCharSequences: false, delay: 150
@ -65,34 +66,36 @@ export class JSEditor {
}
});
agHelper.WaitAutoSave()//Ample wait due to open bug # 10284
agHelper.Sleep(5000)//Ample wait due to open bug # 10284
this.agHelper.AssertAutoSave()//Ample wait due to open bug # 10284
this.agHelper.Sleep(5000)//Ample wait due to open bug # 10284
//clicking 1 times & waits for 3 second for result to be populated!
Cypress._.times(1, () => {
cy.xpath(this._runButton)
.first()
.click()
.wait(3000)
})
cy.get(locator._empty).should('not.exist')
cy.get(locator._toastMsg).should("have.length", 0)
if (toRun) {
//clicking 1 times & waits for 3 second for result to be populated!
Cypress._.times(1, () => {
cy.xpath(this._runButton)
.first()
.click()
.wait(3000)
})
cy.get(this.locator._empty).should('not.exist')
cy.get(this.locator._toastMsg).should("have.length", 0)
}
this.GetJSObjectName()
}
public EnterJSContext(endp: string, value: string, paste = true, toToggleOnJS = false) {
if (toToggleOnJS) {
cy.get(locator._jsToggle(endp))
cy.get(this.locator._jsToggle(endp))
.invoke("attr", "class")
.then((classes: any) => {
if (!classes.includes("is-active")) {
cy.get(locator._jsToggle(endp))
cy.get(this.locator._jsToggle(endp))
.first()
.click({ force: true });
}
});
}
cy.get(locator._propertyControl + endp + " " + locator._codeMirrorTextArea)
cy.get(this.locator._propertyControl + endp + " " + this.locator._codeMirrorTextArea)
.first()
.focus()
.type("{uparrow}", { force: true })
@ -102,7 +105,7 @@ export class JSEditor {
cy.focused().then(($cm: any) => {
if ($cm.contents != "") {
cy.log("The field is not empty");
cy.get(locator._propertyControl + endp + " " + locator._codeMirrorTextArea)
cy.get(this.locator._propertyControl + endp + " " + this.locator._codeMirrorTextArea)
.first()
.click({ force: true })
.focused()
@ -110,14 +113,14 @@ export class JSEditor {
force: true,
});
}
agHelper.Sleep()
cy.get(locator._propertyControl + endp + " " + locator._codeMirrorTextArea)
this.agHelper.Sleep()
cy.get(this.locator._propertyControl + endp + " " + this.locator._codeMirrorTextArea)
.first()
.then((el: any) => {
const input = cy.get(el);
if (paste) {
//input.invoke("val", value);
agHelper.Paste(el, value)
this.agHelper.Paste(el, value)
} else {
input.type(value, {
parseSpecialCharSequences: false,
@ -125,7 +128,7 @@ export class JSEditor {
}
});
});
agHelper.WaitAutoSave()//Allowing time for Evaluate value to capture value
this.agHelper.AssertAutoSave()//Allowing time for Evaluate value to capture value
}
public RenameJSObjFromForm(renameVal: string) {
@ -135,16 +138,16 @@ export class JSEditor {
.type(renameVal, { force: true })
.should("have.value", renameVal)
.blur();
agHelper.Sleep(); //allowing time for name change to reflect in EntityExplorer
this.agHelper.Sleep(); //allowing time for name change to reflect in EntityExplorer
}
public RenameJSObjFromExplorer(entityName: string, renameVal: string) {
agHelper.ActionContextMenuByEntityName("RenamedJSObject", "Edit Name");
cy.xpath(locator._entityNameEditing(entityName)).type(
this.ee.ActionContextMenuByEntityName("RenamedJSObject", "Edit Name");
cy.xpath(this.locator._entityNameEditing(entityName)).type(
renameVal + "{enter}",
);
agHelper.ValidateEntityPresenceInExplorer(renameVal);
agHelper.Sleep(); //allowing time for name change to reflect in EntityExplorer
this.ee.AssertEntityPresenceInExplorer(renameVal);
this.agHelper.Sleep(); //allowing time for name change to reflect in EntityExplorer
}
public GetJSObjectName() {
@ -153,8 +156,8 @@ export class JSEditor {
}
public validateDefaultJSObjProperties(jsObjName: string) {
agHelper.ActionContextMenuByEntityName(jsObjName, "Show Bindings");
cy.get(apiwidget.propertyList).then(function ($lis) {
this.ee.ActionContextMenuByEntityName(jsObjName, "Show Bindings");
cy.get(this._propertyList).then(function ($lis) {
expect($lis).to.have.length(4);
expect($lis.eq(0).text()).to.be.oneOf([
"{{" + jsObjName + ".myFun2()}}",

View File

@ -0,0 +1,106 @@
import { ObjectsRegistry } from "../Objects/Registry"
export class Table {
public agHelper = ObjectsRegistry.AggregateHelper
public locator = ObjectsRegistry.CommonLocators
private _tableWrap = "//div[@class='tableWrap']"
private _tableHeader = this._tableWrap + "//div[@class='thead']//div[@class='tr'][1]"
private _columnHeader = (columnName: string) => this._tableWrap + "//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//div[text()='" + columnName + "']/parent::div/parent::div"
private _nextPage = ".t--widget-tablewidget .t--table-widget-next-page"
private _previousPage = ".t--widget-tablewidget .t--table-widget-prev-page"
private _pageNumber = ".t--widget-tablewidget .page-item"
private _pageNumberServerSideOff = ".t--widget-tablewidget .t--table-widget-page-input input"
_tableRowColumn = (rowNum: number, colNum: number) => `.t--widget-tablewidget .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}] div div`
_tableEmptyColumnData = `.t--widget-tablewidget .tbody .td` //selected-row
_tableSelectedRow = this._tableWrap + "//div[contains(@class, 'tbody')]//div[contains(@class, 'selected-row')]/div"
public WaitUntilTableLoad() {
// cy.waitUntil(() => cy.xpath(this._table, { timeout: 80000 }).should('be.visible'),
// {
// errorMsg: "Element did not appear",
// timeout: 10000,
// interval: 2000
// }).then(() => this.agHelper.Sleep(500))
// this.ReadTableRowColumnData(0, 0).then((cellData) => {
// expect(cellData).not.empty;
// });
cy.waitUntil(() => this.ReadTableRowColumnData(0, 0).then(cellData => expect(cellData).not.empty),
{
errorMsg: "Table is not populated",
timeout: 10000,
interval: 2000
}).then(() => this.agHelper.Sleep(500))
}
public WaitForTableEmpty() {
cy.waitUntil(() => cy.get(this._tableEmptyColumnData).children().should("have.length", 0),
{
errorMsg: "Table is populated when not expected",
timeout: 10000,
interval: 2000
}).then(() => this.agHelper.Sleep(500))
}
public AssertTableHeaderOrder(expectedOrder: string) {
cy.xpath(this._tableHeader).invoke("text").then((x) => {
expect(x).to.eq(expectedOrder);
});
}
public ReadTableRowColumnData(rowNum: number, colNum: number) {
return cy.get(this._tableRowColumn(rowNum, colNum), { timeout: 80000 }).invoke("text");
}
public AssertHiddenColumns(columnNames: string[]) {
columnNames.forEach($header => {
cy.xpath(this._columnHeader($header))
.invoke("attr", "class")
.then((classes) => {
expect(classes).includes("hidden-header");
});
})
}
public NavigateToNextPage() {
let curPageNo: number;
cy.get(this._pageNumber).invoke('text').then($currentPageNo =>
curPageNo = Number($currentPageNo))
cy.get(this._nextPage).click()
cy.get(this._pageNumber).invoke('text').then($newPageNo =>
expect(Number($newPageNo)).to.eq(curPageNo + 1))
}
public NavigateToPreviousPage() {
let curPageNo: number;
cy.get(this._pageNumber).invoke('text').then($currentPageNo =>
curPageNo = Number($currentPageNo))
cy.get(this._previousPage).click()
cy.get(this._pageNumber).invoke('text').then($newPageNo =>
expect(Number($newPageNo)).to.eq(curPageNo - 1))
}
public AssertPageNumber(pageNo: number, serverSide: 'Off' | 'On' = 'On') {
if (serverSide == 'On')
cy.get(this._pageNumber).should('have.text', Number(pageNo))
else {
cy.get(this._pageNumberServerSideOff).should('have.value', Number(pageNo))
cy.get(this._previousPage).should("have.attr", 'disabled')
cy.get(this._nextPage).should("have.attr", 'disabled')
}
if (pageNo == 1)
cy.get(this._previousPage).should("have.attr", 'disabled')
}
public AssertSelectedRow(rowNum: number = 0) {
cy.xpath(this._tableSelectedRow)
.invoke("attr", "data-rowindex")
.then($rowIndex => {
expect(Number($rowIndex)).to.eq(rowNum);
});
}
}

View File

@ -479,7 +479,7 @@ Cypress.Commands.add("LogintoApp", (uname, pword) => {
cy.visit("/user/login");
cy.get(loginPage.username).should("be.visible");
cy.get(loginPage.username).type(uname);
cy.get(loginPage.password).type(pword);
cy.get(loginPage.password).type(pword, { log: false });
cy.get(loginPage.submitBtn).click();
cy.wait("@getUser");
cy.wait(3000);
@ -889,7 +889,8 @@ Cypress.Commands.add("enterDatasource", (datasource) => {
cy.get(apiwidget.resourceUrl)
.first()
.click({ force: true })
.type(datasource, { parseSpecialCharSequences: false });
.type(datasource, { parseSpecialCharSequences: false })
.type("{esc}}");
});
Cypress.Commands.add("changeZoomLevel", (zoomValue) => {