-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: Fix api on load issue due to no setting config issue #38969
Conversation
WalkthroughThe changes update the Cypress test for the API with page load and input widget binding. The test now imports a JSON fixture instead of relying on external test data and widget locators. The test cases were simplified by selecting an existing API entity, directly validating response status and input values, and deploying the app without intermediate steps. Additionally, a new JSON fixture detail has been added to configure application metadata, page layouts, widget properties, and an API action named "PageLoadApi" that executes on page load. Changes
Sequence Diagram(s)sequenceDiagram
participant TR as Test Runner
participant HP as Home Page
participant ED as EditorNavigation
participant API as "PageLoadApi"
participant IW as Input Widget
TR->>HP: Navigate to Home Page
TR->>HP: Import App Data ("Api_withPageload_Input_TestData.json")
TR->>ED: Select "PageLoadApi" entity
HP->>API: Trigger API on page load
API-->>HP: Return API response
TR->>IW: Verify widget input values
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🪧 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
|
/ci-test-limit-count run_count=30 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/Binding/Api_withPageload_Input_spec.js |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13116059124. |
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 (1)
app/client/cypress/e2e/Regression/ClientSide/Binding/Api_withPageload_Input_spec.js (1)
37-40
: Maintain consistent selector pattern across tests.Use the same data-* attribute selector pattern for consistency with the previous input widget tests.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/Binding/Api_withPageload_Input_spec.js
(1 hunks)app/client/cypress/fixtures/Api_withPageload_Input_TestData.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/fixtures/Api_withPageload_Input_TestData.json (1)
Pattern 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/Binding/Api_withPageload_Input_spec.js (1)
Pattern 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.
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: perform-test / rts-build / build
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-build / client-build
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ClientSide/Binding/Api_withPageload_Input_spec.js (1)
12-15
: LGTM! Good use of ImportApp for test setup.The change to use
ImportApp
instead ofAddDsl
provides a more complete and maintainable test setup.app/client/cypress/fixtures/Api_withPageload_Input_TestData.json (1)
1-1
: LGTM! Well-structured test data configuration.The JSON configuration provides a complete setup for the test scenario, including necessary widget properties, API actions, and bindings.
cy.get(publish.inputWidget + " " + "input") | ||
.first() | ||
.invoke("attr", "value") | ||
.should("contain", "3"); |
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.
🛠️ Refactor suggestion
Use data- attributes for selectors instead of DOM traversal.*
Replace the selector publish.inputWidget + " " + "input"
with a data-* attribute selector for better maintainability and reliability.
Example:
-cy.get(publish.inputWidget + " " + "input")
+cy.get("[data-cy=input-widget-field]")
Also applies to: 33-36
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13116059124.
|
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.
Lgtm
…g#38969) ## Description Updated the test case code with import app. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Binding" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13116038995> > Commit: 486ff22 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13116038995&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Binding` > Spec: > <hr>Mon, 03 Feb 2025 16:12:35 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Upgraded page load functionality now triggers API actions seamlessly upon page refresh, ensuring input fields display accurate, up-to-date information. - Enhanced application configuration supports dynamic widget behavior for a more responsive and intuitive experience. - Overall, these improvements boost reliability and streamline interactions, delivering a more consistent user interface. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Updated the test case code with import app.
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Binding"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13116038995
Commit: 486ff22
Cypress dashboard.
Tags:
@tag.Binding
Spec:
Mon, 03 Feb 2025 16:12:35 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit