提交 d240649f 编写于 作者: H hdx

node-info: 调整 自动化测试,移除 Android 6 的例外

上级 b9bb64e7
...@@ -19,12 +19,10 @@ describe('nodes-info', () => { ...@@ -19,12 +19,10 @@ describe('nodes-info', () => {
const data = await page.data() const data = await page.data()
// TODO 和浏览器的计算存在差异 // TODO 和浏览器的计算存在差异
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) { const nodeInfo = data.nodeInfoList[0]
const nodeInfo = data.nodeInfoList[0] expect(Math.round(nodeInfo.left)).toBe(RECT_LEFT)
expect(Math.round(nodeInfo.left)).toBe(RECT_LEFT) expect(Math.round(nodeInfo.width)).toBe(RECT_WIDTH)
expect(Math.round(nodeInfo.width)).toBe(RECT_WIDTH) expect(Math.round(nodeInfo.height)).toBe(RECT_HEIGHT)
expect(Math.round(nodeInfo.height)).toBe(RECT_HEIGHT)
}
}) })
it('get-all-node-info', async () => { it('get-all-node-info', async () => {
const btnGetAllNodeInfo = await page.$('.btn-get-all-node-info') const btnGetAllNodeInfo = await page.$('.btn-get-all-node-info')
...@@ -34,18 +32,16 @@ describe('nodes-info', () => { ...@@ -34,18 +32,16 @@ describe('nodes-info', () => {
const data = await page.data() const data = await page.data()
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) { const nodeInfo1 = data.nodeInfoList[0]
const nodeInfo1 = data.nodeInfoList[0] expect(Math.round(nodeInfo1.left)).toBe(RECT_LEFT)
expect(Math.round(nodeInfo1.left)).toBe(RECT_LEFT) expect(nodeInfo1.top > 220).toBe(true)
expect(nodeInfo1.top > 220).toBe(true) expect(Math.round(nodeInfo1.width)).toBe(RECT_WIDTH)
expect(Math.round(nodeInfo1.width)).toBe(RECT_WIDTH) expect(Math.round(nodeInfo1.height)).toBe(RECT_HEIGHT)
expect(Math.round(nodeInfo1.height)).toBe(RECT_HEIGHT)
const nodeInfo2 = data.nodeInfoList[1]
const nodeInfo2 = data.nodeInfoList[1] expect(nodeInfo2.left > 200).toBe(true)
expect(nodeInfo2.left > 200).toBe(true) expect(nodeInfo2.top > 220).toBe(true)
expect(nodeInfo2.top > 220).toBe(true) expect(Math.round(nodeInfo2.width)).toBe(RECT_WIDTH)
expect(Math.round(nodeInfo2.width)).toBe(RECT_WIDTH) expect(Math.round(nodeInfo2.height)).toBe(RECT_HEIGHT)
expect(Math.round(nodeInfo2.height)).toBe(RECT_HEIGHT)
}
}) })
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册