Skip to content

feat: Add global date selection helper command#2286

Merged
caneppelevitor merged 1 commit intostagefrom
feat/global-datepicker-helper
Mar 3, 2026
Merged

feat: Add global date selection helper command#2286
caneppelevitor merged 1 commit intostagefrom
feat/global-datepicker-helper

Conversation

@LuizFNJ
Copy link
Collaborator

@LuizFNJ LuizFNJ commented Mar 2, 2026

Description

Created a new global Cypress command selectDatePickerDate to handle date selection in the Material UI Datepicker component. This helper automates navigation between months (past/future) based on the target date, preventing tests from failing when attempting to click on disabled dates in the current month's view.

Related Ticket #2287

Type of change

  • Existing feature enhancement (non-breaking change which modifies existing functionality)

Testing

This command ensures reliable date selection across all tests using the datepicker. It resolves issues where getPastDay or getFutureDay would cause clicks on disabled buttons because the calendar was not navigating to the correct month.

Examples of Usage in Tests:

// 1. Selecting a date in the past (e.g., 10 days ago)
// Navigates to previous month if necessary
cy.selectDatePickerDate(getPastDay(10));

// 2. Selecting today's date
// Stays in the current month
cy.selectDatePickerDate(today);

// 3. Selecting a date in the future (e.g., 5 days from now)
// Navigates to next month if necessary
cy.selectDatePickerDate(getFutureDay(5));

Developer Checklist

General

  • Code is appropriately commented, particularly in hard-to-understand areas
  • Repository documentation has been updated (Readme.md) with additional steps required for a local environment setup.
  • No console.log or related logging is added.
  • No code is repeated/duplicated in violation of DRY. The exception to this is for new (MVP/Prototype) functionality where the abstraction layer may not be clear (comments should be added to explain the violation of DRY in these scenarios).
  • Documented with TSDoc all library and controller new functions

Frontend Changes

  • No new styling is added through CSS files (Unless it's a bugfix/hotfix)
  • All types are added correctly

Backend Changes

  • All endpoints are appropriately secured with Middleware authentication
  • All new endpoints have a interface schema defined

Tests

  • All existing unit and end to end tests pass across all services
  • Unit and end to end tests have been added to ensure backend APIs behave as expected

Test IDs

  • Include the test ID when adding new tasks or components.
  • Check that test IDs are present in the modified components.

Merge Request Review Checklist

  • An issue is linked to this PR and these changes meet the requirements outlined in the linked issue(s)
  • High risk and core workflows have been tested and verified in a local environment.
  • Enhancements or opportunities to improve performance, stability, security or code readability have been noted and documented in Project do Github issues if not being addressed.
  • Any dependent changes have been merged and published in downstream modules
  • Changes to multiple services can be deployed in parallel and independently. If not, changes should be broken out into separate merge requests and deployed in order.

@caneppelevitor caneppelevitor merged commit 54061ee into stage Mar 3, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants