From 9d6ed37c21bf549ca29802c90606b1c947f7d0f0 Mon Sep 17 00:00:00 2001 From: zhaofengliang Date: Fri, 18 Oct 2024 16:39:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20overflow-visible-event.tes?= =?UTF-8?q?t.js=20=E6=B5=8B=E8=AF=95=E4=BE=8B=E5=AD=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CSS/overflow/overflow-visible-event.uvue | 21 ++++++++++++------- testSequencer.js | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pages/CSS/overflow/overflow-visible-event.uvue b/pages/CSS/overflow/overflow-visible-event.uvue index 5ee297e6..d0fbbbab 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 d3a61ec9..1c2f719e 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 { -- GitLab