diff --git a/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js b/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js index 9f40aaefde3..af2714ccb72 100644 --- a/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js +++ b/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js @@ -19,7 +19,7 @@ describe( // ADS changes to date input property causes this test to fail // skipping it temporarily. - it.skip("DatePicker-Date Name validation", function () { + it("DatePicker-Date Name validation", function () { // changing the date to today cy.get(formWidgetsPage.defaultDate).click(); cy.SetDateToToday(); @@ -36,10 +36,8 @@ describe( /** * setDate--> is a Command to select the date in the date picker - * @param1 --> its takes currentday+ eg: 1 - * @param2 --> user date formate */ - cy.setDate(1, "ddd MMM DD YYYY"); + cy.setDate(1); const nextDay = dayjs().add(1, "days").format("DD/MM/YYYY"); cy.log(nextDay); cy.get(formWidgetsPage.datepickerWidget + " .bp3-input").should( diff --git a/cypress/support/commands.js b/cypress/support/commands.js index eaf1a4c86ca..19c28a5b372 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -524,10 +524,9 @@ Cypress.Commands.add("getDate", (date, dateFormate) => { return eDate; }); -Cypress.Commands.add("setDate", (date, dateFormate) => { - const expDate = dayjs().add(date, "days").format(dateFormate); - const sel = `.DayPicker-Day[aria-label=\"${expDate}\"]`; - cy.get(sel).click(); +Cypress.Commands.add("setDate", (date) => { + const expDate = dayjs().add(date, "days").format("dddd, MMMM DD"); + cy.get(`.react-datepicker__day[aria-label^="Choose ${expDate}"]`).click(); }); Cypress.Commands.add("validateDisableWidget", (widgetCss, disableCss) => {