diff --git a/pages/component/global-events/touch-events-bubbles.test.js b/pages/component/global-events/touch-events-bubbles.test.js index 709f68b73ab6e444ec31c02836ddb22508ae3e21..aaad7b625f0408c2cb909bed2effbfd4769e04b5 100644 --- a/pages/component/global-events/touch-events-bubbles.test.js +++ b/pages/component/global-events/touch-events-bubbles.test.js @@ -28,12 +28,12 @@ describe('touch-events-test', () => { let iconRect = await page.data('iconRect') let x = iconRect.x + iconRect.width / 2.0 - let y = iconRect.y + 5 + let y = iconRect.y + 25 // 滑动事件 await program.swipe({ startPoint: {x: x, y: y}, - endPoint: {x: x,y: y+35}, + endPoint: {x: x,y: y+15}, duration: 200 }) @@ -47,12 +47,12 @@ describe('touch-events-test', () => { let viewEleRect = await page.data('viewEleRect') let x = viewEleRect.x + viewEleRect.width / 2.0 - let y = viewEleRect.y + 5 + let y = viewEleRect.y + 25 // 滑动事件 await program.swipe({ startPoint: {x: x, y: y}, - endPoint: {x: x,y: y+35}, + endPoint: {x: x,y: y+15}, duration: 200 }) diff --git a/pages/component/global-events/touch-events-bubbles.uvue b/pages/component/global-events/touch-events-bubbles.uvue index 40279098a41960cacff2295b20ac42beac7eef73..92cd145f4905f4a9001899147bf4787c04d04c01 100644 --- a/pages/component/global-events/touch-events-bubbles.uvue +++ b/pages/component/global-events/touch-events-bubbles.uvue @@ -52,17 +52,33 @@ this.touchendValue = [] }, isPassTest1() { - let result = this.touchstartValue.join("") == "view1-3view1-2view1" && - this.touchmoveValue.join("") == "view1-3view1-2view1" && - this.touchendValue.join("") == "view1-3view1-2view1" + + let touchStart = this.touchstartValue.join("") + let touchMove = this.touchmoveValue.join("") + let touchEnd = this.touchendValue.join("") + console.log("touchStart: ", touchStart) + console.log("touchMove: ", touchMove) + console.log("touchEnd: ", touchEnd) + + let result = touchStart == "view1-3view1-2view1" && + touchMove == "view1-3view1-2view1" && + touchEnd == "view1-3view1-2view1" console.log('isPassTest1', result) this.ret1 = result this.clearValue() }, isPassTest2() { - let result = this.touchstartValue.join("") == "view2-3view2" && - this.touchmoveValue.join("") == "view2" && - this.touchendValue.join("") == "view2-3view2-2view2" + + let touchStart = this.touchstartValue.join("") + let touchMove = this.touchmoveValue.join("") + let touchEnd = this.touchendValue.join("") + console.log("touchStart: ", touchStart) + console.log("touchMove: ", touchMove) + console.log("touchEnd: ", touchEnd) + + let result = touchStart == "view2-3view2" && + touchMove == "view2" && + touchEnd == "view2-3view2-2view2" console.log('isPassTest2', result) this.ret2 = result this.clearValue()