mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
Merge remote-tracking branch 'origin/main' into chore/sync-with-main-6
This commit is contained in:
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
48
core/src/components/refresher/test/basic/refresher.e2e.ts
Normal file
48
core/src/components/refresher/test/basic/refresher.e2e.ts
Normal file
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user