-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: fixed datepicker skipped tests set 2 #37126
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,14 @@ describe( | |
cy.closePropertyPane(); | ||
}); | ||
// Skipping tests due to issue - https://www.notion.so/appsmith/f353d8c6bd664f79ad858a42010cdfc8?v=f04cde23f6424aeb9d5a6e389cd172bd&p=0717892d43684c40bae4e2c87b8308cb&pm=s | ||
it.skip("Date Widget with Reset widget being switch widget", function () { | ||
it("Date Widget with Reset widget being switch widget", function () { | ||
EditorNavigation.SelectEntityByName("DatePicker1", EntityType.Widget); | ||
|
||
cy.get(formWidgetsPage.datePickerInput).click(); | ||
_.agHelper.GetNClick(widgetsPage.todayText) | ||
cy.get(formWidgetsPage.defaultDate).click(); | ||
_.agHelper.GetNClick('.ads-v2-datepicker__calender-today'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactor selectors and remove redundant interactions
Apply this refactor: cy.get(formWidgetsPage.datePickerInput).click();
_.agHelper.GetNClick(widgetsPage.todayText)
- cy.get(formWidgetsPage.defaultDate).click();
- _.agHelper.GetNClick('.ads-v2-datepicker__calender-today');
cy.get(formWidgetsPage.defaultDate).click();
|
||
cy.get(formWidgetsPage.defaultDate).click(); | ||
cy.SetDateToToday(); | ||
cy.setDate(1, "ddd MMM DD YYYY"); | ||
const nextDay = dayjs().format("DD/MM/YYYY"); | ||
cy.log(nextDay); | ||
|
@@ -51,18 +54,10 @@ describe( | |
cy.get(widgetsPage.switchWidgetInactive).should("be.visible"); | ||
}); | ||
|
||
it.skip("DatePicker-Date change and validate switch widget status", function () { | ||
it("DatePicker-Date change and validate switch widget status", function () { | ||
cy.get(widgetsPage.datepickerInput).click({ force: true }); | ||
cy.SetDateToToday(); | ||
cy.get(widgetsPage.switchWidgetActive).should("be.visible"); | ||
cy.get(".t--toast-action span") | ||
.last() | ||
.invoke("text") | ||
.then((text) => { | ||
const toasttext = text; | ||
cy.log(toasttext); | ||
expect(text.trim()).to.equal(toasttext.trim()); | ||
}); | ||
_.agHelper.GetNClick(widgetsPage.todayText) | ||
_.agHelper.AssertClassExists('.bp3-switch', 't--switch-widget-active') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove force click and update selectors
Apply these changes: - cy.get(widgetsPage.datepickerInput).click({ force: true });
+ cy.get(widgetsPage.datepickerInput).should('be.visible').click();
_.agHelper.GetNClick(widgetsPage.todayText)
- _.agHelper.AssertClassExists('.bp3-switch', 't--switch-widget-active')
+ _.agHelper.AssertClassExists('[data-testid="switch-widget"]', 't--switch-widget-active')
|
||
}); | ||
}, | ||
); | ||
|
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.
Add explicit element readiness check before click.
Add visibility check before clicking to ensure element is ready for interaction.
📝 Committable suggestion