提交 4c4af673 编写于 作者: shutao-dc's avatar shutao-dc

list-view补充下拉刷新测试例

上级 2b8390d8
...@@ -1080,7 +1080,7 @@ ...@@ -1080,7 +1080,7 @@
{ {
"path": "pages/template/swiper-vertical-video/swiper-vertical-video", "path": "pages/template/swiper-vertical-video/swiper-vertical-video",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarBackgroundColor": "transparent" "navigationBarBackgroundColor": "transparent"
} }
}, },
...@@ -1096,7 +1096,7 @@ ...@@ -1096,7 +1096,7 @@
"path": "pages/template/scroll-fold-nav/scroll-fold-nav", "path": "pages/template/scroll-fold-nav/scroll-fold-nav",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "transparent" "navigationBarBackgroundColor": "transparent"
} }
}, },
...@@ -1131,7 +1131,7 @@ ...@@ -1131,7 +1131,7 @@
{ {
"path": "pages/template/pull-zoom-image/pull-zoom-image", "path": "pages/template/pull-zoom-image/pull-zoom-image",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarBackgroundColor": "transparent" "navigationBarBackgroundColor": "transparent"
} }
}, },
...@@ -1181,7 +1181,7 @@ ...@@ -1181,7 +1181,7 @@
"path": "pages/webview-screenshot-comparison/webview-screenshot-comparison", "path": "pages/webview-screenshot-comparison/webview-screenshot-comparison",
"style": { "style": {
"navigationBarTitleText": "截图对比测试", "navigationBarTitleText": "截图对比测试",
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarBackgroundColor": "transparent" "navigationBarBackgroundColor": "transparent"
} }
}, },
...@@ -1189,7 +1189,7 @@ ...@@ -1189,7 +1189,7 @@
"path": "pages/webview-screenshot/webview-screenshot", "path": "pages/webview-screenshot/webview-screenshot",
"style": { "style": {
"navigationBarTitleText": "webview 截图测试", "navigationBarTitleText": "webview 截图测试",
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarBackgroundColor": "transparent" "navigationBarBackgroundColor": "transparent"
} }
}, },
...@@ -1214,8 +1214,14 @@ ...@@ -1214,8 +1214,14 @@
"navigationBarTitleText": "支付", "navigationBarTitleText": "支付",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/component/list-view/list-view-refresh",
"style": {
"navigationBarTitleText": "list-view-refresh",
"enablePullDownRefresh": false
}
} }
// #endif // #endif
], ],
"globalStyle": { "globalStyle": {
......
describe('component-native-list-view-refresh', () => {
if (process.env.uniTestPlatformInfo.startsWith('web')) {
it('dummyTest', async () => {
expect(1).toBe(1)
})
return
}
let page
beforeAll(async () => {
//打开list-view测试页
page = await program.reLaunch('/pages/component/list-view/list-view-refresh')
await page.waitFor(600)
})
it('check_list_view_refresh', async () => {
await page.waitFor(async () => {
return await page.data('refresherTriggered') === false;
});
//等待下拉刷新结束
await page.waitFor(500)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
})
<template>
<list-view v-if="list_show" id="listview" style="flex: 1;" show-scrollbar=false :refresher-enabled="true"
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresherrefresh">
<list-item class="item">
<text>向下滑动触发下拉刷新</text>
</list-item>
<list-item v-for="index in item_count" class="item">
<text>item-------{{index}}</text>
</list-item>
</list-view>
</template>
<script>
export default {
data() {
return {
item_count: 20,
list_show: false,
refresherTriggered: true
}
},
onLoad() {
//延迟显示list-view
setTimeout(() => {
this.list_show = true;
}, 500)
},
methods: {
onRefresherrefresh() {
this.refresherTriggered = true;
setTimeout(() => {
this.refresherTriggered = false;
}, 1000)
}
}
}
</script>
<style>
.item {
padding: 15px;
margin: 0 0 5px 0;
background-color: #fff;
border-radius: 5px;
}
.button_item {
width: 200px;
}
</style>
...@@ -182,7 +182,11 @@ ...@@ -182,7 +182,11 @@
@confirm="confirm_refresher_background_input"></input-data> @confirm="confirm_refresher_background_input"></input-data>
<enum-data :items="size_enum" title="通过id位置跳转" @change="item_change_size_enum"></enum-data> <enum-data :items="size_enum" title="通过id位置跳转" @change="item_change_size_enum"></enum-data>
<navigator url="/pages/component/list-view/list-view-refresh" hover-class="none">
<button type="primary" class="button">
list-view 下拉刷新
</button>
</navigator>
<navigator url="/pages/component/list-view/list-view-multiplex" hover-class="none"> <navigator url="/pages/component/list-view/list-view-multiplex" hover-class="none">
<button type="primary" class="button"> <button type="primary" class="button">
list-view 对list-item复用测试 list-view 对list-item复用测试
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册