提交 55acad32 编写于 作者: Anne_LXM's avatar Anne_LXM

test(swiper): 修复类型报错/放开android 端测试

上级 e8287fca
......@@ -90,28 +90,23 @@ describe('test swiper', () => {
});
it('Event transitiont', async () => {
// bug:android端swiper的事件event参数detail类型错误,暂时忽略测试
if(!process.env.UNI_UTS_PLATFORM.startsWith('app-android')){
const transitionDetailInfo = await page.data('transitionDetailTest')
// bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试
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')
const transitionDetailInfo = await page.data('transitionDetailTest')
// bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试
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')
});
it('Event change', async () => {
if(!process.env.UNI_UTS_PLATFORM.startsWith('app-android')){
const changeDetailInfo = await page.data('changeDetailTest')
if(process.env.uniTestPlatformInfo.startsWith('web')){
expect(changeDetailInfo).toEqual(webDetailRes)
}else{
expect(changeDetailInfo).toEqual(appDetailRes)
}
expect(await page.data('isChangeTest')).toBe('change:Success')
const changeDetailInfo = await page.data('changeDetailTest')
if(process.env.uniTestPlatformInfo.startsWith('web')){
expect(changeDetailInfo).toEqual(webDetailRes)
}else{
expect(changeDetailInfo).toEqual(appDetailRes)
}
expect(await page.data('isChangeTest')).toBe('change:Success')
});
it('Event animationfinish', async () => {
......
......@@ -117,12 +117,9 @@
swiperChangeSelect: false,
currentValChange: 0,
// 自动化测试
// 在android端以下事件event参数中detail类型报错,先条件编译处理
// #ifndef APP-ANDROID
changeDetailTest:null as UniSwiperChangeDetail | null,
transitionDetailTest:null as UniSwiperTransitionDetail | null,
animationfinishDetailTest:null as UniSwiperAnimationFinishDetail | null,
// #endif
changeDetailTest:null as UniSwiperChangeEventDetail | null,
transitionDetailTest:null as UniSwiperTransitionEventDetail | null,
animationfinishDetailTest:null as UniSwiperAnimationFinishEventDetail | null,
isChangeTest:'',
isTransitionTest:'',
isAnimationfinishTest:''
......@@ -130,9 +127,7 @@
},
methods: {
swiperChange: function (e : UniSwiperChangeEvent) {
// #ifndef APP-ANDROID
this.changeDetailTest = e.detail
// #endif
this.checkEventTest({
type:e.type,
target:e.target,
......@@ -146,9 +141,7 @@
}
},
swiperTransition: function (e : UniSwiperTransitionEvent) {
// #ifndef APP-ANDROID
this.transitionDetailTest = e.detail
// #endif
this.checkEventTest({
type:e.type,
target:e.target,
......@@ -160,9 +153,7 @@
}
},
swiperAnimationfinish: function (e : UniSwiperAnimationFinishEvent) {
// #ifndef APP-ANDROID
this.animationfinishDetailTest = e.detail
// #endif
this.checkEventTest({
type:e.type,
target:e.target,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册