提交 9d6ed37c 编写于 作者: zhaofengliang920817's avatar zhaofengliang920817

修改 overflow-visible-event.test.js 测试例子。

上级 2131040f
...@@ -101,11 +101,16 @@ ...@@ -101,11 +101,16 @@
const rect = uni.getElementById('child')?.getBoundingClientRect() const rect = uni.getElementById('child')?.getBoundingClientRect()
if (rect != null) { if (rect != null) {
let ratio = 1 let ratio = 1
const systemInfo = uni.getSystemInfoSync()
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
if (uni.getSystemInfoSync().platform == 'android'){ if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio ratio = uni.getSystemInfoSync().devicePixelRatio
} }
this.jest_click_x = rect.x * ratio + 10 const systemInfo = uni.getSystemInfoSync()
this.jest_click_y = rect.bottom * ratio - 10 const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = (rect.bottom + titleBarHeight - 40) * ratio
} }
}, },
jest_getParentRect() { jest_getParentRect() {
...@@ -129,8 +134,8 @@ ...@@ -129,8 +134,8 @@
if (uni.getSystemInfoSync().platform == 'android'){ if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio ratio = uni.getSystemInfoSync().devicePixelRatio
} }
this.jest_click_x = rect.x * ratio + 10 this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio this.jest_click_y = (rect.top + titleBarHeight + 30) * ratio
} }
}, },
jest_scrollToDeepOverflow() { jest_scrollToDeepOverflow() {
...@@ -147,8 +152,8 @@ ...@@ -147,8 +152,8 @@
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect() const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect()
if (afterRect != null) { if (afterRect != null) {
this.jest_click_x = afterRect.x * ratio + 10 this.jest_click_x = afterRect.x * ratio + 30
this.jest_click_y = (afterRect.top + titleBarHeight + 10) * ratio this.jest_click_y = (afterRect.top + titleBarHeight + 30) * ratio
} }
}, 200) }, 200)
} }
......
...@@ -8,6 +8,7 @@ const sortTestFilePaths = [ ...@@ -8,6 +8,7 @@ const sortTestFilePaths = [
"pages/component/global-events/touch-events.test.js", "pages/component/global-events/touch-events.test.js",
"pages/component/global-events/touch-events-bubbles.test.js", "pages/component/global-events/touch-events-bubbles.test.js",
"pages/component/swiper/swiper2.test.js", "pages/component/swiper/swiper2.test.js",
"pages/CSS/overflow/overflow-visible-event.test.js",
"pages/component/rich-text/rich-text-complex.test.js" "pages/component/rich-text/rich-text-complex.test.js"
] ]
class CustomSequencer extends Sequencer { class CustomSequencer extends Sequencer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册