diff --git a/pages.json b/pages.json index 7a262edeb74878d2e87c4910d176088d323ea766..a5f4840b23b17bd6081f1e087968a0ecadea1f4c 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 0000000000000000000000000000000000000000..a4642adb396ba8f1b1fa153a54dbf3305533f03a --- /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 0000000000000000000000000000000000000000..3eab8b4d5140fff30a666f6dd35a1c125569c027 --- /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 b5c8662d5c6b6c73ecfc5a0c25679a0cc3748278..3b5e8005c4825ada83651c2dac11c63eb80b5a48 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 {