提交 2a16567a 编写于 作者: H hdx

fix(page-scroll-to.test): 调整误差范围

上级 04f17130
......@@ -12,7 +12,7 @@ describe('page-scroll-to', () => {
await btnScrollTo.tap()
await page.waitFor(600)
const scrollTop = await page.scrollTop()
const scrollTop = await page.scrollTop()
// 设备精度问题,允许上下浮动 1px
expect(scrollTop > 99 && scrollTop < 101).toBe(true)
})
......@@ -21,12 +21,12 @@ describe('page-scroll-to', () => {
const scrollToElement = await page.$('.custom-element')
await btnScrollTo.tap()
await page.waitFor(600)
await page.waitFor(1000)
const offset = await scrollToElement.offset()
// android 6 分辨率为 720*1280,需要调整期望数值
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) {
expect(offset.top >= 1188).toBe(true)
expect(offset.top >= 1180).toBe(true)
}
})
})
\ No newline at end of file
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册