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

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

上级 c5aab098
...@@ -51,13 +51,15 @@ describe('component-native-list-view', () => { ...@@ -51,13 +51,15 @@ describe('component-native-list-view', () => {
const scrollDetail = await page.data('scrollDetailTest') const scrollDetail = await page.data('scrollDetailTest')
// console.log('scrollDetailTest:', scrollDetail) // console.log('scrollDetailTest:', scrollDetail)
expect(scrollDetail.scrollLeft).toBe(0) expect(scrollDetail.scrollLeft).toBe(0)
// scrollTop和deltaY 在安卓端差异 299.8095 // 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.scrollHeight).toBeGreaterThan(0)
expect(scrollDetail.scrollWidth).toBeGreaterThan(0) expect(scrollDetail.scrollWidth).toBeGreaterThan(0)
expect(scrollDetail.deltaX).toBe(0) expect(scrollDetail.deltaX).toBe(0)
//此处可判断安卓issues:9121的问题 //此处可判断安卓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') expect(await page.data('isScrollTest')).toBe('scroll:Success')
}) })
......
...@@ -19,8 +19,9 @@ describe('component-native-scroll-view', () => { ...@@ -19,8 +19,9 @@ describe('component-native-scroll-view', () => {
const topScrollDetail = await page.data('scrollDetailTest') const topScrollDetail = await page.data('scrollDetailTest')
console.log('topScrollDetail:', topScrollDetail) console.log('topScrollDetail:', topScrollDetail)
expect(topScrollDetail.scrollLeft).toBe(0) expect(topScrollDetail.scrollLeft).toBe(0)
// Android 差异scrollTop:99.809525 // 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.scrollHeight).toBeGreaterThan(0)
expect(topScrollDetail.scrollWidth).toBeGreaterThan(0) expect(topScrollDetail.scrollWidth).toBeGreaterThan(0)
expect(topScrollDetail.deltaX).toBe(0) expect(topScrollDetail.deltaX).toBe(0)
...@@ -35,13 +36,15 @@ describe('component-native-scroll-view', () => { ...@@ -35,13 +36,15 @@ describe('component-native-scroll-view', () => {
//设置left 是否触发scroll 事件 //设置left 是否触发scroll 事件
const leftScrollDetail = await page.data('scrollDetailTest') const leftScrollDetail = await page.data('scrollDetailTest')
console.log('leftScrollDetail:', leftScrollDetail) console.log('leftScrollDetail:', leftScrollDetail)
// Android 差异scrollLeft:219.80952 // 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.scrollTop).toBe(0)
expect(leftScrollDetail.scrollHeight).toBeGreaterThan(0) expect(leftScrollDetail.scrollHeight).toBeGreaterThan(0)
expect(leftScrollDetail.scrollWidth).toBeGreaterThan(0) expect(leftScrollDetail.scrollWidth).toBeGreaterThan(0)
// 在安卓差异 -99.809525 // 在安卓差异 -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(leftScrollDetail.deltaY).toBe(0)
expect(await page.data('isScrollTest')).toBe('scroll:Success') expect(await page.data('isScrollTest')).toBe('scroll:Success')
}) })
......
...@@ -32,13 +32,15 @@ describe('component-native-waterflow', () => { ...@@ -32,13 +32,15 @@ describe('component-native-waterflow', () => {
const scrollDetail = await page.data('scrollDetailTest') const scrollDetail = await page.data('scrollDetailTest')
// console.log('scrollDetailTest:', scrollDetail) // console.log('scrollDetailTest:', scrollDetail)
expect(scrollDetail.scrollLeft).toBe(0) expect(scrollDetail.scrollLeft).toBe(0)
// scrollTop和deltaY 在安卓端差异 299.8095 // 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.scrollHeight).toBeGreaterThan(0)
expect(scrollDetail.scrollWidth).toBeGreaterThan(0) expect(scrollDetail.scrollWidth).toBeGreaterThan(0)
expect(scrollDetail.deltaX).toBe(0) expect(scrollDetail.deltaX).toBe(0)
//此处可判断安卓issues:9121的问题 //此处可判断安卓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') 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.
先完成此消息的编辑!
想要评论请 注册