From 30abf8b525dcd05a063e7c105a7c3febd0f674e8 Mon Sep 17 00:00:00 2001 From: XHY Date: Fri, 6 Dec 2024 19:54:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20waterflow=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BE=8B=EF=BC=8C=E9=80=82=E9=85=8DiOS=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit aeb5151814b703c808244dc7817cc976d9524cb8) --- pages/component/waterflow/waterflow.test.js | 46 +++++++++++---------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/pages/component/waterflow/waterflow.test.js b/pages/component/waterflow/waterflow.test.js index 7bea611d..0bb71dbe 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 () => { -- GitLab