Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
4b26b2ac
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6006
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
4b26b2ac
编写于
6月 17, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(list-view/scroll-view): 安卓端差异调整测试例
上级
add77d0b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
10 deletion
+10
-10
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+5
-3
pages/component/scroll-view/scroll-view-refresher.test.js
pages/component/scroll-view/scroll-view-refresher.test.js
+1
-0
pages/component/scroll-view/scroll-view.test.js
pages/component/scroll-view/scroll-view.test.js
+4
-7
未找到文件。
pages/component/list-view/list-view.test.js
浏览文件 @
4b26b2ac
...
@@ -43,14 +43,16 @@ describe('component-native-list-view', () => {
...
@@ -43,14 +43,16 @@ describe('component-native-list-view', () => {
const
scrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
const
scrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
console
.
log
(
'
scrollDetailTest:
'
,
scrollDetail
)
console
.
log
(
'
scrollDetailTest:
'
,
scrollDetail
)
expect
(
scrollDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
scrollDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
scrollDetail
.
scrollTop
).
toBe
(
300
)
// 在安卓端差异 299.8095
expect
([
300
,
299.8095
]).
toContain
(
scrollDetail
.
scrollTop
);
expect
(
scrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
scrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
// 在安卓端 "scrollWidth":0
// 在安卓端 "scrollWidth":0
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
expect
(
scrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
scrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
}
}
expect
(
scrollDetail
.
deltaX
).
toBe
(
0
)
expect
(
scrollDetail
.
deltaX
).
toBe
(
0
)
expect
(
scrollDetail
.
deltaY
).
toBe
(
300
)
// 在安卓端差异 299.8095
expect
([
300
,
299.8095
]).
toContain
(
scrollDetail
.
deltaY
);
}
}
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
})
})
...
@@ -89,7 +91,7 @@ describe('component-native-list-view', () => {
...
@@ -89,7 +91,7 @@ describe('component-native-list-view', () => {
expect
(
endDetail
.
scrollTop
).
toBeGreaterThan
(
0
)
expect
(
endDetail
.
scrollTop
).
toBeGreaterThan
(
0
)
expect
(
endDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
endDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
// 在安卓端 "scrollWidth":0
// 在安卓端 "scrollWidth":0
expect
(
endDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
//
expect(endDetail.scrollWidth).toBeGreaterThan(0)
})
})
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
startsWith
(
'
ios
'
))
{
...
...
pages/component/scroll-view/scroll-view-refresher.test.js
浏览文件 @
4b26b2ac
...
@@ -49,6 +49,7 @@ describe('component-native-scroll-view-refresher', () => {
...
@@ -49,6 +49,7 @@ describe('component-native-scroll-view-refresher', () => {
await
page
.
waitFor
(
1500
)
await
page
.
waitFor
(
1500
)
// 下拉刷新被中止,在iOS不触发@refresherabort事件
// 下拉刷新被中止,在iOS不触发@refresherabort事件
if
(
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
if
(
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
console
.
log
(
'
onRefresherabortTest
'
,
await
page
.
data
(
'
onRefresherabortTest
'
))
expect
(
await
page
.
data
(
'
onRefresherabortTest
'
)).
toBe
(
'
refresherabort:Success
'
)
expect
(
await
page
.
data
(
'
onRefresherabortTest
'
)).
toBe
(
'
refresherabort:Success
'
)
}
}
});
});
...
...
pages/component/scroll-view/scroll-view.test.js
浏览文件 @
4b26b2ac
...
@@ -27,9 +27,7 @@ describe('component-native-scroll-view', () => {
...
@@ -27,9 +27,7 @@ describe('component-native-scroll-view', () => {
console
.
log
(
'
topScrollDetail:
'
,
topScrollDetail
)
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
'
)){
expect
([
100
,
99.809525
]).
toContain
(
topScrollDetail
.
scrollTop
);
expect
(
topScrollDetail
.
scrollTop
).
toBe
(
100
)
}
expect
(
topScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
deltaX
).
toBe
(
0
)
expect
(
topScrollDetail
.
deltaX
).
toBe
(
0
)
...
@@ -47,13 +45,12 @@ describe('component-native-scroll-view', () => {
...
@@ -47,13 +45,12 @@ describe('component-native-scroll-view', () => {
const
leftScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
const
leftScrollDetail
=
await
page
.
data
(
'
scrollDetailTest
'
)
console
.
log
(
'
leftScrollDetail:
'
,
leftScrollDetail
)
console
.
log
(
'
leftScrollDetail:
'
,
leftScrollDetail
)
// Android 差异scrollLeft:219.80952
// Android 差异scrollLeft:219.80952
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)){
expect
([
220
,
219.80952
]).
toContain
(
leftScrollDetail
.
scrollLeft
);
expect
(
leftScrollDetail
.
scrollLeft
).
toBe
(
220
)
}
expect
(
leftScrollDetail
.
scrollTop
).
toBe
(
0
)
expect
(
leftScrollDetail
.
scrollTop
).
toBe
(
0
)
expect
(
leftScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
leftScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
leftScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
leftScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
leftScrollDetail
.
deltaX
).
toBe
(
-
100
)
// 在安卓差异 -99.809525
expect
([
-
100
,
-
99.809525
]).
toContain
(
leftScrollDetail
.
deltaX
);
expect
(
leftScrollDetail
.
deltaY
).
toBe
(
0
)
expect
(
leftScrollDetail
.
deltaY
).
toBe
(
0
)
}
}
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录