Skip to content

Commit

Permalink
verifying replication of JS Object settings during copy action
Browse files Browse the repository at this point in the history
  • Loading branch information
shadabbuchh committed Dec 31, 2024
1 parent de2d5a4 commit 0ae0a95
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import HomePage from "../../../../locators/HomePage";
import { jsEditor, agHelper } from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
PageLeftPane,
PagePaneSegment,
} from "../../../../support/Pages/EditorNavigation";
import PageList from "../../../../support/Pages/PageList";

describe(
" To test [Bug]: Function settings of a JS Object are not obeyed when copied/moved to another page #31475",
{ tags: ["@tag.JS"] },
() => {
// Bug: https://github.com/appsmithorg/appsmith/issues/31475
it.skip("Verify if settings are replicated in a copied JS Object", () => {
jsEditor.CreateJSObject("", { prettify: false, toRun: false });

// Step 2: Add a new blank page
PageList.AddNewPage("New blank page");

// Step 3: Navigate back to the source page
EditorNavigation.NavigateToPage("Page1", true);

// Step 4: Switch to the JS Objects segment in the left pane
PageLeftPane.switchSegment(PagePaneSegment.JS);

// Step 5: Enable "Run on page load" for a specific function
jsEditor.EnableDisableAsyncFuncSettings("myFun1");

// Step 6: Copy the JS Object to the target page
agHelper.GetNClick(jsEditor._moreActions, 0, true);
agHelper.HoverElement(
`${HomePage.portalMenuItem}:contains("Copy to page")`,
);
agHelper.GetNClick(`${HomePage.portalMenuItem}:contains("Page2")`);

// Step 7: Refresh the page to ensure the JS Object is updated
agHelper.RefreshPage();

// Step 8: Verify that the "Run on page load" setting is still enabled for the function
jsEditor.VerifyAsyncFuncSettings("myFun1", true);
});
},
);

0 comments on commit 0ae0a95

Please sign in to comment.