diff --git a/app/client/cypress/e2e/Regression/ClientSide/JSObject/Copied_JSObject_Settings_Bug31475_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/JSObject/Copied_JSObject_Settings_Bug31475_spec.ts new file mode 100644 index 000000000000..d1a08a04db66 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/JSObject/Copied_JSObject_Settings_Bug31475_spec.ts @@ -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); + }); + }, +); diff --git a/app/client/cypress/limited-tests.txt b/app/client/cypress/limited-tests.txt index 3a997515912b..7cebfbb36394 100644 --- a/app/client/cypress/limited-tests.txt +++ b/app/client/cypress/limited-tests.txt @@ -1,5 +1,5 @@ # To run only limited tests - give the spec names in below format: -cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js +cypress/e2e/Regression/ClientSide/JSObject/Copied_JSObject_Settings_Bug31475_spec.ts # For running all specs - uncomment below: #cypress/e2e/**/**/*