Skip to content

Commit

Permalink
updated method
Browse files Browse the repository at this point in the history
  • Loading branch information
“NandanAnantharamu” committed Nov 2, 2024
1 parent f21e284 commit 14be899
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ describe(
cy.get(formWidgetsPage.dayPickerToday).click();
cy.get(formWidgetsPage.defaultDate).click();
cy.setDate(1);

/**
*Validate the date in text widget
*/
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ Cypress.Commands.add("getDate", (date, dateFormate) => {

Cypress.Commands.add("setDate", (date, dateFormate, ver = "v2") => {
if (ver == "v2") {
const expDate = dayjs().add(date, "days").format("dddd, MMMM DD");
cy.get(`.react-datepicker__day[aria-label^="Choose ${expDate}"]`).click();
const expDate = dayjs().add(date, "days").format("dddd, MMMM D");
cy.get(`.react-datepicker__day[aria-label^="Choose ${expDate}"]`).first().click();
} else if (ver == "v1") {
const expDate = dayjs().add(date, "days").format(dateFormate);
const sel = `.DayPicker-Day[aria-label=\"${expDate}\"]`;
Expand Down

0 comments on commit 14be899

Please sign in to comment.