提交 fff175c6 编写于 作者: shutao-dc's avatar shutao-dc

更新自动化测试校验android滚动距离小数的判断逻辑

上级 c5aab098
......@@ -52,12 +52,14 @@ describe('component-native-list-view', () => {
// console.log('scrollDetailTest:', scrollDetail)
expect(scrollDetail.scrollLeft).toBe(0)
// scrollTop和deltaY 在安卓端差异 299.8095
expect([300, 299.8095]).toContain(scrollDetail.scrollTop);
expect(scrollDetail.scrollTop).toBeGreaterThan(299.5)
//expect([300, 299.8095]).toContain(scrollDetail.scrollTop);
expect(scrollDetail.scrollHeight).toBeGreaterThan(0)
expect(scrollDetail.scrollWidth).toBeGreaterThan(0)
expect(scrollDetail.deltaX).toBe(0)
//此处可判断安卓issues:9121的问题
expect([300.1905, 300, 299.8095]).toContain(scrollDetail.deltaY);
expect(scrollDetail.deltaY).toBeGreaterThan(299.5)
//expect([300.1905, 300, 299.8095]).toContain(scrollDetail.deltaY);
expect(await page.data('isScrollTest')).toBe('scroll:Success')
})
......
......@@ -20,7 +20,8 @@ describe('component-native-scroll-view', () => {
console.log('topScrollDetail:', topScrollDetail)
expect(topScrollDetail.scrollLeft).toBe(0)
// Android 差异scrollTop:99.809525
expect([100, 99.809525]).toContain(topScrollDetail.scrollTop);
expect(topScrollDetail.scrollTop).toBeGreaterThan(99.5)
//expect([100, 99.809525]).toContain(topScrollDetail.scrollTop);
expect(topScrollDetail.scrollHeight).toBeGreaterThan(0)
expect(topScrollDetail.scrollWidth).toBeGreaterThan(0)
expect(topScrollDetail.deltaX).toBe(0)
......@@ -36,12 +37,14 @@ describe('component-native-scroll-view', () => {
const leftScrollDetail = await page.data('scrollDetailTest')
console.log('leftScrollDetail:', leftScrollDetail)
// Android 差异scrollLeft:219.80952
expect([220, 219.80952]).toContain(leftScrollDetail.scrollLeft);
expect(leftScrollDetail.scrollLeft).toBeGreaterThan(219.5)
//expect([220, 219.80952]).toContain(leftScrollDetail.scrollLeft);
expect(leftScrollDetail.scrollTop).toBe(0)
expect(leftScrollDetail.scrollHeight).toBeGreaterThan(0)
expect(leftScrollDetail.scrollWidth).toBeGreaterThan(0)
// 在安卓差异 -99.809525
expect([-100, -99.809525]).toContain(leftScrollDetail.deltaX);
expect(leftScrollDetail.deltaX).toBeLessThan(-99.5)
//expect([-100, -99.809525]).toContain(leftScrollDetail.deltaX);
expect(leftScrollDetail.deltaY).toBe(0)
expect(await page.data('isScrollTest')).toBe('scroll:Success')
})
......
......@@ -33,12 +33,14 @@ describe('component-native-waterflow', () => {
// console.log('scrollDetailTest:', scrollDetail)
expect(scrollDetail.scrollLeft).toBe(0)
// scrollTop和deltaY 在安卓端差异 299.8095
expect([300, 299.8095]).toContain(scrollDetail.scrollTop);
expect(scrollDetail.scrollTop).toBeGreaterThan(299.5)
//expect([300, 299.8095]).toContain(scrollDetail.scrollTop);
expect(scrollDetail.scrollHeight).toBeGreaterThan(0)
expect(scrollDetail.scrollWidth).toBeGreaterThan(0)
expect(scrollDetail.deltaX).toBe(0)
//此处可判断安卓issues:9121的问题
expect([300.1905, 300, 299.8095]).toContain(scrollDetail.deltaY);
expect(scrollDetail.deltaY).toBeGreaterThan(299.5)
//expect([300.1905, 300, 299.8095]).toContain(scrollDetail.deltaY);
expect(await page.data('isScrollTest')).toBe('scroll:Success')
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册