diff --git a/core/src/components/datetime/test/sub-pixel-width/e2e.ts b/core/src/components/datetime/test/sub-pixel-width/e2e.ts index cab744acbe4..24066376b5e 100644 --- a/core/src/components/datetime/test/sub-pixel-width/e2e.ts +++ b/core/src/components/datetime/test/sub-pixel-width/e2e.ts @@ -8,18 +8,19 @@ describe('datetime: sub-pixel width', () => { }); const openModalBtn = await page.find('#open-modal'); + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const modal = await page.find('ion-modal'); await openModalBtn.click(); - const modal = await page.find('ion-modal'); await modal.waitForVisible(); - await page.waitForTimeout(250); + await ionModalDidPresent.next(); const buttons = await page.findAll('ion-datetime >>> .calendar-next-prev ion-button') await buttons[1].click(); - await page.waitForTimeout(350); + await page.waitForEvent('datetimeMonthDidChange'); const monthYear = await page.find('ion-datetime >>> .calendar-month-year'); @@ -32,18 +33,19 @@ describe('datetime: sub-pixel width', () => { }); const openModalBtn = await page.find('#open-modal'); + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const modal = await page.find('ion-modal'); await openModalBtn.click(); - const modal = await page.find('ion-modal'); await modal.waitForVisible(); - await page.waitForTimeout(250); + await ionModalDidPresent.next(); const buttons = await page.findAll('ion-datetime >>> .calendar-next-prev ion-button') await buttons[0].click(); - await page.waitForTimeout(350); + await page.waitForEvent('datetimeMonthDidChange'); const monthYear = await page.find('ion-datetime >>> .calendar-month-year'); diff --git a/core/src/components/datetime/test/sub-pixel-width/index.html b/core/src/components/datetime/test/sub-pixel-width/index.html index f532491e1be..2d1c2fae65d 100644 --- a/core/src/components/datetime/test/sub-pixel-width/index.html +++ b/core/src/components/datetime/test/sub-pixel-width/index.html @@ -42,6 +42,15 @@