-
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
test: datepicker3 test fix #39019
base: release
Are you sure you want to change the base?
test: datepicker3 test fix #39019
Conversation
WalkthroughThe pull request updates the Cypress test for the DatePicker widget. It enhances the test's robustness by adding error handling and control flow logic. Specifically, it checks the calendar's state before clicking to set the maximum date and updates the click action with a Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Runner
participant C as Calendar Widget
T->>C: Check if calendar is open
alt Calendar is closed
T->>C: Click header to open (retry)
end
T->>C: Click header with flag (true)
T->>C: Set maximum date
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)app/client/cypress/limited-tests.txt (1)Pattern
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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=true |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13141028748. |
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/Widgets/Datepicker/DatePicker3_spec.ts (1)
25-27
: Remove afterEach hook as per guidelinesThe coding guidelines specifically mention avoiding
after
andafterEach
in test cases. Consider moving the navigation logic into individual test cases or use a different approach for cleanup.
🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts (1)
258-265
: Improve calendar state handling with cy.shouldWhile the state check is a good addition, consider using Cypress's built-in assertions for better reliability:
- agHelper.GetNClick(datePickerlocators.calendarHeader, 2, true); - agHelper - .GetAttribute(datePickerlocators.calendarHeader, "data-state", 2) - .then((state) => { - if (state === "closed") { - agHelper.GetNClick(datePickerlocators.calendarHeader, 2, true); - } - }); + cy.get(datePickerlocators.calendarHeader) + .eq(2) + .should('have.attr', 'data-state') + .then((state) => { + if (state === "closed") { + agHelper.GetNClick(datePickerlocators.calendarHeader, 2, true); + } + });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts (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 (4)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
/ci-test-limit-count run_count= 50 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13141620422. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13141620422.
|
/ci-test-limit-count run_count=50 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13150132168. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13150132168.
|
/ok-to-test tags="@tag.Sanity"
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13163657051
Commit: 33f041b
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Wed, 05 Feb 2025 18:41:54 UTC