diff --git a/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e-legacy.ts b/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e-legacy.ts deleted file mode 100644 index 899915d0c1..0000000000 --- a/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e-legacy.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('infinite-scroll: basic', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - skip.mode('ios'); - }); - test('should load more items when scrolled to the bottom', async ({ page }) => { - await page.goto('/src/components/infinite-scroll/test/basic'); - - const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); - const content = page.locator('ion-content'); - const items = page.locator('ion-item'); - expect(await items.count()).toBe(30); - - await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0)); - await ionInfiniteComplete.next(); - - expect(await items.count()).toBe(60); - }); -}); diff --git a/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e.ts b/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e.ts new file mode 100644 index 0000000000..2fd21f88fc --- /dev/null +++ b/core/src/components/infinite-scroll/test/basic/infinite-scroll.e2e.ts @@ -0,0 +1,20 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('infinite-scroll: basic'), () => { + test('should load more items when scrolled to the bottom', async ({ page }) => { + await page.goto('/src/components/infinite-scroll/test/basic', config); + + const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); + const content = page.locator('ion-content'); + const items = page.locator('ion-item'); + expect(await items.count()).toBe(30); + + await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0)); + await ionInfiniteComplete.next(); + + expect(await items.count()).toBe(60); + }); + }); +}); diff --git a/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e-legacy.ts b/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e-legacy.ts deleted file mode 100644 index f4ce8bbad0..0000000000 --- a/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e-legacy.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('infinite-scroll: scroll-target', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - skip.mode('ios'); - }); - test('should load more items when scroll target is scrolled to the bottom', async ({ page }) => { - await page.goto('/src/components/infinite-scroll/test/scroll-target'); - - const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); - const content = page.locator('#scroll-target'); - const items = page.locator('ion-item'); - expect(await items.count()).toBe(30); - - await content.evaluate((el: HTMLElement) => (el.scrollTop = el.scrollHeight)); - await ionInfiniteComplete.next(); - - expect(await items.count()).toBe(60); - }); -}); diff --git a/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e.ts b/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e.ts new file mode 100644 index 0000000000..ead73272dc --- /dev/null +++ b/core/src/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e.ts @@ -0,0 +1,20 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('infinite-scroll: scroll-target'), () => { + test('should load more items when scroll target is scrolled to the bottom', async ({ page }) => { + await page.goto('/src/components/infinite-scroll/test/scroll-target', config); + + const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); + const content = page.locator('#scroll-target'); + const items = page.locator('ion-item'); + expect(await items.count()).toBe(30); + + await content.evaluate((el: HTMLElement) => (el.scrollTop = el.scrollHeight)); + await ionInfiniteComplete.next(); + + expect(await items.count()).toBe(60); + }); + }); +}); diff --git a/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e-legacy.ts b/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e-legacy.ts deleted file mode 100644 index 0df5558343..0000000000 --- a/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e-legacy.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('infinite-scroll: top', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - skip.mode('ios'); - }); - test('should load more items when scrolled to the top', async ({ page }) => { - await page.goto('/src/components/infinite-scroll/test/top'); - - const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); - const content = page.locator('ion-content'); - const items = page.locator('ion-item'); - expect(await items.count()).toBe(30); - - await content.evaluate((el: HTMLIonContentElement) => el.scrollToTop(0)); - await ionInfiniteComplete.next(); - - expect(await items.count()).toBe(60); - }); -}); 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 new file mode 100644 index 0000000000..ae2aa9c1b6 --- /dev/null +++ b/core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts @@ -0,0 +1,20 @@ +import { expect } from '@playwright/test'; +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 }) => { + await page.goto('/src/components/infinite-scroll/test/top', config); + + const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete'); + const content = page.locator('ion-content'); + const items = page.locator('ion-item'); + expect(await items.count()).toBe(30); + + await content.evaluate((el: HTMLIonContentElement) => el.scrollToTop(0)); + await ionInfiniteComplete.next(); + + expect(await items.count()).toBe(60); + }); + }); +});