Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
41d97af0
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6058
Star
93
Fork
166
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
41d97af0
编写于
12月 09, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(scroll-view): 调整测试例适配 android program.swipe 调整
上级
1b69fc33
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
37 deletion
+37
-37
pages/component/scroll-view/scroll-view-refresher.test.js
pages/component/scroll-view/scroll-view-refresher.test.js
+37
-37
未找到文件。
pages/component/scroll-view/scroll-view-refresher.test.js
浏览文件 @
41d97af0
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-scroll-view-refresher
'
,
()
=>
{
if
(
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
it
(
'
other platform
'
,
()
=>
{
...
...
@@ -17,28 +17,28 @@ describe('component-native-scroll-view-refresher', () => {
})
return
}
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-refresher
'
);
await
page
.
waitFor
(
300
);
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-refresher
'
);
await
page
.
waitFor
(
300
);
});
it
(
'
scroll-view-refresher-screenshot
'
,
async
()
=>
{
//禁止滚动条
await
page
.
setData
({
showScrollbar
:
false
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
})
it
(
'
check_refresher_refresh_event
'
,
async
()
=>
{
await
page
.
setData
({
refresherTriggered
:
true
})
await
page
.
waitFor
(
2000
);
it
(
'
scroll-view-refresher-screenshot
'
,
async
()
=>
{
//禁止滚动条
await
page
.
setData
({
showScrollbar
:
false
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
})
it
(
'
check_refresher_refresh_event
'
,
async
()
=>
{
await
page
.
setData
({
refresherTriggered
:
true
})
await
page
.
waitFor
(
2000
);
expect
(
await
page
.
data
(
'
refresherrefreshTimes
'
)).
toBe
(
1
)
// 手动设置下拉刷新状态refresher-triggered为true时,在web和iOS不触发@refresherpulling事件
if
(
isAndroid
){
...
...
@@ -46,7 +46,7 @@ describe('component-native-scroll-view-refresher', () => {
expect
(
await
page
.
data
(
'
refresherrefreshTest
'
)).
toBe
(
'
refresherrefresh:Success
'
)
}
await
page
.
waitFor
(
2000
);
expect
(
await
page
.
data
(
'
onRefresherrestoreTest
'
)).
toBe
(
'
refresherrestore:Success
'
)
expect
(
await
page
.
data
(
'
onRefresherrestoreTest
'
)).
toBe
(
'
refresherrestore:Success
'
)
});
// 仅App端支持手势下拉刷新,在不同设备上位置有差异可能导致不触发中止事件
...
...
@@ -62,7 +62,7 @@ describe('component-native-scroll-view-refresher', () => {
}
else
if
(
isAndroid
){
await
program
.
swipe
({
startPoint
:
{
x
:
100
,
y
:
400
},
endPoint
:
{
x
:
100
,
y
:
50
0
},
endPoint
:
{
x
:
100
,
y
:
45
0
},
duration
:
1000
})
}
...
...
@@ -74,13 +74,13 @@ describe('component-native-scroll-view-refresher', () => {
}
});
}
it
(
'
check_refresher_snapshot
'
,
async
()
=>
{
await
page
.
setData
({
refresherTriggered
:
true
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
});
});
it
(
'
check_refresher_snapshot
'
,
async
()
=>
{
await
page
.
setData
({
refresherTriggered
:
true
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
toSaveImageSnapshot
();
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录