diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Grid/Grid_attribute/GridFrictionPage.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Grid/Grid_attribute/GridFrictionPage.ets index 3349af8811f2778070d391c43b04001824cd0759..95554114ed5015b8018e0a9776b4eb4509c8ecfd 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Grid/Grid_attribute/GridFrictionPage.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Grid/Grid_attribute/GridFrictionPage.ets @@ -69,7 +69,7 @@ struct GridFrictionPage { this.scroller.scrollPage({ next: true }) }) .friction(this.friction) - .key(Grid_GridFriction) + .key('Grid_GridFriction') }.width('100%').margin({ top: 5 }) } } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/List/List_attribute/ListFrictionPage.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/List/List_attribute/ListFrictionPage.ets index 34fc56687a919e808233369fcd4c1c3aeb9c9e51..be19600db8fb5997300213d716096d81539f6e47 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/List/List_attribute/ListFrictionPage.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/List/List_attribute/ListFrictionPage.ets @@ -57,7 +57,7 @@ struct ListFrictionPage { }) .width('90%') .friction(this.friction) - .key(List_ListFriction) + .key('List_ListFriction') } .width('100%') .height('100%') diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage.ets index 9aabfdd9a8d962c4708e1200ccd65c73df9d826c..5b8c33c664a5ff440348d7fe03c6e499e76cd90e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage.ets @@ -66,7 +66,7 @@ struct ScrollFrictionPage { console.info('Scroll Stop') }) .friction(this.friction) - .key(Scroll_ScrollFriction) + .key('Scroll_ScrollFriction') }.width('100%').height('100%').backgroundColor(0xDCDCDC) } } \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage.ets index 915eb418b5ab586824321b04a7c1892bc2652b1a..3461a374a40d7c5a85ff249ba675260700a5cfce 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage.ets @@ -26,6 +26,7 @@ struct WaterFlowFrictionPage { datasource: WaterFlowDataSource = new WaterFlowDataSource() private itemWidthArray: number[] = [] private itemHeightArray: number[] = [] + @State friction:number = 1000 messageManager:MessageManager = new MessageManager(); onPageShow() { @@ -42,13 +43,11 @@ struct WaterFlowFrictionPage { this.messageManager.registerCallback(callback); } - // 计算flow item宽/高 getSize() { let ret = Math.floor(Math.random() * this.maxSize) return (ret > this.minSize ? ret : this.minSize) } - // 保存flow item宽/高 getItemSizeArray() { for (let i = 0; i < 100; i++) { this.itemWidthArray.push(this.getSize()) @@ -110,7 +109,7 @@ struct WaterFlowFrictionPage { .height('80%') .layoutDirection(FlexDirection.Column) .friction(this.friction) - .key(WaterFlow_WaterFlowFriction) + .key('WaterFlow_WaterFlowFriction') } } } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets index 7234788057ab863adb4f236bedd33ca895e752e0..df4897485c22677de6ede13f24b83a107f7f682b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/List.test.ets @@ -369,7 +369,7 @@ import Row_Size from './Row/parentComponentChanged/Row_Size.test'; import Row_VerticalAlign from './Row/parentComponentChanged/Row_VerticalAlign.test'; import list_ListFrictionTest from './List/List_attribute/List_ListFriction.test'; import grid_GridFrictionTest from './Grid/Grid_attribute/Grid_GridFriction.test'; -import waterflow_WaterFlowFrictionTest from './WaterFlow/WaterFlow_attribute/Waterflow_WaterFlowFriction.test'; +import waterflow_WaterFlowFrictionTest from './WaterFlow/WaterFlow_attribute/WaterFlow_WaterFlowFriction.test'; import scroll_ScrollFrictionTest from './Scroll/Scroll_attribute/Scroll_ScrollFriction.test'; import AlignContentFlex_Start from './Flex/alignContent/Start/AlignContentFlex_Start.test.ets'; 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 8edb9b85089ebebd457395606fe2f2985ef416ca..5cb9580d4acb96480774c3de5df5ce1b1d8d5d46 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 @@ -17,62 +17,62 @@ 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'; -export default function Waterflow_WaterflowFrictionTest() { - describe('Waterflow_WaterflowFrictionTest', function () { +export default function WaterFlow_WaterFlowFrictionTest() { + describe('WaterFlow_WaterFlowFrictionTest', function () { beforeEach(async function (done) { - console.info("Waterflow_WaterflowFrictionTest beforeEach start"); + console.info("WaterFlow_WaterFlowFrictionTest beforeEach start"); let options = { - url: 'MainAbility/pages/Waterflow/Waterflow_attribute/WaterflowFrictionPage', + 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 Waterflow_WaterflowInitialIndex1 pages.name:" + JSON.stringify(pages.name)); + console.info("get WaterFlow_WaterFlowFrictionTest state pages:" + JSON.stringify(pages)); + if (!("WaterFlow_WaterFlowFrictionTest" == 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 WaterFlow_WaterFlowFrictionTest page result:" + JSON.stringify(result)); } } catch (err) { - console.error("push Waterflow_WaterflowFrictionTest page error:" + err); + console.error("push WaterFlow_WaterFlowFrictionTest page error:" + err); } - console.info("Waterflow_WaterflowFrictionTest beforeEach end"); + console.info("WaterFlow_WaterFlowFrictionTest beforeEach end"); done(); }); afterEach(async function () { await CommonFunc.sleep(1000); - console.info("Waterflow_WaterflowFrictionTest after each called"); + console.info("WaterFlow_WaterFlowFrictionTest after each called"); }); /** * @tc.number SUB_ACE_WATERFLOW_WATERFLOWFRICTION_001 - * @tc.name testWaterflowFriction + * @tc.name testWaterFlowFriction * @tc.desc set friction to -1 */ - it('testWaterflowFriction', 0, async function (done) { - console.info('[testWaterflowFriction] START'); + it('testWaterFlowFriction', 0, async function (done) { + console.info('[testWaterFlowFriction] START'); globalThis.value.message.notify({name:'friction', value:-1}) - let scrollContainerStrJson = getInspectorByKey('Waterflow_WaterflowFriction'); + let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); - expect(scrollContainerObj.$type).assertEqual('Waterflow'); + expect(scrollContainerObj.$type).assertEqual('WaterFlow'); expect(scrollContainerObj.$friction).assertEqual(0.6); - console.info('[testWaterflowFriction] END'); + console.info('[testWaterFlowFriction] END'); done(); }); /** * @tc.number SUB_ACE_WATERFLOW_WATERFLOWFRICTION_002 - * @tc.name testWaterflowFriction + * @tc.name testWaterFlowFriction * @tc.desc set friction to 10 */ - it('testWaterflowFriction', 0, async function (done) { - console.info('[testWaterflowFriction] START'); + it('testWaterFlowFriction', 0, async function (done) { + console.info('[testWaterFlowFriction] START'); globalThis.value.message.notify({name:'friction', value:10}) - let scrollContainerStrJson = getInspectorByKey('Waterflow_WaterflowFriction'); + let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction'); let scrollContainerObj = JSON.parse(scrollContainerStrJson); - expect(scrollContainerObj.$type).assertEqual('Waterflow'); + expect(scrollContainerObj.$type).assertEqual('WaterFlow'); expect(scrollContainerObj.$friction).assertEqual(10); - console.info('[testWaterflowFriction] END'); + console.info('[testWaterFlowFriction] END'); done(); }); })