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

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

上级 e8287fca
...@@ -90,8 +90,6 @@ describe('test swiper', () => { ...@@ -90,8 +90,6 @@ describe('test swiper', () => {
}); });
it('Event transitiont', async () => { it('Event transitiont', async () => {
// bug:android端swiper的事件event参数detail类型错误,暂时忽略测试
if(!process.env.UNI_UTS_PLATFORM.startsWith('app-android')){
const transitionDetailInfo = await page.data('transitionDetailTest') const transitionDetailInfo = await page.data('transitionDetailTest')
// bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试 // bug:在iOS端,swiper首次横向滑动切换@transition事件参数e.detail.dy为1错误,暂时忽略测试
if(process.env.uniTestPlatformInfo.startsWith('web')){ if(process.env.uniTestPlatformInfo.startsWith('web')){
...@@ -99,11 +97,9 @@ describe('test swiper', () => { ...@@ -99,11 +97,9 @@ describe('test swiper', () => {
} }
expect(transitionDetailInfo.dx).not.toBe(0) expect(transitionDetailInfo.dx).not.toBe(0)
expect(await page.data('isTransitionTest')).toBe('transition:Success') 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)
...@@ -111,7 +107,6 @@ describe('test swiper', () => { ...@@ -111,7 +107,6 @@ describe('test swiper', () => {
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 () => {
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册