Skip to content

Commit

Permalink
Merge pull request #38036 from appsmithorg/release
Browse files Browse the repository at this point in the history
09/12 Daily Promotion
  • Loading branch information
btsgh authored Dec 9, 2024
2 parents 54c8e78 + 44288f1 commit 5f9f0fb
Show file tree
Hide file tree
Showing 117 changed files with 3,074 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .github/config.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/ad-hoc-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Generate info.json
run: |
if [[ -f scripts/generate_info_json.sh ]]; then
scripts/generate_info_json.sh
scripts/generate_info_json.sh ${{ inputs.tag }}
fi
- name: Place server artifacts-es
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe(
dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl
}123`;
apiPage.CreateAndFillApi(randomApi);
apiPage.RunAPI(false, 20, {
apiPage.RunAPI(false, 2000, {
expectedPath: "response.body.data.body.data.isExecutionSuccess",
expectedRes: false,
});
Expand All @@ -24,7 +24,7 @@ describe(
);

apiPage.EnterHeader(">", "");
apiPage.RunAPI(false, 20, {
apiPage.RunAPI(false, 2000, {
expectedPath: "response.body.data.body.data.isExecutionSuccess",
expectedRes: false,
});
Expand All @@ -37,7 +37,7 @@ describe(
});

apiPage.EnterHeader("", "");
apiPage.RunAPI(false, 20, {
apiPage.RunAPI(false, 2000, {
expectedPath: "response.body.data.body.data.isExecutionSuccess",
expectedRes: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,19 @@ describe(
);
_.agHelper.GetNClick(OneClickBindingLocator.searchableColumn);
_.agHelper.GetNClick(
OneClickBindingLocator.columnDropdownOption(
"searchableColumn",
"imdb_id",
),
OneClickBindingLocator.columnDropdownOption("searchableColumn", "id"),
);
_.agHelper.GetNClick(OneClickBindingLocator.connectData);
_.table.WaitUntilTableLoad(0, 0, "v2");
_.propPane.OpenTableColumnSettings("imdb_id");
_.propPane.OpenTableColumnSettings("id");
_.propPane.TypeTextIntoField("Regex", "{{test}}");
_.debuggerHelper.AssertErrorCount(1);
_.propPane.ToggleSection("validation");
_.propPane.NavigateBackToPropertyPane();

_.debuggerHelper.OpenDebugger();
_.debuggerHelper.ClicklogEntityLink();
_.agHelper.GetNAssertContains(_.propPane._paneTitle, "imdb_id");
_.agHelper.GetNAssertContains(_.propPane._paneTitle, "id");
_.debuggerHelper.CloseBottomBar();
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
_.entityExplorer.DeleteWidgetFromEntityExplorer("Table1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ describe(
PageLeftPane.switchSegment(PagePaneSegment.UI);
PageLeftPane.assertPresence("Table1");
PageLeftPane.switchSegment(PagePaneSegment.Queries);
cy.RenameEntity(apiName);
cy.validateMessage(apiName);
cy.CreationOfUniqueAPIcheck(apiName);
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe(
//Create and run query.

_.dataSources.EnterQuery(
"SELECT * FROM users ORDER BY id LIMIT 10;",
"SELECT * FROM users ORDER BY username LIMIT 10;",
1000,
);
_.dataSources.RunQuery();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,125 +1,55 @@
import {
agHelper,
locators,
entityExplorer,
propPane,
deployMode,
homePage,
} from "../../../../../support/Objects/ObjectsCore";

import testdata from "../../../../../fixtures/testdata.json";
import EditorNavigation, {
EntityType,
} from "../../../../../support/Pages/EditorNavigation";

describe(
"Iframe widget Tests",
{ tags: ["@tag.Widget", "@tag.Iframe", "@tag.Binding"] },
function () {
before(() => {
entityExplorer.DragDropWidgetNVerify("iframewidget", 550, 100);
homePage.ImportApp("IframeWidgetPostMessage.json");
});

const srcDoc = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Iframe Widget Test</title>
</head>
<body>
<!-- Your iframe widget with a simple srcdoc content -->
<iframe srcdoc="<html><body><p>This is a simple srcdoc content.</p></body></html>" style="border: 2px solid red;"></iframe>
</body>
</html>`;

const getIframeBody = () => {
const getIframeBody = (i: number) => {
return cy
.get(".t--draggable-iframewidget iframe")
.eq(i)
.its("0.contentDocument.body")
.should("not.be.empty")
.then(cy.wrap);
};

it("1. Verify content and user interaction", function () {
propPane.UpdatePropertyFieldValue("URL", testdata.iframeUrl);
getIframeBody()
.find(".header-logo")
.should("have.attr", "href", testdata.iframeUrlSubstring);
EditorNavigation.SelectEntityByName("Iframe2", EntityType.Widget);
getIframeBody(1)
.find(".navbar__logo > img")
.eq(0)
.should("have.attr", "src")
.and("include", "logo");

// Title
propPane.UpdatePropertyFieldValue("Title", "Test Title");
agHelper.AssertAttribute(
".t--draggable-iframewidget iframe",
"title",
"Test Title",
1,
);

// User interaction - Click
getIframeBody().find(locators._pageHeaderToggle).click({ force: true });
getIframeBody().find(locators._pageHeaderMenuList).should("be.visible");
getIframeBody().find(locators._pageHeaderToggle).click({ force: true });
getIframeBody()
.find(locators._pageHeaderMenuList)
.should("not.be.visible");

// Full screen
getIframeBody().find(locators._enterFullScreen).click({ force: true });
getIframeBody()
.find(locators._dashboardContainer)
.should(
"have.class",
"application-demo-new-dashboard-container-fullscreen",
);
getIframeBody().find(locators._exitFullScreen).click({ force: true });
getIframeBody()
.find(locators._dashboardContainer)
.should(
"not.have.class",
"application-demo-new-dashboard-container-fullscreen",
);
});

it("2. Verify onMessageReceived, onSrcDocChanged, onURLChanged", function () {
// onMessageReceived
propPane.SelectPlatformFunction("onMessageReceived", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Message Received",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);

getIframeBody()
.find("a:contains('Social Feed')")
.first()
.click({ force: true });
agHelper.ValidateToastMessage("Message Received");

// onSrcDocChanged
propPane.SelectPlatformFunction("onSrcDocChanged", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Value Changed",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);

propPane.UpdatePropertyFieldValue("srcDoc", srcDoc);
agHelper.ValidateToastMessage("Value Changed");
getIframeBody()
.find("iframe")
.its("0.contentDocument.body")
.find("p")
.should("have.text", "This is a simple srcdoc content.");

// onURLChanged
propPane.SelectPlatformFunction("onURLChanged", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"URL Changed",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);

propPane.UpdatePropertyFieldValue("URL", testdata.iframeRandomUrl);
agHelper.ValidateToastMessage("URL Changed");
getIframeBody(1).find(locators._pageHeaderToggle).click({ force: true });
getIframeBody(1).find(locators._pageHeaderMenuList).should("be.visible");
});

it("3. Verify colors, borders and shadows", () => {
it("2. Verify colors, borders and shadows", () => {
propPane.MoveToTab("Style");

// Change Border Color
Expand All @@ -136,12 +66,39 @@ describe(
//Verify details in Deploy mode
deployMode.DeployApp();
//agHelper.AssertCSS("iframe", "border-color", "rgb(185, 28, 28)");
agHelper.AssertCSS("iframe", "border-radius", "0px");
agHelper.AssertCSS("iframe", "border-radius", "0px", 1);
agHelper.AssertCSS(
"iframe",
"box-shadow",
"rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px",
1,
);
deployMode.NavigateBacktoEditor();
});

it("3. Verify onMessageReceived, onSrcDocChanged, onURLChanged", function () {
EditorNavigation.SelectEntityByName("Iframe1", EntityType.Widget);
propPane.UpdatePropertyFieldValue("URL", " ");
agHelper.ValidateToastMessage("url updated");

agHelper.ClickButton("Submit");
getIframeBody(0)
.find("input")
.should("be.visible")
.invoke("val")
.then((inputValue) => {
expect(inputValue).to.equal("submitclicked");
});

propPane.UpdatePropertyFieldValue(
"srcDoc",
`<!DOCTYPE html>
<html lang="en">
<head></head>
<body></body>
</html>`,
);
agHelper.ValidateToastMessage("src updated");
});
},
);
1 change: 1 addition & 0 deletions app/client/cypress/fixtures/IframeWidgetPostMessage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"artifactJsonType":"APPLICATION","clientSchemaVersion":1.0,"serverSchemaVersion":11.0,"exportedApplication":{"name":"Untitled application 2","isPublic":false,"pages":[{"id":"Page1","isDefault":true}],"publishedPages":[{"id":"Page1","isDefault":true}],"viewMode":false,"appIsExample":false,"unreadCommentThreads":0.0,"unpublishedApplicationDetail":{"appPositioning":{"type":"FIXED"},"navigationSetting":{},"themeSetting":{"sizing":1.0,"density":1.0,"appMaxWidth":"LARGE"}},"publishedApplicationDetail":{"appPositioning":{"type":"FIXED"},"navigationSetting":{},"themeSetting":{"sizing":1.0,"density":1.0,"appMaxWidth":"LARGE"}},"color":"#D9E7FF","icon":"uk-pounds","slug":"untitled-application-2","unpublishedCustomJSLibs":[],"publishedCustomJSLibs":[],"evaluationVersion":2.0,"applicationVersion":2.0,"collapseInvisibleWidgets":true,"isManualUpdate":false,"deleted":false},"datasourceList":[],"customJSLibList":[],"pageList":[{"unpublishedPage":{"name":"Page1","slug":"page1","layouts":[{"viewMode":false,"dsl":{"widgetName":"MainContainer","backgroundColor":"none","rightColumn":4896.0,"snapColumns":64.0,"detachFromLayout":true,"widgetId":"0","topRow":0.0,"bottomRow":690.0,"containerStyle":"none","snapRows":124.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"version":90.0,"minHeight":1292.0,"dynamicTriggerPathList":[],"parentColumnSpace":1.0,"dynamicBindingPathList":[],"leftColumn":0.0,"children":[{"needsErrorInfo":false,"boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","mobileBottomRow":39.0,"widgetName":"Iframe1","dynamicPropertyPathList":[],"srcDoc":"<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n </head>\n <body>\n <label class=\"custom-field one\" id=\"test\">\n <input type=\"text\" placeholder=\"getMsg\"/>\n </label>\n\n <script>\n const input = document.querySelector('input');\n input.addEventListener('change', (e) => {\n window.parent.postMessage(e.target.value, \"*\");\n });\n\n window.addEventListener('message', (e) => {\n input.value = e.data;\n });\n </script>\n </body>\n </html>","topRow":7.0,"bottomRow":39.0,"parentRowSpace":10.0,"source":"","type":"IFRAME_WIDGET","mobileRightColumn":52.0,"borderOpacity":100.0,"animateLoading":true,"parentColumnSpace":13.0625,"dynamicTriggerPathList":[{"key":"onMessageReceived"},{"key":"onSrcDocChanged"},{"key":"onURLChanged"}],"leftColumn":29.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"boxShadow"}],"borderWidth":1.0,"flexVerticalAlignment":"start","key":"fueiozx7gr","rightColumn":53.0,"widgetId":"6i2a7e908e","isVisible":true,"version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":7.0,"onURLChanged":"{{showAlert('url updated', '');}}","responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":28.0,"onMessageReceived":"{{storeValue('text', Iframe1.message);\nshowAlert('Hey Iframe Called.', '');}}","onSrcDocChanged":"{{showAlert('src updated', '');}}"},{"resetFormOnClick":false,"needsErrorInfo":false,"boxShadow":"none","mobileBottomRow":31.0,"widgetName":"Button1","onClick":"{{postWindowMessage('submitclicked', \"Iframe1\", \"*\");}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","topRow":27.0,"bottomRow":31.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","mobileRightColumn":14.0,"animateLoading":true,"parentColumnSpace":13.0625,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":0.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"text":"Submit","isDisabled":false,"key":"co05qm838o","rightColumn":14.0,"isDefaultClickDisabled":true,"widgetId":"9lyzanrky4","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":27.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"buttonVariant":"PRIMARY","placement":"CENTER"},{"needsErrorInfo":false,"boxShadow":"none","mobileBottomRow":16.0,"widgetName":"Input1","topRow":9.0,"bottomRow":16.0,"parentRowSpace":10.0,"labelWidth":5.0,"autoFocus":false,"type":"INPUT_WIDGET_V2","mobileRightColumn":19.0,"animateLoading":true,"parentColumnSpace":13.0625,"dynamicTriggerPathList":[],"resetOnSubmit":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"accentColor"},{"key":"borderRadius"},{"key":"defaultText"}],"labelPosition":"Top","labelStyle":"","inputType":"TEXT","isDisabled":false,"key":"rionsri36t","labelTextSize":"0.875rem","isRequired":false,"rightColumn":19.0,"dynamicHeight":"FIXED","widgetId":"yd1qq15u3x","accentColor":"{{appsmith.theme.colors.primaryColor}}","showStepArrows":false,"minWidth":450.0,"isVisible":true,"label":"Label","version":2.0,"parentId":"0","labelAlignment":"left","renderMode":"CANVAS","isLoading":false,"mobileTopRow":9.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"iconAlign":"left","defaultText":"{{appsmith.store.text}}","minDynamicHeight":4.0},{"needsErrorInfo":false,"boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","mobileBottomRow":69.0,"widgetName":"Iframe2","topRow":37.0,"bottomRow":69.0,"parentRowSpace":10.0,"source":"https://docs.appsmith.com/","type":"IFRAME_WIDGET","mobileRightColumn":29.0,"borderOpacity":100.0,"animateLoading":true,"parentColumnSpace":13.0625,"dynamicTriggerPathList":[],"leftColumn":5.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"boxShadow"}],"borderWidth":1.0,"flexVerticalAlignment":"start","key":"e6wucjdesu","rightColumn":29.0,"widgetId":"bapiv4pebd","isVisible":true,"version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":37.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":5.0}]},"layoutOnLoadActions":[],"layoutOnLoadActionErrors":[],"validOnPageLoadActions":true,"id":"Page1","deleted":false,"policies":[],"userPermissions":[]}],"userPermissions":[],"policyMap":{}},"publishedPage":{"name":"Page1","slug":"page1","layouts":[{"viewMode":false,"dsl":{"widgetName":"MainContainer","backgroundColor":"none","rightColumn":1224.0,"snapColumns":16.0,"detachFromLayout":true,"widgetId":"0","topRow":0.0,"bottomRow":1250.0,"containerStyle":"none","snapRows":33.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"version":4.0,"minHeight":1292.0,"dynamicTriggerPathList":[],"parentColumnSpace":1.0,"dynamicBindingPathList":[],"leftColumn":0.0,"children":[]},"validOnPageLoadActions":true,"id":"Page1","deleted":false,"policies":[],"userPermissions":[]}],"userPermissions":[],"policyMap":{}},"gitSyncId":"6752892a7db55e68232d2529_b5478fdf-4849-44e9-b4c1-152d6ec1bd9f","deleted":false}],"actionList":[],"actionCollectionList":[],"editModeTheme":{"name":"Default-New","displayName":"Modern","isSystemTheme":true,"deleted":false},"publishedTheme":{"name":"Default-New","displayName":"Modern","isSystemTheme":true,"deleted":false}}
4 changes: 2 additions & 2 deletions app/client/cypress/fixtures/testdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"UPGRADEUSERNAME": "[email protected]",
"UPGRADEPASSWORD": "Test@123",
"APPURL": "http://localhost:8081/app/app1/page1-63d38854252ca15b7ec9fabb",
"iframeUrl": "https://elfsight.com/social-feed-widget/iframe/",
"iframeUrlSubstring": "https://elfsight.com/",
"iframeUrl": "https://docs.appsmith.com/build-apps/overview/",
"iframeUrlSubstring": "https://docs.appsmith.com/",
"iframeRandomUrl": "https://www.appsmith.com/"
}
21 changes: 9 additions & 12 deletions app/client/cypress/support/ApiCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require("cy-verify-downloads").addCustomCommand();
require("cypress-file-upload");
import ApiEditor from "../locators/ApiEditor";

const apiwidget = require("../locators/apiWidgetslocator.json");
const explorer = require("../locators/explorerlocators.json");
import { ObjectsRegistry } from "./Objects/Registry";
Expand Down Expand Up @@ -114,12 +115,10 @@ Cypress.Commands.add("CreationOfUniqueAPIcheck", (apiname) => {
cy.wait("@createNewApi");
// cy.wait("@getUser");
cy.get(apiwidget.resourceUrl).should("be.visible");
agHelper.RenameQuery(apiname);
cy.get(".ads-v2-tooltip .ads-v2-text").should(($x) => {
expect($x).contain(
apiname.concat(" is already being used or is a restricted keyword."),
);
});
agHelper.RenameQuery(
apiname,
apiname.concat(" is already being used or is a restricted keyword."),
);
});

Cypress.Commands.add("RenameEntity", (value, selectFirst) => {
Expand All @@ -138,12 +137,10 @@ Cypress.Commands.add("CreateApiAndValidateUniqueEntityName", (apiname) => {
agHelper.GetNClick(apiwidget.createapi);
cy.wait("@createNewApi");
cy.get(apiwidget.resourceUrl).should("be.visible");
agHelper.RenameQuery(apiname);
cy.get(".ads-v2-tooltip .ads-v2-text").should(($x) => {
expect($x).contain(
apiname.concat(" is already being used or is a restricted keyword."),
);
});
agHelper.RenameQuery(
apiname,
apiname.concat(" is already being used or is a restricted keyword."),
);
});

Cypress.Commands.add("validateMessage", (value) => {
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ export class CommonLocators {
_treeSelectedContent = ".rc-tree-select-selection-item-content";
_switcherIcon = ".switcher-icon";
_root = "#root";
_pageHeaderToggle = ".mobile-ui-page-header-toggle-icon";
_pageHeaderMenuList = ".mobile-ui-page-header-menu-list";
_pageHeaderToggle = ".navbar__items>button";
_pageHeaderMenuList = ".navbar-sidebar__backdrop";
_enterFullScreen = ".application-demo-new-dashboard-control-enter-fullscreen";
_dashboardContainer = ".application-demo-new-dashboard-container";
_exitFullScreen = ".application-demo-new-dashboard-control-exit-fullscreen";
Expand Down
Loading

0 comments on commit 5f9f0fb

Please sign in to comment.