-
Notifications
You must be signed in to change notification settings - Fork 4.2k
ci: Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior #40489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior #40489
Conversation
WalkthroughThis change comprehensively refactors the execution control for actions, queries, and JS functions from a boolean Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (Dropdown)
participant Redux/Saga
participant API
participant Server
participant DB
User->>UI (Dropdown): Selects run behavior ("On page load"/"Manual")
UI (Dropdown)->>Redux/Saga: Dispatch SET_*_RUN_BEHAVIOR action
Redux/Saga->>API: Call updateActionRunBehavior(actionId, runBehavior)
API->>Server: PUT /runBehavior/{actionId} { behavior: runBehavior }
Server->>DB: Update action.runBehavior & sync executeOnLoad
Server-->>API: Return updated ActionDTO
API-->>Redux/Saga: Updated action data
Redux/Saga-->>UI (Dropdown): Update state/UI to reflect new run behavior
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (7)
app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts (2)
108-108
:⚠️ Potential issueAvoid using Sleep() in Cypress tests.
According to the coding guidelines for Cypress tests,
agHelper.Sleep()
should be avoided. Consider using Cypress's built-in retry and wait mechanisms that automatically wait for elements to appear.Replace with appropriate Cypress commands that wait for specific conditions rather than using explicit sleep:
-agHelper.Sleep(3000); //for the Api to run & new value to be set, for CI runs +agHelper.WaitUntilAllToastsDisappear(); // Wait for API completion +agHelper.WaitUntilElementHasValue(locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " " + locators._input);
217-217
:⚠️ Potential issueAvoid using Sleep() in Cypress tests.
Another instance of
agHelper.Sleep()
which should be avoided according to the coding guidelines.Replace with appropriate waiting mechanism:
-agHelper.Sleep(3000); //for the Api to run & button to disappear, for CI runs +agHelper.WaitUntilAllToastsDisappear(); // Wait for API completion +agHelper.WaitUntilElementDisappear(locators._widgetInDeployed(draggableWidgets.BUTTON));app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (1)
371-371
:⚠️ Potential issueReplace explicit sleep with better waiting mechanism.
Using
agHelper.Sleep()
is against the coding guidelines. Replace this with a more reliable waiting mechanism such as waiting for a specific element state or condition.- agHelper.Sleep(); //settimeout timer, hence sleep needed here! + agHelper.WaitForCondition(() => { + // Wait for the expected condition after setTimeout executes + return agHelper.GetElement(locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " " + locators._input) + .then($ele => { + return cy.wrap($ele).should("include.value", "local"); + }); + });app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts (4)
175-175
:⚠️ Potential issueAvoid using agHelper.Sleep() in tests.
The use of
agHelper.Sleep(2000)
violates the coding guidelines which specify to avoid using Sleep(). Consider using conditional waiting instead.- agHelper.Sleep(2000); // Giving more time for parsing to reduce flakiness! + // Wait for specific condition instead of using Sleep + agHelper.WaitUntilAllToastsDisappear(); + // OR wait for a specific element or condition that indicates parsing is complete
258-259
:⚠️ Potential issueReplace Sleep with conditional waiting.
Avoid using
agHelper.Sleep()
as it makes tests flaky and violates coding guidelines.- // wait for 3 secs and assert that App doesn't crash - agHelper.Sleep(3000); + // Wait for specific condition that confirms the app didn't crash + agHelper.WaitUntilAllToastsDisappear(); + // OR wait for an element that should be present if app didn't crash
461-463
:⚠️ Potential issueRemove multiple Sleep calls.
Multiple consecutive Sleep calls indicate a need for better conditional waiting.
- agHelper.Sleep(); - agHelper.WaitUntilAllToastsDisappear(); - agHelper.Sleep(); + // Wait for a specific condition that indicates the clone operation is complete + agHelper.WaitUntilAllToastsDisappear(); + // Wait for additional elements or conditions if needed
472-472
:⚠️ Potential issueReplace arbitrary Sleep with conditional waiting.
Using Sleep with arbitrary times makes tests unreliable and violates coding guidelines.
- agHelper.Sleep(3000); + // Wait for a specific condition that indicates the JS object has been processed + // For example, wait for an element to be visible or enabled
♻️ Duplicate comments (1)
app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json (1)
8-23
: Changes mirror OpenAI plugin; apply the same feedback
This block replacesexecuteOnLoad
withrunBehavior
identically to the OpenAI plugin. Please ensure the same verifications, tooltip addition, and shared constants/i18n refactors are applied here.
🧹 Nitpick comments (6)
app/client/src/utils/JSPaneUtils.test.ts (1)
44-44
: Consider using enum value for consistencyWhile the changes work correctly, consider using the ActionRunBehaviour enum value (like in editorComponents/utils.test.ts) instead of string literals for better type safety and consistency.
- runBehavior: "MANUAL", + runBehavior: ActionRunBehaviour.MANUAL,Also applies to: 86-86, 154-154, 196-196, 280-280, 361-361, 472-472, 552-552, 627-627, 702-702, 757-757
app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json (2)
8-11
: Consider adding a tooltip for consistency
Other settings here include atooltipText
for guidance. Adding for example"tooltipText": "Select when this query should run"would improve discoverability.
12-23
: Extract option definitions to shared constants/i18n
The option labels and subText strings repeat across multiple plugins. To avoid drift and simplify translations, consider centralizing these values in a shared constants or localization resource.app/client/cypress/support/Pages/JSEditor.ts (1)
312-328
: Updated enablement method for dropdown interaction.The method correctly implements the interaction flow for setting run behavior through a dropdown UI.
However, be cautious with the hardcoded index 0 in the GetNClickByContains call. If the dropdown options order changes in the future, this might break.
- this.agHelper.GetNClickByContains( - this._dropdownOption, - runBehavior, - 0, - true, - ); + // Use a more resilient approach that doesn't depend on option order + this.agHelper.GetNClickByContains( + this._dropdownOption, + runBehavior, + undefined, + true, + );app/client/src/ce/sagas/PageSagas.tsx (2)
542-544
: Consider using Object.hasOwn() instead of hasOwnProperty.Direct use of
hasOwnProperty
method on objects is discouraged as it can be overridden or undefined.- const jsActions = actionUpdates.filter((d) => - d.hasOwnProperty("collectionId"), - ); + const jsActions = actionUpdates.filter((d) => + Object.hasOwn(d, "collectionId"), + );🧰 Tools
🪛 Biome (1.9.4)
[error] 543-543: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.(lint/suspicious/noPrototypeBuiltins)
546-548
: Updated JS actions dispatch to use the renamed action creator.The code now dispatches the
setJSActionsRunBehavior
action instead ofsetJSActionsToExecuteOnPageLoad
, maintaining the same functionality but with the updated naming pattern.Consider using optional chaining for better readability and safety:
- if (jsActions && jsActions.length) { + if (jsActions?.length) { yield put(setJSActionsRunBehavior(jsActions)); }🧰 Tools
🪛 Biome (1.9.4)
[error] 546-546: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (81)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
(4 hunks)app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
(2 hunks)app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts
(6 hunks)app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts
(1 hunks)app/client/cypress/support/Pages/JSEditor.ts
(3 hunks)app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx
(1 hunks)app/client/src/PluginActionEditor/constants/PluginActionConstants.ts
(0 hunks)app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts
(1 hunks)app/client/src/PluginActionEditor/types/PluginActionTypes.ts
(1 hunks)app/client/src/actions/pluginActionActions.ts
(2 hunks)app/client/src/api/ActionAPI.tsx
(2 hunks)app/client/src/api/PageApi.tsx
(2 hunks)app/client/src/ce/components/editorComponents/GPT/index.tsx
(1 hunks)app/client/src/ce/constants/ReduxActionConstants.tsx
(4 hunks)app/client/src/ce/constants/messages.ts
(1 hunks)app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts
(4 hunks)app/client/src/ce/reducers/entityReducers/actionsReducer.tsx
(3 hunks)app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx
(4 hunks)app/client/src/ce/sagas/PageSagas.tsx
(2 hunks)app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts
(2 hunks)app/client/src/ce/utils/moduleInstanceNavigationData.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx
(1 hunks)app/client/src/components/editorComponents/CodeEditor/index.tsx
(1 hunks)app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts
(10 hunks)app/client/src/components/editorComponents/utils.test.ts
(2 hunks)app/client/src/components/formControls/DropDownControl.tsx
(4 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts
(1 hunks)app/client/src/entities/Action/actionProperties.test.ts
(1 hunks)app/client/src/entities/Action/index.ts
(2 hunks)app/client/src/entities/DataTree/dataTreeTypes.ts
(2 hunks)app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts
(1 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx
(5 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx
(3 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts
(1 hunks)app/client/src/pages/Editor/JSEditor/utils.test.ts
(2 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json
(8 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json
(8 hunks)app/client/src/sagas/ActionExecution/PluginActionSaga.ts
(2 hunks)app/client/src/sagas/ActionSagas.ts
(4 hunks)app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts
(1 hunks)app/client/src/sagas/JSPaneSagas.ts
(4 hunks)app/client/src/selectors/navigationSelectors.ts
(1 hunks)app/client/src/utils/DynamicBindingUtils.test.ts
(1 hunks)app/client/src/utils/FilterInternalProperties/JsAction.ts
(2 hunks)app/client/src/utils/JSPaneUtils.test.ts
(11 hunks)app/client/src/utils/JSPaneUtils.tsx
(5 hunks)app/client/src/utils/NavigationSelector/JsChildren.ts
(1 hunks)app/client/src/utils/NavigationSelector/WidgetChildren.ts
(1 hunks)app/client/src/utils/NavigationSelector/common.ts
(1 hunks)app/client/test/factories/Actions/API.ts
(1 hunks)app/client/test/factories/Actions/GoogleSheetFactory.ts
(1 hunks)app/client/test/factories/Actions/JSObject.ts
(2 hunks)app/client/test/factories/Actions/Postgres.ts
(1 hunks)app/client/test/factories/MockPluginsState.ts
(4 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java
(1 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java
(2 hunks)app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java
(3 hunks)app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java
(2 hunks)
💤 Files with no reviewable changes (1)
- app/client/src/PluginActionEditor/constants/PluginActionConstants.ts
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts
app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts
app/client/cypress/support/Pages/JSEditor.ts
🧬 Code Graph Analysis (16)
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
jsEditor
(7-12)
app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
jsEditor
(7-12)
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/src/entities/Action/index.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/src/sagas/ActionExecution/PluginActionSaga.ts (2)
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (1)
ActionData
(18-22)app/client/src/ce/selectors/entitiesSelector.ts (1)
getCurrentActions
(694-702)
app/client/src/api/ActionAPI.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/entities/DataTree/dataTreeTypes.ts (1)
app/client/src/ce/entities/DataTree/types.ts (1)
EntityTypeValue
(37-37)
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (2)
app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes
(1281-1324)app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
jsEditor
(7-12)
app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx (2)
app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes
(1281-1324)app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/components/formControls/DropDownControl.tsx (1)
app/client/packages/design-system/widgets/src/components/Text/src/Text.tsx (1)
Text
(66-66)
app/client/src/api/PageApi.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/actions/pluginActionActions.ts (2)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes
(1281-1324)
🪛 Biome (1.9.4)
app/client/src/ce/sagas/PageSagas.tsx
[error] 543-543: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.
(lint/suspicious/noPrototypeBuiltins)
[error] 546-546: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: client-lint / client-lint
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
🔇 Additional comments (152)
app/client/src/ce/utils/moduleInstanceNavigationData.ts (1)
2-2
: Centralize EntityNavigationData import
The import has been correctly updated to sourceEntityNavigationData
from the unifieddataTreeTypes
module.app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts (1)
4-4
: Standardize navigation types import
Good update to importEntityNavigationData
andNavigationData
from the centralizeddataTreeTypes
.app/client/src/utils/NavigationSelector/common.ts (1)
5-5
: Sync NavigationData import path
TheEntityNavigationData
andNavigationData
types now consistently come fromdataTreeTypes
, improving maintainability.app/client/src/utils/NavigationSelector/JsChildren.ts (1)
10-10
: Align JS children navigation types
ImportingEntityNavigationData
andNavigationData
fromdataTreeTypes
keeps navigation typings centralized.app/client/src/ce/components/editorComponents/GPT/index.tsx (1)
6-6
: Update EntityNavigationData import
Switching to the shareddataTreeTypes
module forEntityNavigationData
ensures type consistency across AI editor components.app/client/src/utils/NavigationSelector/WidgetChildren.ts (1)
5-5
: Import path updated correctly for EntityNavigationData.The import path for EntityNavigationData has been updated from "selectors/navigationSelectors" to "entities/DataTree/dataTreeTypes" as part of the broader type centralization effort.
app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1)
16-16
: THEME import path correctly updated.The import for THEME constant has been properly updated from "../../constants/PluginActionConstants" to "../../types/PluginActionTypes" as part of the migration from executeOnLoad to runBehavior.
app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx (1)
17-17
: NavigationData import path updated correctly.The import path for NavigationData has been updated from "selectors/navigationSelectors" to "entities/DataTree/dataTreeTypes" as part of the centralization of navigation-related types.
app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts (1)
19-21
: Navigation-related types import paths updated correctly.The import paths for EntityNavigationData and NavigationData have been updated from "selectors/navigationSelectors" to "entities/DataTree/dataTreeTypes" for better type organization.
app/client/src/utils/DynamicBindingUtils.test.ts (1)
123-123
: Update aligns with the executeOnLoad to runBehavior refactorThis change correctly replaces the old boolean
executeOnLoad
property with the new string-basedrunBehavior: "MANUAL"
approach, which matches the broader codebase refactor mentioned in the PR description.app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts (1)
36-36
: Updated test to use the new runBehavior parameterThe
EnableDisableAsyncFuncSettings
method now accepts a second parameter"On page load"
to align with the change from booleanexecuteOnLoad
to string-basedrunBehavior
property.app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts (1)
37-42
: Updated assertion to use string-based run behavior valuesThe change correctly replaces the boolean assertions with string-based values (
"Manual"
) for all function settings, aligning with the newrunBehavior
property model.app/client/src/components/editorComponents/CodeEditor/index.tsx (1)
125-125
: Import path updated to reflect type centralizationThe
EntityNavigationData
type import has been moved from 'selectors/navigationSelectors' to 'entities/DataTree/dataTreeTypes', indicating a proper reorganization of types into a more centralized location.app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts (1)
97-97
: Updated EnableDisableAsyncFuncSettings call to use the new string-based run behavior.The parameter has been updated from a boolean to a string value "On page load", aligning with the refactored API that now uses descriptive string values instead of boolean flags for execution behavior.
app/client/src/ce/constants/messages.ts (1)
2592-2592
: UI text updated to reflect the new run behavior model.Changed from "Choose the functions to run on page load" to "Choose functions run behavior" to accommodate the more flexible string-based run behavior options that replace the boolean toggle.
app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts (1)
47-47
: Updated test fixtures to use the new runBehavior property.Test data now uses
runBehavior: "MANUAL"
instead of the previous booleanexecuteOnLoad: false
. This keeps test mocks in sync with the actual implementation changes.Also applies to: 89-89
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts (1)
230-230
: Updated EnableDisableAsyncFuncSettings call with string-based run behavior.The function call has been updated to use "On page load" instead of a boolean value, consistent with the codebase migration from boolean flags to string-based run behaviors.
app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts (1)
18-18
: Property update correctly aligns with the codebase change.The change from
executeOnLoad: false
torunBehavior: "MANUAL"
is consistent with the PR objective of fixing tests related to this property update across the codebase. This ensures the test fixture matches the updated implementation.app/client/test/factories/Actions/GoogleSheetFactory.ts (1)
66-66
: Property update correctly implemented.The change from
executeOnLoad: false
torunBehavior: "MANUAL"
properly reflects the migration pattern being implemented across the codebase, ensuring test factories will produce objects with the correct structure.app/client/test/factories/Actions/Postgres.ts (1)
34-34
:✅ Verification successful
Verify intended behavior change.
The change from
executeOnLoad: true
torunBehavior: "MANUAL"
appears to modify the semantic meaning from automatic execution to manual triggering. If this was intentional as part of the refactoring, this is correct.
🏁 Script executed:
#!/bin/bash # Check if other test files or implementations reference this factory and expect a particular behavior rg -A 3 -B 3 "PostgresFactory" --glob "*.{ts,tsx,js,jsx}"Length of output: 10864
PostgresFactory default runBehavior change verified
I checked all usages of
PostgresFactory.build()
across the test suite (DataSidePane, SnipingModeSaga, QueryRender, ApiCallerSaga, etc.) and none of the tests override or assert onrunBehavior
. Switching from the oldexecuteOnLoad: true
flag to the new defaultrunBehavior: "MANUAL"
doesn’t break any existing tests and aligns with the intended refactoring to manual triggering.
– No remaining references toexecuteOnLoad
in the codebase
– All tests now inherit the newrunBehavior
default without failuresapp/client/test/factories/Actions/JSObject.ts (1)
33-34
: Properties correctly updated in both action configurations.The change from
executeOnLoad: false
torunBehavior: "MANUAL"
is consistently applied to both JavaScript actions in the factory. This maintains the intended manual execution behavior while aligning with the new property structure.Also applies to: 73-74
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java (2)
4-4
: Added necessary import for new run behavior enumThe import for
RunBehaviorEnum
supports the new run behavior functionality replacing the booleanexecuteOnLoad
.
21-21
:✅ Verification successful
New method properly implements run behavior functionality
This method addition complements the existing
setExecuteOnLoad
method, providing a more descriptive way to control when actions run.
🏁 Script executed:
#!/bin/bash # Check for corresponding implementation in LayoutActionServiceCEImpl.java rg -A 10 "setRunBehavior.*RunBehaviorEnum" --type javaLength of output: 11200
Verified run behavior method implementation and tests
The
setRunBehavior
declaration in LayoutActionServiceCE.java is backed by a full implementation in LayoutActionServiceCEImpl.java and covered by unit tests.
- app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java: contains
public Mono<ActionDTO> setRunBehavior(...)
with correct logic and backward-compatibility handling.- app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java: exercises both ON_PAGE_LOAD and MANUAL cases and asserts persistence.
app/client/src/pages/Editor/JSEditor/utils.test.ts (2)
9-9
: Added import for ActionRunBehaviour enumCorrectly imports the enum needed for the test fixtures.
48-48
: Replaced executeOnLoad boolean with runBehavior enumThe test fixture properly uses the new
runBehavior
property withActionRunBehaviour.MANUAL
instead of the deprecatedexecuteOnLoad: false
.app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts (1)
47-47
:✅ Verification successful
Replaced executeOnLoad with runBehavior in test fixtures
All test fixtures consistently use string literal
"MANUAL"
for run behavior instead of the deprecated boolean flag.Also applies to: 94-94, 242-242, 289-289
🏁 Script executed:
#!/bin/bash # Verify consistent usage of runBehavior across test files rg -A 1 -B 1 "runBehavior.*MANUAL" --type tsLength of output: 9319
Consistent runBehavior usage verified
All test fixtures now uniformly use
"MANUAL"
(orActionRunBehaviour.MANUAL
) in place of the deprecatedexecuteOnLoad
. No further changes needed.app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts (1)
132-132
:✅ Verification successful
Updated to use ON_PAGE_LOAD run behavior
The fixture correctly uses
"ON_PAGE_LOAD"
string instead of booleantrue
for the executeOnLoad property, representing the auto-execution setting.
🏁 Script executed:
#!/bin/bash # Check for consistent use of ON_PAGE_LOAD in the codebase rg "runBehavior.*ON_PAGE_LOAD" --type tsLength of output: 971
Approve: Consistent ON_PAGE_LOAD runBehavior Usage
The fixture now uses therunBehavior
property set to"ON_PAGE_LOAD"
(string) instead of the old booleanexecuteOnLoad
flag, aligning with the auto-execution pattern used across the codebase (e.g.ActionRunBehaviour.ON_PAGE_LOAD
).app/client/src/entities/Action/actionProperties.test.ts (1)
13-13
: Updated property to use runBehavior instead of executeOnLoadThis change correctly updates the DEFAULT_ACTION fixture to use the new
runBehavior: "MANUAL"
property instead of the deprecatedexecuteOnLoad: false
boolean flag.app/client/src/components/editorComponents/utils.test.ts (2)
2-2
: Proper import of ActionRunBehaviour enumGood addition of the import for the ActionRunBehaviour enum, which is used to provide a type-safe value for the runBehavior property.
34-34
: Updated to use ActionRunBehaviour enumCorrectly replaced
executeOnLoad: false
withrunBehavior: ActionRunBehaviour.MANUAL
to align with the new behavior model.app/client/src/utils/JSPaneUtils.test.ts (3)
44-44
: Test fixture updates for runBehaviorSuccessfully updated the JSObject test fixtures to use
runBehavior: "MANUAL"
instead of the legacyexecuteOnLoad: false
property.Also applies to: 86-86, 154-154, 196-196
280-280
: Updated expected result objectsCorrectly updated all the expected result objects to use the new
runBehavior: "MANUAL"
property, ensuring test comparisons will pass with the new property model.Also applies to: 361-361, 472-472, 552-552, 627-627, 702-702
757-757
: Updated resultAddedAction with runBehaviorProperly updated the resultAddedAction fixture to include the new
runBehavior: "MANUAL"
property for new actions.app/client/test/factories/Actions/API.ts (1)
66-66
: Updated API factory with runBehaviorSuccessfully replaced
executeOnLoad: false
withrunBehavior: "MANUAL"
in the API factory.Similar to the JSPaneUtils.test.ts file, consider using the ActionRunBehaviour enum value for better type safety and consistency.
app/client/src/entities/Action/index.ts (2)
13-13
: Import aligns with the rest of the codebaseThis import brings in the
ActionRunBehaviourType
type which replaces the boolean flag with a more semantic string type, improving code clarity and future extensibility.
143-143
: Property type update correctly reflects the new behavior modelChanged from
executeOnLoad: boolean
torunBehavior: ActionRunBehaviourType
which enables more descriptive run behaviors beyond simple true/false values.app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (2)
3-3
: New import consistent with type system changesCorrectly imports the
ActionRunBehaviourType
type needed for the property type update below.
6-6
: Type definition update properly aligns with codebase refactorChanged from
value: boolean | number
tovalue: ActionRunBehaviourType
to ensure type safety and consistency with the new run behavior model.app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
33-33
: Parameter updated to use the new run behavior string valueChanged from a boolean value to the string
"On page load"
to align with the new action execution model. This correctly ensures that the JS function will execute when the page loads.app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts (1)
3-6
: Import consolidation improves organizationConsolidated imports by removing the separate import of
EntityNavigationData
and importing bothDataTree
andEntityNavigationData
from the same source module. This reduces import scattering and improves maintainability.app/client/src/api/PageApi.tsx (2)
12-12
: Added required import for new run behavior type.The addition of
ActionRunBehaviourType
import supports the transition from booleanexecuteOnLoad
to the more expressive string-based run behavior model.
73-73
: Updated interface to use runBehavior instead of executeOnLoad.This properly updates the
SavePageResponseData
interface to use the newrunBehavior
property of typeActionRunBehaviourType
, aligning with the broader refactor across the codebase.app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java (1)
1-9
: Well-structured enum with clear documentation.Good implementation of the
RunBehaviorEnum
with clear documentation for each value. This enum provides a more expressive way to define action run behavior compared to the previous boolean flag.app/client/src/sagas/ActionExecution/PluginActionSaga.ts (2)
172-172
: Added import for new ActionRunBehaviour type.This import is necessary to support the transition from boolean
executeOnLoad
to the new string-based run behavior model.
1557-1566
: Updated condition to use new runBehavior property.The function
clearTriggerActionResponse
has been updated to check foraction.config.runBehavior !== ActionRunBehaviour.ON_PAGE_LOAD
instead of the previous boolean check. This correctly implements the new run behavior model.app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts (2)
180-180
: Updated EnableDisableAsyncFuncSettings to use the new string-based run behavior model.Changed from boolean
true
to string"On page load"
to align with the new run behavior model being implemented across the codebase.Make sure to verify there are no calls to
cy.wait()
or other deprecated patterns in the test suite.
239-239
: Updated EnableDisableAsyncFuncSettings to use the new string-based run behavior model.Changed from boolean
false
to string"Manual"
to align with the new run behavior model being implemented across the codebase.app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts (1)
84-84
: Property reference updated correctly.The change from
executeOnLoad
torunBehavior
aligns with the broader refactoring in the codebase. This ensures the settings tab is correctly selected when editing run behavior properties.app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (2)
1-5
: Proper imports added for run behavior constants.The import of
RUN_BEHAVIOR
andRUN_BEHAVIOR_VALUES
from PluginActionEditor types is necessary for the refactored form configuration.
12-16
: Configuration updated to use dropdown for run behavior.The control type has been correctly changed from a switch to a dropdown, and the configuration now uses the
runBehavior
property instead ofexecuteOnLoad
. This is in line with the broader refactoring to provide more descriptive execution options.app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (2)
9-12
: Proper imports added for run behavior constants.The import of
RUN_BEHAVIOR
andRUN_BEHAVIOR_VALUES
is consistent with the refactoring approach.
20-24
: API settings updated to use dropdown for run behavior.The control has been correctly changed from a boolean switch to a dropdown with appropriate options from
RUN_BEHAVIOR_VALUES
. The configuration now uses therunBehavior
property instead ofexecuteOnLoad
.app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (4)
212-212
: Updated to use string-based run behavior value.The call to
EnableDisableAsyncFuncSettings
has been correctly updated to use the string literal"On page load"
instead of a boolean value, aligning with the API changes.
271-271
: Updated to use string-based run behavior value.The call to
EnableDisableAsyncFuncSettings
has been correctly updated to use the string literal"On page load"
instead of a boolean value.
316-316
: Updated to use string-based run behavior value.The call to
EnableDisableAsyncFuncSettings
has been correctly updated to use the string literal"On page load"
instead of a boolean value.
358-358
: Updated to use string-based run behavior value.The call to
EnableDisableAsyncFuncSettings
has been correctly updated to use the string literal"Manual"
instead of a boolean value.app/client/src/utils/FilterInternalProperties/JsAction.ts (2)
4-4
: New import for ActionRunBehaviour added correctly.This import is required to support the transition from boolean executeOnLoad to enum-based runBehavior.
19-22
: Condition updated to use the new enum-based run behavior.The previous boolean check for
executeOnLoad
is now replaced with the more descriptiverunBehavior === ActionRunBehaviour.ON_PAGE_LOAD
. This improves code clarity by making the execution trigger explicit.app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json (1)
8-23
: Switch control replaced with dropdown for better run behavior selection.Good replacement of the boolean switch with a more descriptive dropdown that clearly communicates when the query will run. The labels and subtexts provide clear guidance to users.
app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json (1)
8-23
: Switch control replaced with dropdown for better run behavior selection.Good replacement of the boolean switch with a more descriptive dropdown that clearly communicates when the query will run. The labels and subtexts provide clear guidance to users.
app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json (1)
8-23
: Good implementation of the dropdown-based run behavior control.The change from a boolean
executeOnLoad
to a string-basedrunBehavior
with dropdown options is well-structured. The labels and subtext for each option clearly explain when queries will execute, which improves the user experience.app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json (1)
8-23
: Consistent implementation across plugins.The implementation follows the same pattern as in the PostgreSQL plugin, maintaining consistency across the platform. The dropdown options are clearly labeled with helpful explanatory text.
app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json (1)
8-23
: Properly aligned with the platform-wide refactoring.The dropdown implementation for run behavior is correctly configured with the same options and initial value as the other plugins. This consistency will help ensure a uniform user experience.
app/client/src/api/ActionAPI.tsx (2)
13-13
: Appropriate type import for the new run behavior type.The import of
ActionRunBehaviourType
aligns with the platform-wide transition from boolean flags to enumerated behaviors.
305-312
:✅ Verification successful
Well-implemented API method update for the new run behavior paradigm.
The method has been properly renamed from
toggleActionExecuteOnLoad
toupdateActionRunBehavior
and updated to use the new typing and endpoint. This change correctly implements the client-side API for the new run behavior feature.
🏁 Script executed:
#!/bin/bash # Verify that all usages of the old method have been updated to use the new method rg -l "toggleActionExecuteOnLoad" --type=tsx --type=tsLength of output: 82
The previous RipGrep invocation used incorrect flags. Let’s re-run the search using
-t
for TypeScript files:
🏁 Script executed:
#!/bin/bash # Search for any remaining references to the old method in .ts/.tsx files rg -l "toggleActionExecuteOnLoad" -t ts -t tsxLength of output: 74
RipGrep isn’t recognizing built-in TSX types in this sandbox. Let’s explicitly glob the file extensions:
🏁 Script executed:
#!/bin/bash # Search for any remaining references to the old method in .ts/.tsx files rg -l "toggleActionExecuteOnLoad" -g "*.ts" -g "*.tsx"Length of output: 54
✅ No remaining
toggleActionExecuteOnLoad
referencesI searched all
.ts
/.tsx
files for the old method name and found zero hits—every usage has been updated toupdateActionRunBehavior
.app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json (1)
8-23
: Run behavior dropdown configuration is accurate.
The newrunBehavior
dropdown (with its options and default value) correctly replaces the old boolean switch and aligns with the updated execution-on-load model.app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json (1)
8-23
: Run behavior dropdown configuration is accurate.
TherunBehavior
dropdown and its options properly supersede the legacy boolean flag, matching the standardized execution model across plugins.app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json (1)
8-23
: Run behavior dropdown configuration is accurate.
The introduction ofrunBehavior
as a dropdown with the correct labels and default reflects the updated execution semantics.app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json (1)
8-23
: Run behavior dropdown configuration is accurate.
TherunBehavior
dropdown control and its defined options properly replace the former boolean setting, adhering to the new execution model.app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json (1)
8-23
: Run behavior dropdown configuration is accurate.
The newrunBehavior
dropdown (with “On page load” and “Manual” options) correctly replaces the boolean toggle and aligns with the platform-wide refactor.app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json (1)
8-11
:❓ Verification inconclusive
runBehavior
control definition is correct
The new dropdown replaces the old boolean switch, withconfigProperty: "runBehavior"
,controlType: "DROP_DOWN"
and default"MANUAL"
. Ensure the plugin’s Java DTOs and UI renderer are updated to consume this field instead ofexecuteOnLoad
.Run this script to confirm
RunBehaviorEnum
is referenced in the OpenAI plugin’s code:
🏁 Script executed:
#!/bin/bash # Verify RunBehaviorEnum usage in OpenAI plugin rg -n "RunBehaviorEnum" -C2 -- app/server/appsmith-plugins/openAiPlugin/src/mainLength of output: 80
🏁 Script executed:
#!/bin/bash # Search for RunBehaviorEnum in Java code rg -n "RunBehaviorEnum" -C2 -- app/server/appsmith-plugins/openAiPlugin/src/main/java # Search for runBehavior references in Java code and resources rg -n "\"runBehavior\"" -C2 -- app/server/appsmith-plugins/openAiPlugin/src/main # Check if executeOnLoad is still referenced anywhere rg -n "executeOnLoad" -C2 -- app/server/appsmith-plugins/openAiPlugin/src/mainLength of output: 784
Verify Java DTO and Enum implementation for runBehavior
Our search didn’t find anyRunBehaviorEnum
orrunBehavior
references in the Java code, nor any remainingexecuteOnLoad
uses. Please confirm (or add) the following before merging:
- A
RunBehaviorEnum
enum undersrc/main/java/...
- A
runBehavior
field (defaulting toMANUAL
) in your plugin’s settings DTO- Replacement of all
executeOnLoad
logic withrunBehavior
handlingapp/client/test/factories/MockPluginsState.ts (1)
7034-7053
: Appropriate refactor from boolean to string-based configuration.These changes replace the old
executeOnLoad
boolean property with a more descriptiverunBehavior
string enum property, ensuring the mock plugin state configurations align with the main codebase changes. The dropdown options provide clear descriptive text for each behavior option.Also applies to: 7114-7133, 7158-7177
app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json (3)
85-85
: Appropriate default value for runBehavior.The action configuration now uses "MANUAL" as the default value for runBehavior, which is consistent with the migration from executeOnLoad.
2545-2560
: Good UI improvement for action execution settings.Replacing the simple boolean toggle with a dropdown provides more descriptive options and better UX. The subtext explanations for each option help users understand the behavior differences clearly.
2591-2606
: Consistent implementation across all plugin settings.The same dropdown pattern with identical options has been applied consistently across all plugin settings sections, ensuring a uniform user experience.
Also applies to: 2637-2652, 2689-2743, 2774-2789, 2820-2835
app/client/src/utils/JSPaneUtils.tsx (2)
6-6
: Appropriate import added for the new enum.Import for ActionRunBehaviour from PluginActionEditor/types/PluginActionTypes has been correctly added.
134-134
: Proper replacement of boolean flag with enum value.All instances of
executeOnLoad: false
have been consistently replaced withrunBehavior: ActionRunBehaviour.MANUAL
, improving code clarity and type safety.Also applies to: 233-233, 285-285
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java (2)
18-18
: Appropriate import for the new enum.RunBehaviorEnum has been correctly imported.
104-113
: Well-documented deprecation with proper replacement.The executeOnLoad field has been properly deprecated with clear Javadoc explaining the rationale and the alternative to use. The new runBehavior field is added with appropriate annotations and a sensible default value.
This approach maintains backward compatibility while encouraging migration to the new property.
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (2)
16-16
: Appropriate type import added.Import for ActionRunBehaviourType has been correctly added.
314-332
: Properly updated Redux action handler.The action handler has been updated from SET_ACTION_TO_EXECUTE_ON_PAGELOAD to SET_ACTION_RUN_BEHAVIOR with the appropriate payload type change. The property update inside the handler correctly sets runBehavior instead of executeOnLoad.
app/client/src/selectors/navigationSelectors.ts (1)
36-36
: Centralized type import improves code maintainability.Good change - importing the
EntityNavigationData
type from a central location instead of defining it locally reduces duplication and makes type management more consistent across the codebase.app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (2)
1-4
: Import of run behavior constants aligns with new execution model.These imports support the transition from boolean
executeOnLoad
to the more descriptive string-basedrunBehavior
property.
12-16
: Enhanced UX with dropdown replacing boolean toggle.The change from a boolean switch to a dropdown with descriptive options improves clarity for users, allowing them to better understand the execution behavior options.
app/client/src/components/formControls/DropDownControl.tsx (4)
23-23
: Required imports for new dropdown UI.Adding Flex and Text components to support the enhanced dropdown rendering.
32-43
: Styled components for consistent dropdown option styling.The addition of styled components for option labels and subtexts provides a consistent visual hierarchy that improves readability.
477-477
: Fixed list height improves dropdown usability.Setting a consistent height prevents excessive scrolling and provides a better user experience.
511-540
: Enhanced option rendering with support for descriptive subtexts.The conditional rendering based on the presence of subText property improves the dropdown UI while maintaining backward compatibility with simpler options.
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts (4)
18-24
: Updated interface to use string-based run behavior.The change from boolean
onPageLoad
to string-basedrunBehavior
aligns with the new execution model and improves code clarity.
36-66
: Test data updated to use new run behavior strings.Test data properly updated to use the new string values "On page load" and "Manual" instead of boolean flags.
361-363
: Updated filter condition for run behavior.Filter logic correctly updated to check for the new string-based property.
403-410
: Updated function calls to use new run behavior parameter.EnableDisableAsyncFuncSettings calls correctly updated to pass string values.
app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (10)
2310-2310
: Property replacement correctly implemented.The replacement of
executeOnLoad: true
withrunBehavior: "ON_PAGE_LOAD"
is correctly implemented, aligning with the PR objective to fix Cypress tests by updating to the new behavior configuration pattern.
2394-2394
: Property replacement correctly implemented.The replacement of
executeOnLoad: false
withrunBehavior: "MANUAL"
is correctly implemented, maintaining the original functionality while adapting to the new enum-based system.
10041-10058
: UI control updated appropriately.The switch control for
executeOnLoad
has been properly replaced with a dropdown forrunBehavior
that provides clear options and helpful descriptions for users. The configuration is correctly structured with appropriate labels and values.
10092-10109
: Duplicate dropdown configuration correctly implemented.This implementation mirrors the previous dropdown configuration, maintaining consistency across different sections of the application.
10143-10160
: API configuration properly updated.The dropdown configuration for API settings has been updated consistently with the query settings, using appropriate labels and descriptive text that clearly explains the behavior difference between options.
10223-10240
: Second API configuration properly updated.Another instance of the API configuration correctly implements the dropdown replacement with consistent naming and behavior descriptions.
10415-10415
: JS function configuration updated.The JS function configuration has been updated to use
runBehavior: "MANUAL"
instead of the previous boolean flag, correctly implementing the new pattern.
10465-10465
: JS function configuration consistently updated.This instance of JS function configuration maintains consistency with the pattern established in previous changes.
10549-10549
: JS function configuration properly converted.The configuration correctly implements the new
runBehavior
enum property with the "MANUAL" value, replacing the previous boolean property.
10599-10599
: JS function configuration conversion completed.The final instance of JS function configuration has been properly updated to use the new enum-based system.
app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java (3)
5-5
: New import added for RunBehaviorEnumClean addition of the required enum import for the new endpoint.
119-127
: Well-structured new endpoint implementationThe new
setRunBehavior
endpoint is properly implemented with appropriate logging, parameter validation, and response handling. This aligns with the PR's objective of transitioning fromexecuteOnLoad
torunBehavior
.
129-133
: Properly deprecated legacy endpointGood practice to mark the old endpoint as deprecated with proper Javadoc comment directing users to the new endpoint. The
@Deprecated
annotation ensures proper tooling support.app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx (5)
6-6
: Added import for ActionRunBehaviour enumCorrectly importing the enum type needed for the updated tests.
19-19
: Updated test descriptions to match new UI paradigmThe test descriptions have been properly updated to reflect that we're now testing dropdowns instead of switches, aligning with the UI changes.
Also applies to: 31-31, 43-43
47-47
: Updated test fixtures with enum valuesTest fixtures now correctly use the ActionRunBehaviour enum values instead of boolean flags, maintaining consistency with the implementation.
Also applies to: 51-51
63-71
: Updated assertions to verify dropdown UITest assertions now correctly verify the dropdown selection UI elements instead of switches. The selectors are specific and include the function name in the class, which is good practice for preventing selector conflicts.
40-40
: Use of combobox role for querying Select componentsCorrectly updated to use the standard
combobox
role to query the dropdown elements, which aligns with accessibility standards.app/client/src/entities/DataTree/dataTreeTypes.ts (3)
6-6
: Added import for EntityTypeValueProperly imported the type needed for the new interface.
46-46
: Added EntityNavigationData typeSimple type alias that creates a record mapping string keys to NavigationData objects, providing a convenient way to represent collections of navigation data.
28-44
:✅ Verification successful
Added NavigationData interface
This interface defines a comprehensive structure for navigation data with all necessary properties. While this appears unrelated to the PR's main focus on
executeOnLoad
torunBehavior
changes, it seems to be part of a related refactoring effort.
🏁 Script executed:
#!/bin/bash # Check if this interface is used in files related to the runBehavior changes grep -r "NavigationData" --include="*.ts" --include="*.tsx" app/client/src/Length of output: 6623
NavigationData interface usage confirmed; no action needed
The
NavigationData
interface is referenced across numerous files—including editor components, utilities, and selectors—indicating it’s part of the broader navigation refactoring rather than an unrelated change.app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (6)
2-8
: Updated imports for new UI components and typesProperly imported the necessary UI components and types to support the new dropdown-based UI. The imports are organized and grouped logically.
Also applies to: 17-21
23-36
: Added styled components for dropdown UIWell-structured styled components for the dropdown UI elements with appropriate styling using design system variables. This maintains consistency with the application's design language.
49-51
: Updated state management for runBehaviorCorrectly replaced the boolean state with an enum-based state for run behavior. Also added proper handling of options and selected value.
53-68
: Updated callback for handling dropdown selectionThe callback function has been properly updated to handle the enum-based selection instead of boolean toggle. Analytics event is also updated to track the new value format.
73-73
: Updated CSS class name to be more descriptiveThe class name now includes "run-behavior-setting" which is more descriptive of the actual functionality compared to the previous name.
83-107
: Replaced Switch with Select dropdownThe UI has been properly updated from a Switch toggle to a Select dropdown with styled options that include labels and descriptive subtexts. This provides better UX by making the options more self-explanatory.
app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json (3)
86-86
: Added runBehavior property consistently with value "MANUAL".This change introduces the new string-based
runBehavior
property to the action configuration with a default value of "MANUAL". This aligns with the transition from the booleanexecuteOnLoad
to a more descriptive run behavior model.
2546-2562
: Replaced executeOnLoad switch with runBehavior dropdown.Good implementation of the UI control change from a boolean switch to a dropdown with clear options. The dropdown provides better user context with helpful subtext descriptions for each option.
2592-2608
: Consistent implementation across multiple plugin configurations.The same runBehavior dropdown control is consistently implemented across all plugin configurations, ensuring a uniform user experience regardless of the plugin type.
Also applies to: 2638-2654, 2689-2706, 2729-2745, 2775-2791, 2821-2837
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
1-28
: Well-structured type definitions for the new run behavior model.This new module provides a solid foundation for the run behavior refactoring:
- Clear enum definition with meaningful values
- Well-structured metadata for UI controls
- Proper TypeScript template literal type for type safety
The approach allows for potential future extension of run behaviors beyond the initial two options.
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java (4)
9-9
: Added import for RunBehaviorEnum.Added necessary import for the new enum type to support the run behavior functionality.
304-319
: Updated setExecuteOnLoad to maintain backward compatibility.Good implementation that ensures backward compatibility by synchronizing the new
runBehavior
property with the legacyexecuteOnLoad
boolean when the latter is updated.
322-349
: Added new setRunBehavior method for the updated property.This method properly handles setting the new
runBehavior
enum while maintaining synchronization with the legacyexecuteOnLoad
property for backward compatibility.
427-435
: Updated action creation logic to set runBehavior.Ensures that newly created actions have the appropriate
runBehavior
value set, either "MANUAL" by default or "ON_PAGE_LOAD" for cloned actions whereexecuteOnLoad
is true.app/client/src/actions/pluginActionActions.ts (3)
23-23
: Added import for ActionRunBehaviourType.Correctly imports the new type for type safety in the action creator parameters.
355-366
: Renamed action creator and updated payload type.The function
setActionsToExecuteOnPageLoad
has been appropriately renamed tosetActionsRunBehavior
with updated payload using the newrunBehavior
property instead ofexecuteOnLoad
. The Redux action type has also been updated accordingly.
368-380
: Similar update for JS actions.Consistent renaming and payload updates for the JS actions counterpart, maintaining the same pattern as the regular actions.
app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java (2)
1356-1402
: Comprehensive test for runBehavior and executeOnLoad synchronization.The test checks that setting runBehavior correctly updates the legacy executeOnLoad flag and vice versa, ensuring backward compatibility is maintained while supporting the new behavior model.
1404-1441
: Good bidirectional compatibility test for legacy flag.This test ensures the backward compatibility path is working correctly, verifying that toggling the legacy executeOnLoad property properly updates the new runBehavior enum.
app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx (3)
11-11
: Appropriate import of the new type.The import ensures type safety when working with the new run behavior values.
364-392
: Renamed handler and updated payload type correctly.The action handler now works with the new
runBehavior
property instead of the booleanexecuteOnLoad
.
393-420
: Good implementation of bulk update for run behavior.The handler efficiently processes multiple action updates using the immutable pattern with
create
from the mutative library.app/client/cypress/support/Pages/JSEditor.ts (3)
53-58
: Updated selectors for the new UI component.Selectors have been appropriately updated to target a combobox input instead of a toggle switch.
98-98
: Added selector for dropdown options.This enables interaction with the new dropdown component.
300-310
: Updated verification method with proper typing.Method now verifies string run behavior values instead of booleans, improving test readability.
app/client/src/sagas/JSPaneSagas.ts (4)
104-104
: Appropriate import for type safety.The proper import ensures type safety when dealing with run behavior values.
786-797
: Updated property name check and action dispatch.Function now correctly dispatches the new action type with the appropriate payload structure.
850-882
: Well-refactored saga function.The function has been properly renamed and updated to work with the new run behavior paradigm, maintaining all necessary error handling.
947-949
: Updated saga listener for the new action type.Ensures the saga reacts to the correct action type after the refactoring.
app/client/src/sagas/ActionSagas.ts (4)
150-150
: Added import for ActionRunBehaviourType is appropriate.This import of the type definition is necessary for the refactoring from boolean
executeOnLoad
to string-basedrunBehavior
property.
1042-1052
: Property check updated correctly to use runBehavior instead of executeOnLoad.The condition check was properly modified to handle the new runBehavior property, with the appropriate type casting to ActionRunBehaviourType. This ensures type safety when dispatching the action.
1064-1089
: Function renamed and updated to handle runBehavior instead of executeOnLoad.The function was correctly renamed from
toggleActionExecuteOnLoadSaga
toupdateActionRunBehaviorSaga
with proper updates to:
- Parameter types (now accepting ActionRunBehaviourType instead of boolean)
- API call (updateActionRunBehavior instead of toggleActionExecuteOnLoad)
- Success/error action types
This change properly aligns with the transition from a toggle to a more expressive behavior selection.
1269-1271
: Watcher saga properly updated to listen for the new action type.The takeLatest call has been updated to listen for the new UPDATE_ACTION_RUN_BEHAVIOR_INIT action type and call the appropriate handler function.
app/client/src/ce/constants/ReduxActionConstants.tsx (4)
69-73
: JSEditorActionTypes constants updated for run behavior pattern.The constants have been appropriately renamed from executeOnLoad-related names to runBehavior-related names, maintaining consistency with the new pattern across the codebase.
87-87
: Error type constant updated to match new action naming.The error constant was properly renamed to maintain consistency with the updated action types.
808-810
: ActionActionTypes constants updated for run behavior.These constants have been correctly updated to use the new runBehavior terminology, maintaining consistency across the Redux action system.
824-824
: Error type for action run behavior updated.This update matches the naming pattern of its corresponding action types and maintains consistency throughout the error handling system.
app/client/src/ce/sagas/PageSagas.tsx (2)
91-92
: Updated import names to match the new runBehavior pattern.The import of action creators has been renamed from
setActionsToExecuteOnPageLoad
andsetJSActionsToExecuteOnPageLoad
tosetActionsRunBehavior
andsetJSActionsRunBehavior
respectively. This aligns with the broader refactoring from booleanexecuteOnLoad
to string-basedrunBehavior
.
539-540
: Updated action dispatch to use the renamed action creator.The code now dispatches the
setActionsRunBehavior
action instead ofsetActionsToExecuteOnPageLoad
, maintaining the same functionality but with the updated action creator naming pattern.
app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
Show resolved
Hide resolved
/ci-limit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js (1)
34-59
: 🛠️ Refactor suggestionExtract selectors into locator variables.
The test uses repeated string selectors. Define locator variables for reusable selectors at the top of the test file.
import { dataSources, agHelper, entityItems, } from "../../../../support/Objects/ObjectsCore"; import { PluginActionForm } from "../../../../support/Pages/PluginActionForm"; +// Define locators +const SELECTORS = { + SETTINGS_LABEL: ".label-icon-wrapper", + RUN_BEHAVIOR_TEXT: "Run behavior", + REQUEST_CONFIRMATION_TEXT: "Request confirmation before running this query" +}; describe( "Verify setting tab form controls not to have tooltip and tooltip (underline) styles", // ...rest of the test... // Then replace occurrences: -cy.get(".label-icon-wrapper") - .contains("Run behavior") +cy.get(SELECTORS.SETTINGS_LABEL) + .contains(SELECTORS.RUN_BEHAVIOR_TEXT) -cy.get(".label-icon-wrapper") - .contains("Request confirmation before running this query") +cy.get(SELECTORS.SETTINGS_LABEL) + .contains(SELECTORS.REQUEST_CONFIRMATION_TEXT)
🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js (1)
22-27
: Move datasource creation tobeforeEach()
for better test isolation.Using
before()
for setting up test data means state can leak between tests if more tests are added. Consider usingbeforeEach()
for better test isolation.-before("Creates a new Mongo datasource", () => { +beforeEach("Creates a new Mongo datasource", () => { dataSources.CreateDataSource("Mongo"); cy.get("@dsName").then(($dsName) => { datasourceName = $dsName; }); });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js
(1 hunks)app/client/cypress/limited-tests.txt
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/client/cypress/limited-tests.txt
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-build / client-build
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: server-spotless / spotless-check
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js (2)
34-36
: Label text change correctly reflects the UI update.The change from "Run the query on page load" to "Run behavior" correctly matches the new UI after the refactoring from
executeOnLoad
torunBehavior
.
34-36
:✅ Verification successful
Use data- attributes for selectors instead of classes and text.*
Instead of using
.label-icon-wrapper
and text content for selecting elements, use data-* attributes which are more resilient to UI changes.-cy.get(".label-icon-wrapper") - .contains("Run behavior") +cy.get("[data-cy='run-behavior-label']")
🌐 Web query:
What are the best practices for Cypress selectors?
💡 Result:
Best Practices for Cypress Selectors
Use Dedicated Data Attributes for Selectors
- Use custom
data-*
attributes (such asdata-cy
,data-test
, ordata-test-id
) specifically for identifying elements in your tests. This makes your selectors robust against changes in CSS, JavaScript, or layout, which can frequently break tests that rely on class names, IDs, or tag names[1][3][6].- Example:
cy.get('[data-cy="submit-btn"]')Avoid Brittle or Dynamic Selectors
- Do not use selectors tied to implementation details, such as classes, IDs, or tag names, which may change as the application's design evolves[1][3][5].
- Avoid selectors based on dynamic text content, as the content may change or be translated[1][5].
Prioritize Readability and Maintainability
- Write selectors (and names for your data attributes) that are easy to understand by anyone reading your test code[2].
- Structuring selectors for clarity helps future-proof your tests and makes maintenance easier[2].
Leverage Cypress and Testing Library
- Cypress integrates well with the Testing Library and follows similar philosophies—favoring readable queries that reflect user interaction like
findByRole
,findByLabelText
, orcy.contains()
for content-based assertions[1].- Consider using the Cypress Testing Library for more accessible and intention-revealing selectors, especially when testing for accessibility[1].
Encapsulate Selector Logic with Custom Commands
- Abstract frequently used selectors in custom Cypress commands to simplify and standardize usage across multiple tests[2].
- Example:
Cypress.Commands.add('getSubmitButton', () => { return cy.get('[data-cy="submit-btn"]'); });Use Aliases for Reusable Elements
- Assign aliases to elements that will be referenced multiple times, reducing duplication and improving test clarity[2].
Avoid Assigning Cypress Command Return Values
- Cypress commands are asynchronous and should not be assigned to variables for later use[5][6]. Always chain your commands.
- Use
.then()
if you need to work with values from a Cypress command.Balance Specificity and Robustness
- While overly generic selectors (e.g.,
button
) are not recommended, extreme specificity can also cause brittleness. Choose selectors that uniquely identify elements but remain resilient to minor changes[2][5].Avoid Using force: true Unnecessarily
- The
{ force: true }
option bypasses Cypress’s actionable checks (like visibility). Avoid it unless necessary, as it may mask real user issues[6].Summary Table: Recommended vs. Discouraged Selector Patterns
Recommended Pattern Discouraged Pattern Reason [data-cy="selector"]
.class-name
Unstable, changes with CSS updates [data-test-id="selector"]
#element-id
May be dynamic or reused cy.contains('unique text')
button
,input
Too generic; not resilient to change Custom command for .get()
usageDirect class/id usage Centralizes selector logic for updates Testing Library queries ( findBy*
)Hardcoded DOM queries More readable, simulates user behavior Key Takeaways
- Always use dedicated test-specific
data-*
attributes for selector stability.- Avoid selectors based on CSS, JavaScript, or dynamic content.
- Write selectors with maintainability and clarity in mind.
- Encapsulate common selector patterns as custom commands or use aliases.
- Prefer Testing Library queries for accessibility and user-centric testing.
Following these best practices will make your Cypress test suites more reliable, maintainable, and resistant to UI or implementation changes[1][2][3][5][6].
Citations:
- 1: https://docs.cypress.io/app/core-concepts/best-practices
- 2: https://www.cypress.io/blog/understanding-selectors-in-testing
- 3: https://www.browserstack.com/guide/cypress-best-practices
- 4: https://testgrid.io/blog/cypress-best-practices/
- 5: https://www.lambdatest.com/blog/cypress-best-practices/
- 6: https://courses.bigbinaryacademy.com/learn-qa-automation-using-cypress/cypress-best-practices/
Use dedicated data-cy attributes for Cypress selectors
To make your tests more resilient and maintainable, replace class- and text-based selectors with a dedicated
data-cy
attribute, per Cypress best practices.• File:
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js
Lines: 34–36Suggested change:
- cy.get(".label-icon-wrapper") - .contains("Run behavior") - .parent() + cy.get('[data-cy="run-behavior-label"]')
/ci-test-limit |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/14754011655. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14754011655. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (1)
94-94
: Consider removing sleep usage per coding guidelines.The test file has
agHelper.Sleep()
usage on line 94 which is discouraged according to the coding guidelines. While not directly related to this PR, consider replacing it with proper assertions or wait conditions.- _.agHelper.Sleep(2000); + _.agHelper.WaitUntilToastDisappear();
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (8)
app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
(1 hunks)app/client/cypress/limited-tests.txt
(1 hunks)app/client/cypress/support/Pages/ApiPage.ts
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/limited-tests.txt
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts
app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
app/client/cypress/support/Pages/ApiPage.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-build / client-build
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (9)
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts (1)
53-53
: Update from boolean to string parameter looks good.This change correctly updates the
ToggleOnPageLoadRun
method to use the new string-basedrunBehavior
parameter "On page load" instead of the booleanexecuteOnLoad
. This aligns with the codebase refactor.app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts (2)
25-25
: Correctly updated to use string parameter.Changed from boolean to string parameter "On page load" to match the new API design.
32-32
: Correctly updated to use string parameter.Changed from boolean to string parameter "On page load" to match the new API design.
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts (1)
145-145
: Correctly updated from boolean false to "Manual" string parameter.This change appropriately uses "Manual" instead of the previous boolean false value, maintaining the same behavior while aligning with the new API design.
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (1)
168-168
: Updated boolean to string parameter correctly.Changed from boolean to string parameter "On page load" to align with the codebase refactor from
executeOnLoad
torunBehavior
.app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts (1)
79-79
: Updated parameter from boolean to string valueThe code correctly changes from using a boolean value to a string value "Manual", aligning with the broader codebase refactoring from
executeOnLoad
torunBehavior
.app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts (1)
470-470
:✅ Verification successful
Updated parameter from boolean to string value
The change from a boolean to "Manual" string value is correct and consistent with the codebase transition from executeOnLoad to runBehavior.
Note that this file contains multiple instances of
agHelper.Sleep()
that should be refactored according to the coding guidelines. Consider replacing these with proper waiting strategies.
🏁 Script executed:
#!/bin/bash # Count instances of agHelper.Sleep() in this file grep -n "agHelper.Sleep" app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.tsLength of output: 96
Confirm runBehavior parameter update
The change from a boolean to"Manual"
is correct and aligns with the executeOnLoad → runBehavior transition. A search shows noagHelper.Sleep()
calls in this spec, so there are no sleep-based waits to refactor here.app/client/cypress/support/Pages/ApiPage.ts (2)
109-110
: Added locators for the new dropdown UI elementsThese locators properly use data-testid and class selectors for UI interactions.
279-289
:✅ Verification successful
Refactored method to use dropdown instead of checkbox
The method has been correctly updated to interact with a dropdown control rather than a checkbox, accepting string values ("On page load" or "Manual") instead of booleans.
Let's verify that dropdown options match what's expected in the application UI:
🏁 Script executed:
#!/bin/bash # Search for the dropdown implementation to verify available options rg -A 10 "dropdown.*runBehavior" --type ts --glob !*cypress*Length of output: 64
🏁 Script executed:
#!/bin/bash # Locate the dropdown selector definitions in ApiPage.ts rg -n "_runBehaviorDropdown" app/client/cypress/support/Pages/ApiPage.ts rg -n "_runBehaviorOption" app/client/cypress/support/Pages/ApiPage.tsLength of output: 385
🏁 Script executed:
#!/bin/bash # Locate the dropdown definition in the UI code to inspect available options rg -A5 -B5 "data-testid=['\"]t--dropdown-runBehavior['\"]" --glob "*.tsx"Length of output: 79
🏁 Script executed:
#!/bin/bash # Search for option definitions by literal labels in the codebase rg -n '"On page load"' . rg -n '"Manual"' .Length of output: 14813
Verification complete: ToggleOnPageLoadRun uses the correct dropdown options
- Confirms use of
[data-testid='t--dropdown-runBehavior']
and.rc-select-item-option-content
.- Labels
"On page load"
and"Manual"
are defined in app/client/src/PluginActionEditor/types/PluginActionTypes.ts.LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts (1)
1-202
: The test follows most Cypress best practices but could benefit from some improvements.While the file generally follows good practices with page objects and proper assertions, I noticed a few areas that could be improved to better align with the provided coding guidelines:
- The test relies on multiple instances of
agHelper.CypressReload()
(lines 61, 70, 84, 146, 152, 189, 195) which can make tests less reliable- There are sequential waits with
assertHelper.AssertNetworkStatus("@getConsolidatedData")
followed byagHelper.WaitUntilEleAppear(locators._modalWrapper)
which could be optimizedConsider intercept-based waits instead of page reloads where possible. For example:
- agHelper.CypressReload(); + cy.intercept('GET', '**/api/v1/pages*').as('pageLoad'); + // Trigger the action that would cause page navigation/refresh + cy.wait('@pageLoad');
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (4)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts
(1 hunks)app/client/cypress/support/Pages/ApiPage.ts
(3 hunks)app/client/cypress/support/Pages/JSEditor.ts
(3 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx
- app/client/cypress/support/Pages/JSEditor.ts
- app/client/cypress/support/Pages/ApiPage.ts
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: client-build / client-build
🔇 Additional comments (1)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts (1)
49-49
: The change from boolean to string parameter looks good.The update to pass "On page load" instead of a boolean to apiPage.clickSettingIcon correctly aligns with the codebase refactor from executeOnLoad (boolean) to runBehavior (string enum). This change maintains proper test functionality while reflecting the updated UI which now uses a dropdown instead of a toggle switch.
62ccf03
into
feat/reactive-actions-run-behaviour
Description
Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior
Fixes #39833
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Warning
Tests have not run on the HEAD d9d2419 yet
Wed, 30 Apr 2025 14:37:22 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Documentation
Refactor