提交 37630842 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 测试例兼容低分辨率设备

上级 74436c54
......@@ -13,11 +13,13 @@ describe('nodes-info', () => {
await page.waitFor(50)
const data = await page.data()
// android 6 分辨率为 720*1280,需要调整期望数值
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) {
const nodeInfo = data.nodeInfoList[0]
expect(nodeInfo.left > 15).toBe(true)
expect(nodeInfo.width == 150).toBe(true)
expect(nodeInfo.height == 100).toBe(true)
}
})
it('get-all-node-info', async () => {
const btnGetAllNodeInfo = await page.$('.btn-get-all-node-info')
......@@ -27,6 +29,7 @@ describe('nodes-info', () => {
const data = await page.data()
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) {
const nodeInfo1 = data.nodeInfoList[0]
expect(nodeInfo1.left > 15).toBe(true)
expect(nodeInfo1.top > 220).toBe(true)
......@@ -38,5 +41,6 @@ describe('nodes-info', () => {
expect(nodeInfo2.top > 220).toBe(true)
expect(nodeInfo2.width == 150).toBe(true)
expect(nodeInfo2.height == 100).toBe(true)
}
})
})
\ No newline at end of file
......@@ -25,6 +25,9 @@ describe('page-scroll-to', () => {
await page.waitFor(300)
const offset = await scrollToElement.offset()
// android 6 分辨率为 720*1280,需要调整期望数值
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) {
expect(offset.top >= 1188).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.
先完成此消息的编辑!
想要评论请 注册