From 76e5d7a2eeee647c457c78c9ad34dd4d28c62350 Mon Sep 17 00:00:00 2001 From: XHY Date: Wed, 4 Dec 2024 17:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20pages/API/create-selector-?= =?UTF-8?q?query/create-selector-query-onScroll=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 +++ .../create-selector-query-onScroll.test.js | 45 +++++++++++++++++++ .../create-selector-query-onScroll.uvue | 43 ++++++++++++++++++ testSequencer.js | 1 + 4 files changed, 95 insertions(+) create mode 100644 pages/API/create-selector-query/create-selector-query-onScroll.test.js create mode 100644 pages/API/create-selector-query/create-selector-query-onScroll.uvue diff --git a/pages.json b/pages.json index 7a262ede..a5f4840b 100644 --- a/pages.json +++ b/pages.json @@ -1413,6 +1413,12 @@ "navigationBarTitleText": "createSelectorQuery | 创建 SelectorQuery 实例" } }, + { + "path": "pages/API/create-selector-query/create-selector-query-onScroll", + "style": { + "navigationBarTitleText": "createSelectorQuery" + } + }, // #endif // #ifdef APP-ANDROID || APP-IOS { diff --git a/pages/API/create-selector-query/create-selector-query-onScroll.test.js b/pages/API/create-selector-query/create-selector-query-onScroll.test.js new file mode 100644 index 00000000..a4642adb --- /dev/null +++ b/pages/API/create-selector-query/create-selector-query-onScroll.test.js @@ -0,0 +1,45 @@ +const PAGE_PATH = '/pages/API/create-selector-query/create-selector-query-onScroll' + +describe('create-selector-query-onScroll', () => { + + // 先屏蔽 web 平台 + if ( + process.env.uniTestPlatformInfo.startsWith('web') || + process.env.uniTestPlatformInfo.startsWith('mp') + ) { + it('other platform', () => { + expect(1).toBe(1) + }) + return + } + + if (process.env.UNI_TEST_DEVICES_DIRECTION == 'landscape') { + it('跳过横屏模式', () => { + expect(1).toBe(1) + }) + return + } + + let page + beforeAll(async () => { + page = await program.reLaunch(PAGE_PATH) + await page.waitFor(500); + }) + + + it('test-createSelectorQuery-onScroll', async () => { + + let x = 100 + let y = 250 + // 滑动事件 + await program.swipe({ + startPoint: {x: x, y: y}, + endPoint: {x: x,y: y-100}, + duration: 300 + }) + + await page.waitFor(600); + const ret = await page.data('ret') + expect(ret).toBe(true) + }) +}) diff --git a/pages/API/create-selector-query/create-selector-query-onScroll.uvue b/pages/API/create-selector-query/create-selector-query-onScroll.uvue new file mode 100644 index 00000000..3eab8b4d --- /dev/null +++ b/pages/API/create-selector-query/create-selector-query-onScroll.uvue @@ -0,0 +1,43 @@ + + + + + diff --git a/testSequencer.js b/testSequencer.js index b5c8662d..3b5e8005 100644 --- a/testSequencer.js +++ b/testSequencer.js @@ -10,6 +10,7 @@ const sortTestFilePaths = [ "pages/component/swiper/swiper2.test.js", "pages/component/slider/slider-maxValue.test.js", "pages/CSS/overflow/overflow-visible-event.test.js", + "pages/API/create-selector-query/create-selector-query-onScroll.test.js", "pages/component/rich-text/rich-text-complex.test.js" ] class CustomSequencer extends Sequencer { -- GitLab