diff --git a/core/src/components/refresher/test/basic/refresher.e2e-legacy.ts b/core/src/components/refresher/test/basic/refresher.e2e-legacy.ts deleted file mode 100644 index 219fa1fbf7..0000000000 --- a/core/src/components/refresher/test/basic/refresher.e2e-legacy.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -import { pullToRefresh } from '../test.utils'; - -// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright -test.skip('refresher: basic', () => { - test.beforeEach(async ({ page }) => { - await page.goto('/src/components/refresher/test/basic'); - }); - - test.describe('legacy refresher', () => { - test('should load more items when performing a pull-to-refresh', async ({ page }) => { - const items = page.locator('ion-item'); - - expect(await items.count()).toBe(30); - - await pullToRefresh(page); - - expect(await items.count()).toBe(60); - }); - }); - - test.describe('native refresher', () => { - test('should load more items when performing a pull-to-refresh', async ({ page }) => { - const refresherContent = page.locator('ion-refresher-content'); - refresherContent.evaluateHandle((el: any) => { - // Resets the pullingIcon to enable the native refresher - el.pullingIcon = undefined; - }); - - await page.waitForChanges(); - - const items = page.locator('ion-item'); - expect(await items.count()).toBe(30); - - await pullToRefresh(page); - - expect(await items.count()).toBe(60); - }); - }); -}); diff --git a/core/src/components/refresher/test/basic/refresher.e2e.ts b/core/src/components/refresher/test/basic/refresher.e2e.ts new file mode 100644 index 0000000000..fe17dd7fca --- /dev/null +++ b/core/src/components/refresher/test/basic/refresher.e2e.ts @@ -0,0 +1,48 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +import { pullToRefresh } from '../test.utils'; + +// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright + +/** + * This behavior does not vary across directions. + */ +configs({ directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe.skip(title('refresher: basic'), () => { + test.beforeEach(async ({ page }) => { + await page.goto('/src/components/refresher/test/basic', config); + }); + + test.describe('legacy refresher', () => { + test('should load more items when performing a pull-to-refresh', async ({ page }) => { + const items = page.locator('ion-item'); + + expect(await items.count()).toBe(30); + + await pullToRefresh(page); + + expect(await items.count()).toBe(60); + }); + }); + + test.describe('native refresher', () => { + test('should load more items when performing a pull-to-refresh', async ({ page }) => { + const refresherContent = page.locator('ion-refresher-content'); + refresherContent.evaluateHandle((el: any) => { + // Resets the pullingIcon to enable the native refresher + el.pullingIcon = undefined; + }); + + await page.waitForChanges(); + + const items = page.locator('ion-item'); + expect(await items.count()).toBe(30); + + await pullToRefresh(page); + + expect(await items.count()).toBe(60); + }); + }); + }); +}); diff --git a/core/src/components/refresher/test/scroll-target/refresher.e2e-legacy.ts b/core/src/components/refresher/test/scroll-target/refresher.e2e-legacy.ts deleted file mode 100644 index d7904f0552..0000000000 --- a/core/src/components/refresher/test/scroll-target/refresher.e2e-legacy.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -import { pullToRefresh } from '../test.utils'; - -// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright -test.skip('refresher: custom scroll target', () => { - test.beforeEach(async ({ page }) => { - await page.goto('/src/components/refresher/test/scroll-target'); - }); - - test.describe('legacy refresher', () => { - test('should load more items when performing a pull-to-refresh', async ({ page }) => { - const items = page.locator('ion-item'); - - expect(await items.count()).toBe(30); - - await pullToRefresh(page, '#inner-scroll'); - - expect(await items.count()).toBe(60); - }); - }); - - test.describe('native refresher', () => { - test('should load more items when performing a pull-to-refresh', async ({ page }) => { - const refresherContent = page.locator('ion-refresher-content'); - refresherContent.evaluateHandle((el: any) => { - // Resets the pullingIcon to enable the native refresher - el.pullingIcon = undefined; - }); - - await page.waitForChanges(); - - const items = page.locator('ion-item'); - - expect(await items.count()).toBe(30); - - await pullToRefresh(page, '#inner-scroll'); - - expect(await items.count()).toBe(60); - }); - }); -}); diff --git a/core/src/components/refresher/test/scroll-target/refresher.e2e.ts b/core/src/components/refresher/test/scroll-target/refresher.e2e.ts new file mode 100644 index 0000000000..8cd3547651 --- /dev/null +++ b/core/src/components/refresher/test/scroll-target/refresher.e2e.ts @@ -0,0 +1,48 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +import { pullToRefresh } from '../test.utils'; + +// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright +/** + * This behavior does not vary across directions. + */ +configs({ directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe.skip(title('refresher: custom scroll target'), () => { + test.beforeEach(async ({ page }) => { + await page.goto('/src/components/refresher/test/scroll-target', config); + }); + + test.describe('legacy refresher', () => { + test('should load more items when performing a pull-to-refresh', async ({ page }) => { + const items = page.locator('ion-item'); + + expect(await items.count()).toBe(30); + + await pullToRefresh(page, '#inner-scroll'); + + expect(await items.count()).toBe(60); + }); + }); + + test.describe('native refresher', () => { + test('should load more items when performing a pull-to-refresh', async ({ page }) => { + const refresherContent = page.locator('ion-refresher-content'); + refresherContent.evaluateHandle((el: any) => { + // Resets the pullingIcon to enable the native refresher + el.pullingIcon = undefined; + }); + + await page.waitForChanges(); + + const items = page.locator('ion-item'); + + expect(await items.count()).toBe(30); + + await pullToRefresh(page, '#inner-scroll'); + + expect(await items.count()).toBe(60); + }); + }); + }); +});