Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
55acad32
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5992
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看板
提交
55acad32
编写于
6月 20, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(swiper): 修复类型报错/放开android 端测试
上级
e8287fca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
29 deletion
+15
-29
pages/component/swiper/swiper.test.js
pages/component/swiper/swiper.test.js
+12
-17
pages/component/swiper/swiper.uvue
pages/component/swiper/swiper.uvue
+3
-12
未找到文件。
pages/component/swiper/swiper.test.js
浏览文件 @
55acad32
...
@@ -90,28 +90,23 @@ describe('test swiper', () => {
...
@@ -90,28 +90,23 @@ describe('test swiper', () => {
});
});
it
(
'
Event transitiont
'
,
async
()
=>
{
it
(
'
Event transitiont
'
,
async
()
=>
{
// bug:android端swiper的事件event参数detail类型错误,暂时忽略测试
const
transitionDetailInfo
=
await
page
.
data
(
'
transitionDetailTest
'
)
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
// bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试
const
transitionDetailInfo
=
await
page
.
data
(
'
transitionDetailTest
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
// bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试
expect
(
transitionDetailInfo
.
dy
).
toBe
(
0
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
expect
(
transitionDetailInfo
.
dy
).
toBe
(
0
)
}
expect
(
transitionDetailInfo
.
dx
).
not
.
toBe
(
0
)
expect
(
await
page
.
data
(
'
isTransitionTest
'
)).
toBe
(
'
transition:Success
'
)
}
}
expect
(
transitionDetailInfo
.
dx
).
not
.
toBe
(
0
)
expect
(
await
page
.
data
(
'
isTransitionTest
'
)).
toBe
(
'
transition:Success
'
)
});
});
it
(
'
Event change
'
,
async
()
=>
{
it
(
'
Event change
'
,
async
()
=>
{
if
(
!
process
.
env
.
UNI_UTS_PLATFORM
.
startsWith
(
'
app-android
'
)){
const
changeDetailInfo
=
await
page
.
data
(
'
changeDetailTest
'
)
const
changeDetailInfo
=
await
page
.
data
(
'
changeDetailTest
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
expect
(
changeDetailInfo
).
toEqual
(
webDetailRes
)
expect
(
changeDetailInfo
).
toEqual
(
webDetailRes
)
}
else
{
}
else
{
expect
(
changeDetailInfo
).
toEqual
(
appDetailRes
)
expect
(
changeDetailInfo
).
toEqual
(
appDetailRes
)
}
expect
(
await
page
.
data
(
'
isChangeTest
'
)).
toBe
(
'
change:Success
'
)
}
}
expect
(
await
page
.
data
(
'
isChangeTest
'
)).
toBe
(
'
change:Success
'
)
});
});
it
(
'
Event animationfinish
'
,
async
()
=>
{
it
(
'
Event animationfinish
'
,
async
()
=>
{
...
...
pages/component/swiper/swiper.uvue
浏览文件 @
55acad32
...
@@ -117,12 +117,9 @@
...
@@ -117,12 +117,9 @@
swiperChangeSelect: false,
swiperChangeSelect: false,
currentValChange: 0,
currentValChange: 0,
// 自动化测试
// 自动化测试
// 在android端以下事件event参数中detail类型报错,先条件编译处理
changeDetailTest:null as UniSwiperChangeEventDetail | null,
// #ifndef APP-ANDROID
transitionDetailTest:null as UniSwiperTransitionEventDetail | null,
changeDetailTest:null as UniSwiperChangeDetail | null,
animationfinishDetailTest:null as UniSwiperAnimationFinishEventDetail | null,
transitionDetailTest:null as UniSwiperTransitionDetail | null,
animationfinishDetailTest:null as UniSwiperAnimationFinishDetail | null,
// #endif
isChangeTest:'',
isChangeTest:'',
isTransitionTest:'',
isTransitionTest:'',
isAnimationfinishTest:''
isAnimationfinishTest:''
...
@@ -130,9 +127,7 @@
...
@@ -130,9 +127,7 @@
},
},
methods: {
methods: {
swiperChange: function (e : UniSwiperChangeEvent) {
swiperChange: function (e : UniSwiperChangeEvent) {
// #ifndef APP-ANDROID
this.changeDetailTest = e.detail
this.changeDetailTest = e.detail
// #endif
this.checkEventTest({
this.checkEventTest({
type:e.type,
type:e.type,
target:e.target,
target:e.target,
...
@@ -146,9 +141,7 @@
...
@@ -146,9 +141,7 @@
}
}
},
},
swiperTransition: function (e : UniSwiperTransitionEvent) {
swiperTransition: function (e : UniSwiperTransitionEvent) {
// #ifndef APP-ANDROID
this.transitionDetailTest = e.detail
this.transitionDetailTest = e.detail
// #endif
this.checkEventTest({
this.checkEventTest({
type:e.type,
type:e.type,
target:e.target,
target:e.target,
...
@@ -160,9 +153,7 @@
...
@@ -160,9 +153,7 @@
}
}
},
},
swiperAnimationfinish: function (e : UniSwiperAnimationFinishEvent) {
swiperAnimationfinish: function (e : UniSwiperAnimationFinishEvent) {
// #ifndef APP-ANDROID
this.animationfinishDetailTest = e.detail
this.animationfinishDetailTest = e.detail
// #endif
this.checkEventTest({
this.checkEventTest({
type:e.type,
type:e.type,
target:e.target,
target:e.target,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录