From 39eed139056bdbbdfd7a8b62994a52775def461a Mon Sep 17 00:00:00 2001 From: Manthan Bhatt Date: Mon, 30 Mar 2026 20:00:11 +0530 Subject: [PATCH] test(infinite-scroll): stabilize top scroll test --- .../test/top/infinite-scroll.e2e.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts b/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts index 31a822ee0f7..9bf278e7d1e 100644 --- a/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts +++ b/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts @@ -3,10 +3,7 @@ import { configs, test } from '@utils/test/playwright'; configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { test.describe(title('infinite-scroll: top'), () => { - test('should load more items when scrolled to the top', async ({ page, skip }) => { - // TODO(FW-6394): remove once flaky issue is resolved - skip.browser('webkit', 'Safari is flaky on CI'); - + test('should load more items when scrolled to the top', async ({ page }) => { await page.goto('/src/components/infinite-scroll/test/top', config); const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); @@ -14,10 +11,20 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { const items = page.locator('ion-item'); expect(await items.count()).toBe(30); + await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0)); + await page.waitForFunction(async () => { + const contentEl = document.querySelector('ion-content') as HTMLIonContentElement | null; + if (contentEl == null) { + return false; + } + + const scrollEl = await contentEl.getScrollElement(); + return scrollEl.scrollTop > 0; + }); + await content.evaluate((el: HTMLIonContentElement) => el.scrollToTop(0)); await ionInfiniteComplete.next(); - - expect(await items.count()).toBe(60); + await expect(items).toHaveCount(60); }); }); });