Skip to content

Commit 594b46d

Browse files
Dax002Dax002
authored andcommitted
test: stabilize top infinite scroll e2e
1 parent 02588a1 commit 594b46d

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,27 @@ import { configs, test } from '@utils/test/playwright';
33

44
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
55
test.describe(title('infinite-scroll: top'), () => {
6-
test('should load more items when scrolled to the top', async ({ page, skip }) => {
7-
// TODO(FW-6394): remove once flaky issue is resolved
8-
skip.browser('webkit', 'Safari is flaky on CI');
9-
6+
test('should load more items when scrolled to the top', async ({ page }) => {
107
await page.goto('/src/components/infinite-scroll/test/top', config);
118

129
const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete');
1310
const content = page.locator('ion-content');
1411
const items = page.locator('ion-item');
1512
expect(await items.count()).toBe(30);
1613

14+
await content.evaluate(async (el: HTMLIonContentElement) => {
15+
const scrollEl = await el.getScrollElement();
16+
scrollEl.scrollTop = 100;
17+
});
18+
await expect
19+
.poll(async () => {
20+
return content.evaluate(async (el: HTMLIonContentElement) => {
21+
const scrollEl = await el.getScrollElement();
22+
return scrollEl.scrollTop;
23+
});
24+
})
25+
.toBeGreaterThan(0);
26+
1727
await content.evaluate((el: HTMLIonContentElement) => el.scrollToTop(0));
1828
await ionInfiniteComplete.next();
1929

0 commit comments

Comments
 (0)