提交 673ea56c 编写于 作者: Anne_LXM's avatar Anne_LXM

test(list-view): 调整兼容 iOS 端测试

上级 89951e53
......@@ -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 () => {
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册