diff --git a/pages/component/waterflow/waterflow.test.js b/pages/component/waterflow/waterflow.test.js index 7bea611d08129473d860aebbb4d0ab51b4dd6ffa..0bb71dbe3e2a1d7ca696595acbeb125208810520 100644 --- a/pages/component/waterflow/waterflow.test.js +++ b/pages/component/waterflow/waterflow.test.js @@ -65,7 +65,7 @@ describe('component-native-waterflow', () => { endPoint: { x: 100, y: 100 }, duration: 100 }) - await page.waitFor(1200) + await page.waitFor(4200) const endDetail = await page.data('scrollEndDetailTest') console.log('scrollEndDetailTest:', endDetail) expect(endDetail.deltaY).toBe(0) @@ -83,29 +83,31 @@ describe('component-native-waterflow', () => { expect(value).toBe(true) }) - //检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误 - it('check_refresher', async () => { - await page.callMethod('confirm_scroll_top_input', 0) - await page.setData({ - refresher_enabled_boolean: true, - refresher_triggered_boolean: true + if(process.env.uniTestPlatformInfo.toLowerCase().startsWith('android')) { + //检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误 + it('check_refresher', async () => { + await page.callMethod('confirm_scroll_top_input', 0) + await page.setData({ + refresher_enabled_boolean: true, + refresher_triggered_boolean: true + }) + await page.waitFor(2000) + expect(await page.data('refresherrefresh')).toBe(true) + //延迟 等待下拉刷新执行结束 防止后续测试任务结果异常 + await page.waitFor(1000) }) - await page.waitFor(2000) - expect(await page.data('refresherrefresh')).toBe(true) - //延迟 等待下拉刷新执行结束 防止后续测试任务结果异常 - await page.waitFor(1000) - }) - //检测竖向scroll_into_view属性赋值 备注:iOS本地测试结果正确,但是自动化测试结果错误 - it('check_scroll_into_view_top', async () => { - await page.callMethod('setScrollIntoView', 'item---3') - await page.waitFor(600) - const waterflowElement = await page.$('#waterflow') - const scrollTop = await waterflowElement.attribute("scrollTop") - console.log("check_scroll_into_view_top--"+scrollTop) - await page.callMethod('setScrollIntoView', 'item---0') - expect(scrollTop-280).toBeGreaterThanOrEqual(0) - }) + //检测竖向scroll_into_view属性赋值 备注:iOS本地测试结果正确,但是自动化测试结果错误 + it('check_scroll_into_view_top', async () => { + await page.callMethod('setScrollIntoView', 'item---3') + await page.waitFor(600) + const waterflowElement = await page.$('#waterflow') + const scrollTop = await waterflowElement.attribute("scrollTop") + console.log("check_scroll_into_view_top--"+scrollTop) + await page.callMethod('setScrollIntoView', 'item---0') + expect(scrollTop-280).toBeGreaterThanOrEqual(0) + }) + } //检测waterflow属性变化 截图校验 it('check_waterflow_view_props', async () => {