diff --git a/pages/component/list-view/list-view-refresh.test.js b/pages/component/list-view/list-view-refresh.test.js index 05c30fcffae4a90792206c5e8285e664540a511e..0cd2971e9a19237bb1bc23e89175362903621b6b 100644 --- a/pages/component/list-view/list-view-refresh.test.js +++ b/pages/component/list-view/list-view-refresh.test.js @@ -20,13 +20,13 @@ describe('component-native-list-view-refresh', () => { await page.waitFor(500) const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); - // 手动设置下拉刷新状态refresher-triggered为true时,在iOS不触发@refresherpulling事件 + // 手动设置下拉刷新状态refresher-triggered为true时,在iOS不触发@refresherpulling事件,并且e.detail.dy为0 if(process.env.UNI_UTS_PLATFORM.startsWith('app-android')){ expect(await page.data('onRefresherpullingTest')).toBe('refresherpulling:Success') + expect(await page.data('refresherrefreshTest')).toBe('refresherrefresh:Success') + await page.waitFor(1000); + expect(await page.data('onRefresherrestoreTest')).toBe('refresherrestore:Success') } - expect(await page.data('refresherrefreshTest')).toBe('refresherrefresh:Success') - await page.waitFor(1000); - expect(await page.data('onRefresherrestoreTest')).toBe('refresherrestore:Success') }) it('check_refresherabort', async () => { diff --git a/pages/component/list-view/list-view.test.js b/pages/component/list-view/list-view.test.js index cd44ef1990b3ab63ccebca7deed1de41a9dd855a..57787f3ebdc48567378c1c5fe089f0334318a033 100644 --- a/pages/component/list-view/list-view.test.js +++ b/pages/component/list-view/list-view.test.js @@ -41,6 +41,7 @@ describe('component-native-list-view', () => { // 在web端scroll事件event参数中detail类型报错,先忽略测试 if(!process.env.UNI_UTS_PLATFORM.startsWith('web')){ const scrollDetail = await page.data('scrollDetailTest') + console.log('scrollDetailTest:', scrollDetail) expect(scrollDetail.scrollLeft).toBe(0) expect(scrollDetail.scrollTop).toBe(300) expect(scrollDetail.scrollHeight).toBeGreaterThan(0) @@ -73,14 +74,15 @@ describe('component-native-list-view', () => { } it('Event scrollend-滚动结束时触发',async()=>{ - // 仅App端支持,向下滑动页面 + // 仅App端支持,向上滑动页面 await program.swipe({ - startPoint: { x: 100, y: 500 }, - endPoint: { x: 100, y: 200 }, + startPoint: { x: 100, y: 300 }, + endPoint: { x: 100, y: 100 }, duration: 1000 }) await page.waitFor(600) const endDetail = await page.data('scrollEndDetailTest') + console.log('scrollEndDetailTest:', endDetail) expect(endDetail.deltaY).toBe(0) expect(endDetail.deltaX).toBe(0) expect(endDetail.scrollLeft).toBe(0) diff --git a/pages/component/scroll-view/scroll-view.test.js b/pages/component/scroll-view/scroll-view.test.js index f2b82ea885cce69b1e4a046a1389a1cdba7e3a36..bdd133b20aa85a86ec78061f12f0f90e065aafd1 100644 --- a/pages/component/scroll-view/scroll-view.test.js +++ b/pages/component/scroll-view/scroll-view.test.js @@ -24,6 +24,7 @@ describe('component-native-scroll-view', () => { if(!process.env.UNI_UTS_PLATFORM.startsWith('web')){ // 设置top 是否触发scroll 事件 const topScrollDetail = await page.data('scrollDetailTest') + console.log('topScrollDetail:', topScrollDetail) expect(topScrollDetail.scrollLeft).toBe(0) // Android 差异scrollTop:99.809525 if(!process.env.uniTestPlatformInfo.startsWith('android')){ @@ -44,6 +45,7 @@ describe('component-native-scroll-view', () => { if(!process.env.UNI_UTS_PLATFORM.startsWith('web')){ //设置left 是否触发scroll 事件 const leftScrollDetail = await page.data('scrollDetailTest') + console.log('leftScrollDetail:', leftScrollDetail) // Android 差异scrollLeft:219.80952 if(!process.env.uniTestPlatformInfo.startsWith('android')){ expect(leftScrollDetail.scrollLeft).toBe(220) @@ -75,6 +77,7 @@ describe('component-native-scroll-view', () => { if(!process.env.UNI_UTS_PLATFORM.startsWith('web')){ it('Event scrollend-滚动结束时触发仅App端支持',async()=>{ const endDetail = await page.data('scrollEndDetailTest') + console.log('scrollEndDetailTest:', endDetail) expect(endDetail.scrollLeft).toBe(0) expect(endDetail.scrollTop).toBe(0) expect(endDetail.deltaY).toBe(0)