From b01eeeb8814840da71f1ca3f469d6df6e5414d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B2=B2=E8=BE=89?= Date: Wed, 5 Jul 2023 20:49:04 +0800 Subject: [PATCH] =?UTF-8?q?fit=20bug=20for=20"=E6=BB=9A=E5=8A=A8=E7=B1=BB?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AEfling?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E7=9A=84=E5=8F=82=E6=95=B0"XTS=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李鲲辉 --- .../Grid_attribute/Grid_GridFriction.test.ets | 27 +++++++++--------- .../List_attribute/List_ListFriction.test.ets | 28 ++++++++++--------- .../Scroll_ScrollFriction.test.ets | 25 +++++++++-------- .../WaterFlow_WaterFlowFriction.test.ets | 23 +++++++-------- 4 files changed, 54 insertions(+), 49 deletions(-) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/Grid_attribute/Grid_GridFriction.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/Grid_attribute/Grid_GridFriction.test.ets index 13de492f3..36db12997 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/Grid_attribute/Grid_GridFriction.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Grid/Grid_attribute/Grid_GridFriction.test.ets @@ -15,34 +15,33 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import router from '@ohos.router'; import CommonFunc from '../../../MainAbility/common/Common'; -import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, - WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest'; +import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager'; export default function grid_GridFrictionTest() { - describe('Grid_GridFrictionTest', function () { + describe('grid_GridFrictionTest', function () { beforeEach(async function (done) { - console.info("Grid_GridFrictionTest beforeEach start"); + console.info("GridFrictionPage beforeEach start"); let options = { url: 'MainAbility/pages/Grid/Grid_attribute/GridFrictionPage', } try { router.clear(); let pages = router.getState(); - console.info("get Grid_GridFrictionTest state pages:" + JSON.stringify(pages)); - if (!("Grid_GridFrictionTest" == pages.name)) { - console.info("get Grid_GridInitialIndex1 pages.name:" + JSON.stringify(pages.name)); + console.info("get GridFrictionPage state pages:" + JSON.stringify(pages)); + if (!("GridFrictionPage" == pages.name)) { + console.info("get GridFrictionPage pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); await CommonFunc.sleep(2000); - console.info("push Grid_GridFrictionTest page result:" + JSON.stringify(result)); + console.info("push GridFrictionPage page result:" + JSON.stringify(result)); } } catch (err) { - console.error("push Grid_GridFrictionTest page error:" + err); + console.error("push GridFrictionPage page error:" + err); } - console.info("Grid_GridFrictionTest beforeEach end"); + console.info("GridFrictionPage beforeEach end"); done(); }); afterEach(async function () { await CommonFunc.sleep(1000); - console.info("Grid_GridFrictionTest after each called"); + console.info("GridFrictionPage after each called"); }); /** * @tc.number SUB_ACE_GRID_GRIDFRICTION_001 @@ -52,10 +51,11 @@ export default function grid_GridFrictionTest() { it('testGridFriction', 0, async function (done) { console.info('[testGridFriction] START'); globalThis.value.message.notify({name:'friction', value:-1}) + await CommonFunc.sleep(2000); let gridContainerStrJson = getInspectorByKey('Grid_GridFriction'); let gridContainerObj = JSON.parse(gridContainerStrJson); expect(gridContainerObj.$type).assertEqual('Grid'); - expect(gridContainerObj.$friction).assertEqual(0.6); + expect(gridContainerObj.$attrs.friction).assertEqual(0.6); console.info('[testGridFriction] END'); done(); }); @@ -68,10 +68,11 @@ export default function grid_GridFrictionTest() { it('testGridFriction', 0, async function (done) { console.info('[testGridFriction] START'); globalThis.value.message.notify({name:'friction', value:10}) + await CommonFunc.sleep(2000); let gridContainerStrJson = getInspectorByKey('Grid_GridFriction'); let gridContainerObj = JSON.parse(gridContainerStrJson); expect(gridContainerObj.$type).assertEqual('Grid'); - expect(gridContainerObj.$friction).assertEqual(10); + expect(gridContainerObj.$attrs.friction).assertEqual(10); console.info('[testGridFriction] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/List/List_attribute/List_ListFriction.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/List/List_attribute/List_ListFriction.test.ets index 27d1319ee..9d8109fad 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/List/List_attribute/List_ListFriction.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/List/List_attribute/List_ListFriction.test.ets @@ -15,34 +15,34 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import router from '@ohos.router'; import CommonFunc from '../../../MainAbility/common/Common'; -import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, - WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest'; +import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager'; export default function list_ListFrictionTest() { - describe('List_ListFrictionTest', function () { + + describe('list_ListFrictionTest', function () { beforeEach(async function (done) { - console.info("List_ListFrictionTest beforeEach start"); + console.info("ListFrictionPage beforeEach start"); let options = { url: 'MainAbility/pages/List/List_attribute/ListFrictionPage', } try { router.clear(); let pages = router.getState(); - console.info("get List_ListFrictionTest state pages:" + JSON.stringify(pages)); - if (!("list_ListFrictionTest" == pages.name)) { - console.info("get List_ListInitialIndex1 pages.name:" + JSON.stringify(pages.name)); + console.info("get ListFrictionPage state pages:" + JSON.stringify(pages)); + if (!("ListFrictionPage" == pages.name)) { + console.info("get ListFrictionPage pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); await CommonFunc.sleep(2000); - console.info("push List_ListFrictionTest page result:" + JSON.stringify(result)); + console.info("push ListFrictionPage page result:" + JSON.stringify(result)); } } catch (err) { - console.error("push List_ListFrictionTest page error:" + err); + console.error("push ListFrictionPage page error:" + err); } - console.info("List_ListFrictionTest beforeEach end"); + console.info("ListFrictionPage beforeEach end"); done(); }); afterEach(async function () { await CommonFunc.sleep(1000); - console.info("List_ListFrictionTest after each called"); + console.info("ListFrictionPage after each called"); }); /** * @tc.number SUB_ACE_LIST_LISTFRICTION_001 @@ -52,10 +52,11 @@ export default function list_ListFrictionTest() { it('testListFriction', 0, async function (done) { console.info('[testListFriction] START'); globalThis.value.message.notify({name:'friction', value:-1}) + await CommonFunc.sleep(2000); let listContainerStrJson = getInspectorByKey('List_ListFriction'); let listContainerObj = JSON.parse(listContainerStrJson); expect(listContainerObj.$type).assertEqual('List'); - expect(listContainerObj.$friction).assertEqual(0.6); + expect(listContainerObj.$attrs.friction).assertEqual(0.6); console.info('[testListFriction] END'); done(); }); @@ -68,10 +69,11 @@ export default function list_ListFrictionTest() { it('testListFriction', 0, async function (done) { console.info('[testListFriction] START'); globalThis.value.message.notify({name:'friction', value:10}) + await CommonFunc.sleep(2000); let listContainerStrJson = getInspectorByKey('List_ListFriction'); let listContainerObj = JSON.parse(listContainerStrJson); expect(listContainerObj.$type).assertEqual('List'); - expect(listContainerObj.$friction).assertEqual(10); + expect(listContainerObj.$attrs.friction).assertEqual(10); console.info('[testListFriction] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Scroll/Scroll_attribute/Scroll_ScrollFriction.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Scroll/Scroll_attribute/Scroll_ScrollFriction.test.ets index 075780d61..554b98a2f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Scroll/Scroll_attribute/Scroll_ScrollFriction.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Scroll/Scroll_attribute/Scroll_ScrollFriction.test.ets @@ -15,34 +15,33 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import router from '@ohos.router'; import CommonFunc from '../../../MainAbility/common/Common'; -import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, - WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest'; +import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager'; export default function scroll_ScrollFrictionTest() { - describe('Scroll_ScrollFrictionTest', function () { + describe('scroll_ScrollFrictionTest', function () { beforeEach(async function (done) { - console.info("Scroll_ScrollFrictionTest beforeEach start"); + console.info("ScrollFrictionPage beforeEach start"); let options = { url: 'MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage', } try { router.clear(); let pages = router.getState(); - console.info("get Scroll_ScrollFrictionTest state pages:" + JSON.stringify(pages)); - if (!("Scroll_ScrollFrictionTest" == pages.name)) { + console.info("get ScrollFrictionPage state pages:" + JSON.stringify(pages)); + if (!("ScrollFrictionPage" == pages.name)) { console.info("get Scroll_ScrollInitialIndex1 pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); await CommonFunc.sleep(2000); - console.info("push Scroll_ScrollFrictionTest page result:" + JSON.stringify(result)); + console.info("push ScrollFrictionPage page result:" + JSON.stringify(result)); } } catch (err) { - console.error("push Scroll_ScrollFrictionTest page error:" + err); + console.error("push ScrollFrictionPage page error:" + err); } - console.info("Scroll_ScrollFrictionTest beforeEach end"); + console.info("ScrollFrictionPage beforeEach end"); done(); }); afterEach(async function () { await CommonFunc.sleep(1000); - console.info("Scroll_ScrollFrictionTest after each called"); + console.info("ScrollFrictionPage after each called"); }); /** * @tc.number SUB_ACE_SCROLL_SCROLLFRICTION_001 @@ -52,10 +51,11 @@ export default function scroll_ScrollFrictionTest() { it('testScrollFriction', 0, async function (done) { console.info('[testScrollFriction] START'); globalThis.value.message.notify({name:'friction', value:-1}) + await CommonFunc.sleep(2000); let scrollContainerStrJson = getInspectorByKey('Scroll_ScrollFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); expect(scrollContainerObj.$type).assertEqual('Scroll'); - expect(scrollContainerObj.$friction).assertEqual(0.6); + expect(scrollContainerObj.$attrs.friction).assertEqual(0.6); console.info('[testScrollFriction] END'); done(); }); @@ -68,10 +68,11 @@ export default function scroll_ScrollFrictionTest() { it('testScrollFriction', 0, async function (done) { console.info('[testScrollFriction] START'); globalThis.value.message.notify({name:'friction', value:10}) + await CommonFunc.sleep(2000); let scrollContainerStrJson = getInspectorByKey('Scroll_ScrollFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); expect(scrollContainerObj.$type).assertEqual('Scroll'); - expect(scrollContainerObj.$friction).assertEqual(10); + expect(scrollContainerObj.$attrs.friction).assertEqual(10); console.info('[testScrollFriction] END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/WaterFlow/WaterFlow_attribute/WaterFlow_WaterFlowFriction.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/WaterFlow/WaterFlow_attribute/WaterFlow_WaterFlowFriction.test.ets index 466e33e11..ba5d9f896 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/WaterFlow/WaterFlow_attribute/WaterFlow_WaterFlowFriction.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/WaterFlow/WaterFlow_attribute/WaterFlow_WaterFlowFriction.test.ets @@ -15,29 +15,28 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import router from '@ohos.router'; import CommonFunc from '../../../MainAbility/common/Common'; -import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, - WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest'; +import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager'; export default function waterFlow_WaterFlowFrictionTest() { - describe('WaterFlow_WaterFlowFrictionTest', function () { + describe('waterFlow_WaterFlowFrictionTest', function () { beforeEach(async function (done) { - console.info("WaterFlow_WaterFlowFrictionTest beforeEach start"); + console.info("WaterFlowFrictionPage beforeEach start"); let options = { url: 'MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage', } try { router.clear(); let pages = router.getState(); - console.info("get WaterFlow_WaterFlowFrictionTest state pages:" + JSON.stringify(pages)); - if (!("WaterFlow_WaterFlowFrictionTest" == pages.name)) { + console.info("get WaterFlowFrictionPage state pages:" + JSON.stringify(pages)); + if (!("WaterFlowFrictionPage" == pages.name)) { console.info("get WaterFlow_WaterFlow pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); await CommonFunc.sleep(2000); - console.info("push WaterFlow_WaterFlowFrictionTest page result:" + JSON.stringify(result)); + console.info("push WaterFlowFrictionPage page result:" + JSON.stringify(result)); } } catch (err) { - console.error("push WaterFlow_WaterFlowFrictionTest page error:" + err); + console.error("push WaterFlowFrictionPage page error:" + err); } - console.info("WaterFlow_WaterFlowFrictionTest beforeEach end"); + console.info("WaterFlowFrictionPage beforeEach end"); done(); }); afterEach(async function () { @@ -52,10 +51,11 @@ export default function waterFlow_WaterFlowFrictionTest() { it('testWaterFlowFriction', 0, async function (done) { console.info('[testWaterFlowFriction] START'); globalThis.value.message.notify({name:'friction', value:-1}) + await CommonFunc.sleep(2000); let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); expect(scrollContainerObj.$type).assertEqual('WaterFlow'); - expect(scrollContainerObj.$friction).assertEqual(0.6); + expect(scrollContainerObj.$attrs.friction).assertEqual(0.6); console.info('[testWaterFlowFriction] END'); done(); }); @@ -68,10 +68,11 @@ export default function waterFlow_WaterFlowFrictionTest() { it('testWaterFlowFriction', 0, async function (done) { console.info('[testWaterFlowFriction] START'); globalThis.value.message.notify({name:'friction', value:10}) + await CommonFunc.sleep(2000); let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); expect(scrollContainerObj.$type).assertEqual('WaterFlow'); - expect(scrollContainerObj.$friction).assertEqual(10); + expect(scrollContainerObj.$attrs.friction).assertEqual(10); console.info('[testWaterFlowFriction] END'); done(); }); -- GitLab