Conversation
WalkthroughThe pull request introduces several testing-related enhancements. A new tag ( Changes
Sequence Diagram(s)sequenceDiagram
participant T as Cypress Test
participant A as AggregateHelper
participant W as Window Object
participant S as Store
T->>A: Call getCanvasWidgetStateByWidgetName(widgetName)
A->>W: cy.window()
W->>S: Access store property
S->>A: Return state via invoke("getState")
A->>T: Return widget state (or null)
sequenceDiagram
participant TR as Test Runner
participant CS as startServerAndRoutes Command
participant FF as featureFlagIntercept
TR->>CS: Initiate server and route setup
CS->>CS: Check test title for ANVIL_EDITOR_TEST/AI_AGENTS_TEST
alt Title includes test flag
CS->>FF: Call featureFlagIntercept with feature config enabled
else Title does not include flag
CS->>FF: Call featureFlagIntercept with empty config
end
FF-->>CS: Return execution result
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (10)
🪧 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
|
1c4a62d to
eaa782e
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/cypress/support/Pages/AggregateHelper.ts (1)
2098-2116: Helper method for retrieving widget state looks good.This method provides a useful way to access canvas widget state by name from the Redux store.
Consider refactoring the find callback to use a direct return statement for cleaner code:
-const widgetId = Object.keys(widgets).find((widgetId) => { - if (widgets[widgetId].widgetName === widgetName) { - return widgets[widgetId]; - } -}); +const widgetId = Object.keys(widgets).find((widgetId) => + widgets[widgetId].widgetName === widgetName +);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (6)
app/client/cypress/support/Constants.js(1 hunks)app/client/cypress/support/Pages/AggregateHelper.ts(1 hunks)app/client/cypress/support/commands.js(2 hunks)app/client/cypress/tags.js(1 hunks)app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx(2 hunks)app/client/packages/design-system/widgets/src/components/TextArea/src/types.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- app/client/cypress/support/Constants.js
- app/client/cypress/tags.js
- app/client/packages/design-system/widgets/src/components/TextArea/src/types.ts
- app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...
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/support/commands.jsapp/client/cypress/support/Pages/AggregateHelper.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-lint / client-lint
- GitHub Check: client-prettier / prettier-check
- GitHub Check: chromatic-deployment
- GitHub Check: chromatic-deployment
- GitHub Check: storybook-tests
🔇 Additional comments (4)
app/client/cypress/support/commands.js (2)
4-4: Import statement updated correctly.The import statement now includes AI_AGENTS_TEST, which is properly used in the conditional logic.
744-747: Clean conditional logic extension.The condition has been expanded to check for AI agents tests, maintaining the same feature flag behavior when either condition is met.
app/client/cypress/support/Pages/AggregateHelper.ts (2)
2118-2134: Datasource state retrieval method looks clean.The implementation provides a straightforward way to look up datasource state by name. Good null handling when datasource is not found.
2136-2152: Action state retrieval method looks good.This method follows the same pattern as the other helper methods, maintaining consistency in the API.
One observation: the method assumes actions follow a structure where name is at
action.config.name. If this structure changes, this method would break silently.Consider verifying this access pattern across various action types to ensure it's robust, or adding safeguards:
-const action = actions.find( - (action: any) => action.config.name === actionName, -); +const action = actions.find( + (action: any) => action.config?.name === actionName, +);
/ok-to-test tags="@tag.Anvil" <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced an AI Agents integration tag, broadening the available options for future enhancements. - Added new public methods for retrieving widget, datasource, and action states, improving testability and state management. - **Tests** - The text input component now supports a new testing identifier attribute, greatly improving targeting in automated tests. - Enhanced testing commands provide more reliable state tracking and feature flag management, contributing to a more stable application experience. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13719108635> > Commit: d7fc099 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13719108635&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Anvil` > Spec: > <hr>Fri, 07 Mar 2025 11:14:32 UTC <!-- end of auto-generated comment: Cypress test results -->
/ok-to-test tags="@tag.Anvil"
Summary by CodeRabbit
New Features
Tests
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13719108635
Commit: d7fc099
Cypress dashboard.
Tags:
@tag.AnvilSpec:
Fri, 07 Mar 2025 11:14:32 UTC