Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
673ea56c
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
673ea56c
编写于
6月 13, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(list-view): 调整兼容 iOS 端测试
上级
89951e53
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
7 deletion
+12
-7
pages/component/list-view/list-view-refresh.test.js
pages/component/list-view/list-view-refresh.test.js
+4
-4
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+5
-3
pages/component/scroll-view/scroll-view.test.js
pages/component/scroll-view/scroll-view.test.js
+3
-0
未找到文件。
pages/component/list-view/list-view-refresh.test.js
浏览文件 @
673ea56c
...
@@ -20,13 +20,13 @@ describe('component-native-list-view-refresh', () => {
...
@@ -20,13 +20,13 @@ describe('component-native-list-view-refresh', () => {
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
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
'
)){
if
(
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
expect
(
await
page
.
data
(
'
onRefresherpullingTest
'
)).
toBe
(
'
refresherpulling:Success
'
)
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
()
=>
{
it
(
'
check_refresherabort
'
,
async
()
=>
{
...
...
pages/component/list-view/list-view.test.js
浏览文件 @
673ea56c
...
@@ -41,6 +41,7 @@ describe('component-native-list-view', () => {
...
@@ -41,6 +41,7 @@ describe('component-native-list-view', () => {
// 在web端scroll事件event参数中detail类型报错,先忽略测试
// 在web端scroll事件event参数中detail类型报错,先忽略测试
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
const
scrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
const
scrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
console
.
log
(
'
scrollDetailTest:
'
,
scrollDetail
)
expect
(
scrollDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
scrollDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
scrollDetail
.
scrollTop
).
toBe
(
300
)
expect
(
scrollDetail
.
scrollTop
).
toBe
(
300
)
expect
(
scrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
scrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
...
@@ -73,14 +74,15 @@ describe('component-native-list-view', () => {
...
@@ -73,14 +74,15 @@ describe('component-native-list-view', () => {
}
}
it
(
'
Event scrollend-滚动结束时触发
'
,
async
()
=>
{
it
(
'
Event scrollend-滚动结束时触发
'
,
async
()
=>
{
// 仅App端支持,向
下
滑动页面
// 仅App端支持,向
上
滑动页面
await
program
.
swipe
({
await
program
.
swipe
({
startPoint
:
{
x
:
100
,
y
:
5
00
},
startPoint
:
{
x
:
100
,
y
:
3
00
},
endPoint
:
{
x
:
100
,
y
:
2
00
},
endPoint
:
{
x
:
100
,
y
:
1
00
},
duration
:
1000
duration
:
1000
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
console
.
log
(
'
scrollEndDetailTest:
'
,
endDetail
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
...
...
pages/component/scroll-view/scroll-view.test.js
浏览文件 @
673ea56c
...
@@ -24,6 +24,7 @@ describe('component-native-scroll-view', () => {
...
@@ -24,6 +24,7 @@ describe('component-native-scroll-view', () => {
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
// 设置top 是否触发scroll 事件
// 设置top 是否触发scroll 事件
const
topScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
const
topScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
console
.
log
(
'
topScrollDetail:
'
,
topScrollDetail
)
expect
(
topScrollDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
topScrollDetail
.
scrollLeft
).
toBe
(
0
)
// Android 差异scrollTop:99.809525
// Android 差异scrollTop:99.809525
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)){
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)){
...
@@ -44,6 +45,7 @@ describe('component-native-scroll-view', () => {
...
@@ -44,6 +45,7 @@ describe('component-native-scroll-view', () => {
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
//设置left 是否触发scroll 事件
//设置left 是否触发scroll 事件
const
leftScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
const
leftScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
console
.
log
(
'
leftScrollDetail:
'
,
leftScrollDetail
)
// Android 差异scrollLeft:219.80952
// Android 差异scrollLeft:219.80952
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)){
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)){
expect
(
leftScrollDetail
.
scrollLeft
).
toBe
(
220
)
expect
(
leftScrollDetail
.
scrollLeft
).
toBe
(
220
)
...
@@ -75,6 +77,7 @@ describe('component-native-scroll-view', () => {
...
@@ -75,6 +77,7 @@ describe('component-native-scroll-view', () => {
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
web
'
)){
it
(
'
Event scrollend-滚动结束时触发仅App端支持
'
,
async
()
=>
{
it
(
'
Event scrollend-滚动结束时触发仅App端支持
'
,
async
()
=>
{
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
console
.
log
(
'
scrollEndDetailTest:
'
,
endDetail
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
endDetail
.
scrollTop
).
toBe
(
0
)
expect
(
endDetail
.
scrollTop
).
toBe
(
0
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录