diff --git a/pages/CSS/overflow/overflow-visible-event.uvue b/pages/CSS/overflow/overflow-visible-event.uvue index 5ee297e6844d5c003ea426b0394d5a5fa4c5c934..d0fbbbabb2ff5f3e521131db58ce99a21e18d375 100644 --- a/pages/CSS/overflow/overflow-visible-event.uvue +++ b/pages/CSS/overflow/overflow-visible-event.uvue @@ -100,12 +100,17 @@ jest_getRect() { const rect = uni.getElementById('child')?.getBoundingClientRect() if (rect != null) { - let ratio = 1 + let ratio = 1 + const systemInfo = uni.getSystemInfoSync() + const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight + if (uni.getSystemInfoSync().platform == 'android'){ ratio = uni.getSystemInfoSync().devicePixelRatio } - this.jest_click_x = rect.x * ratio + 10 - this.jest_click_y = rect.bottom * ratio - 10 + const systemInfo = uni.getSystemInfoSync() + 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() { @@ -129,8 +134,8 @@ if (uni.getSystemInfoSync().platform == 'android'){ ratio = uni.getSystemInfoSync().devicePixelRatio } - this.jest_click_x = rect.x * ratio + 10 - this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio + this.jest_click_x = rect.x * ratio + 30 + this.jest_click_y = (rect.top + titleBarHeight + 30) * ratio } }, jest_scrollToDeepOverflow() { @@ -146,9 +151,9 @@ } const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect() - if (afterRect != null) { - this.jest_click_x = afterRect.x * ratio + 10 - this.jest_click_y = (afterRect.top + titleBarHeight + 10) * ratio + if (afterRect != null) { + this.jest_click_x = afterRect.x * ratio + 30 + this.jest_click_y = (afterRect.top + titleBarHeight + 30) * ratio } }, 200) } diff --git a/testSequencer.js b/testSequencer.js index d3a61ec9716b3375002857de888ea035f34d0367..1c2f719ed70b3c643bc8a9eefa495b454ce07428 100644 --- a/testSequencer.js +++ b/testSequencer.js @@ -8,6 +8,7 @@ const sortTestFilePaths = [ "pages/component/global-events/touch-events.test.js", "pages/component/global-events/touch-events-bubbles.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" ] class CustomSequencer extends Sequencer {