From 91ef0373517c85e3aae95ee1498f713dac1039f7 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 21 Dec 2023 20:05:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E4=BE=8B=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E6=97=B6=E9=97=B4=E8=BF=87=E7=9F=AD=EF=BC=8C=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E5=8F=AF=E8=83=BD=E5=B0=9A=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/page-scroll-to/page-scroll-to.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/API/page-scroll-to/page-scroll-to.test.js b/pages/API/page-scroll-to/page-scroll-to.test.js index ef42d29f..c9f3ee8b 100644 --- a/pages/API/page-scroll-to/page-scroll-to.test.js +++ b/pages/API/page-scroll-to/page-scroll-to.test.js @@ -10,10 +10,9 @@ describe('page-scroll-to', () => { const btnScrollTo = await page.$('.btn-scrollTo') await btnScrollTo.tap() - await page.waitFor(300) - - const scrollTop = await page.scrollTop() + await page.waitFor(600) + const scrollTop = await page.scrollTop() // 设备精度问题,允许上下浮动 1px expect(scrollTop > 99 && scrollTop < 101).toBe(true) }) @@ -22,7 +21,7 @@ describe('page-scroll-to', () => { const scrollToElement = await page.$('.custom-element') await btnScrollTo.tap() - await page.waitFor(300) + await page.waitFor(600) const offset = await scrollToElement.offset() // android 6 分辨率为 720*1280,需要调整期望数值 -- GitLab