chore: removed duplicate spec (#38342)
## Description this test steps are already covered. Fixes # https://app.zenhub.com/workspaces/stability-pod-6690c4814e31602e25cab7fd/issues/gh/appsmithorg/appsmith/38343 ## Automation /ok-to-test tags="@tag.JS" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12478571141> > Commit: 343daa41aade926f9ec78c173ab562f3d649551f > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12478571141&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.JS` > Spec: > <hr>Tue, 24 Dec 2024 08:05:26 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Removed the end-to-end test file for JavaScript objects' on-load actions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
bc2480d559
commit
3c802d9e56
|
|
@ -1,115 +0,0 @@
|
|||
import {
|
||||
agHelper,
|
||||
apiPage,
|
||||
dataSources,
|
||||
deployMode,
|
||||
jsEditor,
|
||||
locators,
|
||||
propPane,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
import EditorNavigation, {
|
||||
EntityType,
|
||||
AppSidebarButton,
|
||||
AppSidebar,
|
||||
} from "../../../../support/Pages/EditorNavigation";
|
||||
|
||||
let jsName: any;
|
||||
|
||||
describe(
|
||||
"JSObjects OnLoad Actions tests",
|
||||
{ tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] },
|
||||
function () {
|
||||
beforeEach(() => {
|
||||
agHelper.RestoreLocalStorageCache();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
agHelper.SaveLocalStorageCache();
|
||||
});
|
||||
|
||||
it("1. Tc 60, 1912 - Verify JSObj calling API - OnPageLoad calls", () => {
|
||||
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
|
||||
agHelper.AddDsl(
|
||||
"JSApiOnLoadDsl",
|
||||
locators._widgetInCanvas("imagewidget"),
|
||||
);
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
cy.fixture("datasources").then((datasourceFormData: any) => {
|
||||
AppSidebar.navigate(AppSidebarButton.Editor);
|
||||
apiPage.CreateAndFillApi(
|
||||
"http://host.docker.internal:5001",
|
||||
"AppsmithTed",
|
||||
30000,
|
||||
);
|
||||
apiPage.ToggleConfirmBeforeRunning(true);
|
||||
|
||||
apiPage.CreateAndFillApi(
|
||||
datasourceFormData["randomTrumpApi"],
|
||||
"WhatTrumpThinks",
|
||||
30000,
|
||||
);
|
||||
apiPage.ToggleConfirmBeforeRunning(true);
|
||||
});
|
||||
jsEditor.CreateJSObject(
|
||||
`export default {
|
||||
callTrump: async () => {
|
||||
return WhatTrumpThinks.run()},
|
||||
callAppsmithTed: () => {
|
||||
return AppsmithTed.run()}
|
||||
}`,
|
||||
{
|
||||
paste: true,
|
||||
completeReplace: true,
|
||||
toRun: false,
|
||||
shouldCreateNewJSObj: true,
|
||||
},
|
||||
);
|
||||
|
||||
cy.get("@jsObjName").then((jsObjName) => {
|
||||
jsName = jsObjName;
|
||||
EditorNavigation.SelectEntityByName(
|
||||
jsName as string,
|
||||
EntityType.JSObject,
|
||||
);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("callAppsmithTed", false); //OnPageLoad made true once mapped with widget
|
||||
|
||||
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Default value",
|
||||
"{{" + jsObjName + ".callAppsmithTed.data}}",
|
||||
);
|
||||
cy.get(locators._toastMsg)
|
||||
.children()
|
||||
.should("contain", "AppsmithTed")
|
||||
.and("contain", jsName as string)
|
||||
.and("contain", "will be executed automatically on page load");
|
||||
|
||||
EditorNavigation.SelectEntityByName("Input2", EntityType.Widget);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Default value",
|
||||
"{{" + jsObjName + ".callTrump.data}}",
|
||||
);
|
||||
|
||||
agHelper.AssertContains(
|
||||
(("[" + jsName) as string) +
|
||||
".callTrump] will be executed automatically on page load",
|
||||
"be.visible",
|
||||
locators._toastMsg,
|
||||
);
|
||||
|
||||
deployMode.DeployApp();
|
||||
|
||||
agHelper.RefreshPage("getConsolidatedData");
|
||||
|
||||
agHelper.Sleep(4000); //to let the api's call be finished & populate the text fields before validation!
|
||||
agHelper
|
||||
.GetText(locators._textAreainputWidgetv2InDeployed, "text", 1)
|
||||
.then(($quote: any) => cy.wrap($quote).should("not.be.empty"));
|
||||
|
||||
agHelper
|
||||
.GetText(locators._textAreainputWidgetv2InDeployed)
|
||||
.then(($trump: any) => cy.wrap($trump).should("not.be.empty"));
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
Loading…
Reference in New Issue
Block a user