From 58c8e42021a95d56fa62b4247e1da58a647c8c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9D=E8=BF=AA?= Date: Mon, 6 Jan 2025 14:25:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?navigation=20pr=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ArkUITPdatabaseUpGradeTests.test.ets | 88 + ...ComponentNavNavigationActionTests.test.ets | 83 + ...ComponentNavNavigationActiveTests.test.ets | 606 ++++ .../ComponentNavNavigationBackTests.test.ets | 310 ++ ...onentNavNavigationCapabilityTests.test.ets | 227 ++ .../ComponentNavNavigationDialog.test.ets | 239 ++ ...ponentNavNavigationExpandSafeArea.test.ets | 301 ++ ...onentNavNavigationHideNavBarTests.test.ets | 149 + ...ponentNavNavigationInterfaceTests.test.ets | 196 ++ ...ComponentNavNavigationLayoutTests.test.ets | 314 +++ .../ComponentNavNavigationPageInfo.test.ets | 1385 +++++++++ .../ComponentNavNavigationPushTests.test.ets | 468 +++ ...onentNavNavigationRemovePageTests.test.ets | 604 ++++ ...NavNavigationRouterInterceptTests.test.ets | 69 + ...ComponentNavNavigationRouterTests.test.ets | 479 ++++ ...mponentNavNavigationSafeZoneTests.test.ets | 694 +++++ ...omponentNavNavigationTestCaseTest.test.ets | 938 ++++++ ...entNavNavigationTitleBarBlurTests.test.ets | 1080 +++++++ ...omponentNavNavigationToolBarTests.test.ets | 1077 +++++++ .../entry/src/ohosTest/ets/test/List.test.ets | 54 + ...tributeFontInterfaceNavigation001.test.ets | 281 ++ ...tributeFontInterfaceNavigation002.test.ets | 315 +++ ...tributeFontInterfaceNavigation003.test.ets | 446 +++ ...avigationMenubarAvoidInterface001.test.ets | 2509 +++++++++++++++++ .../src/ohosTest/ets/test/model/Settings.ets | 8 +- .../src/ohosTest/ets/test/model/Utils.ets | 66 + .../ArkUITPdatabaseUpGrade0200.ets | 134 + .../ComponentNavNavigationAction0850.ets | 395 +++ .../ComponentNavNavigationAction1030.ets | 395 +++ .../ComponentNavNavigationActive0010.ets | 171 ++ .../ComponentNavNavigationActive0020.ets | 171 ++ .../ComponentNavNavigationActive0030.ets | 171 ++ .../ComponentNavNavigationActive0040.ets | 171 ++ .../ComponentNavNavigationActive0050.ets | 44 + .../ComponentNavNavigationActive0060.ets | 44 + .../ComponentNavNavigationActive0070.ets | 104 + .../ComponentNavNavigationActive0080.ets | 104 + .../ComponentNavNavigationActive0090.ets | 77 + .../ComponentNavNavigationActive0100.ets | 77 + .../ComponentNavNavigationActive/Details.ets | 46 + .../ComponentNavNavigationActive/Details1.ets | 46 + .../ComponentNavNavigationBack0110.ets | 99 + .../ComponentNavNavigationBack0150.ets | 106 + .../ComponentNavNavigationBack0160.ets | 106 + .../ComponentNavNavigationBack0170.ets | 106 + .../ComponentNavNavigationBack0180.ets | 106 + .../ComponentNavNavigationBack0240.ets | 106 + .../ComponentNavNavigationBack0250.ets | 106 + .../ComponentNavNavigationBack0260.ets | 106 + .../ComponentNavNavigationBack0270.ets | 106 + .../ComponentNavNavigationCapability0010.ets | 64 + .../ComponentNavNavigationCapability0020.ets | 64 + .../ComponentNavNavigationCapability0030.ets | 64 + .../ComponentNavNavigationCapability0040.ets | 65 + .../ComponentNavNavigationCapability0050.ets | 65 + .../ComponentNavNavigationCapability0060.ets | 37 + .../ComponentNavNavigationCapability0070.ets | 37 + .../ComponentNavNavigationCapability0080.ets | 66 + .../ComponentNavNavigationCapability0160.ets | 71 + .../ComponentNavNavigationDialog.ets | 299 ++ ...mponentNavNavigationExpandSafeArea0010.ets | 109 + ...mponentNavNavigationExpandSafeArea0020.ets | 332 +++ ...mponentNavNavigationExpandSafeAreaMain.ets | 58 + .../ComponentNavNavigationHideNavBar0040.ets | 73 + .../ComponentNavNavigationHideNavBar0130.ets | 25 + .../ComponentNavNavigationHideNavBar0140.ets | 20 + .../ComponentNavNavigationHideNavBar0150.ets | 24 + .../ComponentNavNavigationHideNavBar0160.ets | 176 ++ .../ComponentNavNavigationInterface0010.ets | 33 + .../ComponentNavNavigationInterface0020.ets | 33 + .../ComponentNavNavigationInterface0030.ets | 34 + .../ComponentNavNavigationInterface0670.ets | 87 + .../ComponentNavNavigationInterface0710.ets | 38 + .../ComponentNavNavigationInterface0720.ets | 52 + .../ComponentNavNavigationInterface0730.ets | 32 + .../ComponentNavNavigationInterface0740.ets | 32 + .../ComponentNavNavigationInterface0750.ets | 73 + .../ComponentNavNavigationLayout0010.ets | 86 + .../ComponentNavNavigationLayout0020.ets | 86 + .../ComponentNavNavigationLayout0030.ets | 92 + .../ComponentNavNavigationLayout0040.ets | 33 + .../ComponentNavNavigationLayout0050.ets | 33 + .../ComponentNavNavigationLayout0060.ets | 41 + .../ComponentNavNavigationLayout0070.ets | 42 + .../ComponentNavNavigationLayout0080.ets | 42 + .../ComponentNavNavigationLayout0090.ets | 42 + .../ComponentNavNavigationLayout0100.ets | 79 + .../ComponentNavNavigationLayout0110.ets | 33 + .../ComponentNavNavigationLayout0120.ets | 33 + .../ComponentNavNavigationLayout0130.ets | 79 + .../ComponentNavNavigationLayout0140.ets | 67 + .../ComponentNavNavigationLayout0150.ets | 81 + .../ComponentNavNavigationLayout0160.ets | 45 + .../ComponentNavNavigationLayout0170.ets | 42 + .../ComponentNavNavigationLayout0180.ets | 79 + .../ComponentNavNavigationPageInfoMain.ets | 58 + .../PageOne.ets | 88 + .../PageTwo.ets | 85 + .../ComponentNavNavigationPageInfo/test1.ets | 234 ++ .../ComponentNavNavigationPageInfo/test2.ets | 233 ++ .../ComponentNavNavigationPageInfo/test3.ets | 234 ++ .../ComponentNavNavigationPush001.ets | 73 + .../ComponentNavNavigationPush003.ets | 100 + .../ComponentNavNavigationPush004.ets | 74 + .../ComponentNavNavigationPush005.ets | 100 + .../ComponentNavNavigationPush006.ets | 100 + .../ComponentNavNavigationPush007.ets | 74 + .../ComponentNavNavigationPush008.ets | 74 + .../ComponentNavNavigationPush009.ets | 100 + .../ComponentNavNavigationPush010.ets | 163 ++ .../ComponentNavNavigationPush011.ets | 74 + .../ComponentNavNavigationPush012.ets | 74 + .../ComponentNavNavigationPush013.ets | 74 + .../ComponentNavNavigationRemovePage0100.ets | 394 +++ .../ComponentNavNavigationRemovePage0110.ets | 386 +++ .../ComponentNavNavigationRemovePage0120.ets | 386 +++ .../ComponentNavNavigationRemovePage0130.ets | 394 +++ .../ComponentNavNavigationRemovePage0170.ets | 388 +++ .../ComponentNavNavigationRemovePage0210.ets | 388 +++ .../ComponentNavNavigationRemovePage0220.ets | 394 +++ .../ComponentNavNavigationRemovePage0260.ets | 395 +++ .../ComponentNavNavigationRemovePage0270.ets | 387 +++ .../ComponentNavNavigationRemovePage0280.ets | 390 +++ .../CustomNavigationUtils.ts | 41 + .../pageOne.ets | 74 + .../pageThree.ets | 80 + .../pageTwo.ets | 73 + ...mponentNavNavigationRouterIntercept022.ets | 135 + .../pageOne.ets | 99 + .../pageThree.ets | 45 + .../pageTwo.ets | 105 + .../ComponentNavNavigationRouter0020.ets | 504 ++++ .../ComponentNavNavigationRouter0470.ets | 64 + .../ComponentNavNavigationRouter0480.ets | 64 + .../ComponentNavNavigationSafeZone0020.ets | 153 + .../ComponentNavNavigationSafeZone0030.ets | 152 + .../ComponentNavNavigationSafeZone0040.ets | 146 + .../ComponentNavNavigationSafeZone0060.ets | 190 ++ .../ComponentNavNavigationSafeZone0070.ets | 177 ++ .../ComponentNavNavigationSafeZone0080.ets | 172 ++ .../ComponentNavNavigationSafeZone0090.ets | 166 ++ .../ComponentNavNavigationSafeZone0100.ets | 153 + .../ComponentNavNavigationSafeZone0110.ets | 160 ++ .../ComponentNavNavigationSafeZone0120.ets | 217 ++ .../ComponentNavNavigationSafeZone0140.ets | 204 ++ .../ComponentNavNavigationSafeZone0150.ets | 118 + .../ComponentNavNavigationSafeZone0160.ets | 88 + .../ComponentNavNavigationSafeZone0170.ets | 86 + .../ComponentNavNavigationSafeZone0180.ets | 160 ++ .../ComponentNavNavigationSafeZone0190.ets | 145 + .../ComponentNavNavigationSafeZone0200.ets | 144 + .../ComponentNavNavigationSafeZone0210.ets | 160 ++ .../PageOne.ets | 116 + .../PageTwo.ets | 65 + ...ComponentNavNavigationTitleBarBlur0010.ets | 113 + ...ComponentNavNavigationTitleBarBlur0020.ets | 113 + ...ComponentNavNavigationTitleBarBlur0030.ets | 119 + ...ComponentNavNavigationTitleBarBlur0040.ets | 123 + ...ComponentNavNavigationTitleBarBlur0050.ets | 123 + ...ComponentNavNavigationTitleBarBlur0060.ets | 123 + ...ComponentNavNavigationTitleBarBlur0070.ets | 123 + ...ComponentNavNavigationTitleBarBlur0080.ets | 123 + ...ComponentNavNavigationTitleBarBlur0090.ets | 143 + ...ComponentNavNavigationTitleBarBlur0100.ets | 123 + ...ComponentNavNavigationTitleBarBlur0110.ets | 123 + ...ComponentNavNavigationTitleBarBlur0120.ets | 123 + ...ComponentNavNavigationTitleBarBlur0130.ets | 123 + ...ComponentNavNavigationTitleBarBlur0140.ets | 123 + ...ComponentNavNavigationTitleBarBlur0150.ets | 123 + ...ComponentNavNavigationTitleBarBlur0160.ets | 123 + ...ComponentNavNavigationTitleBarBlur0170.ets | 123 + ...ComponentNavNavigationTitleBarBlur0180.ets | 123 + ...ComponentNavNavigationTitleBarBlur0190.ets | 123 + ...ComponentNavNavigationTitleBarBlur0200.ets | 123 + ...ComponentNavNavigationTitleBarBlur0210.ets | 123 + ...ComponentNavNavigationTitleBarBlur0220.ets | 114 + .../ComponentNavNavigationToolBar0010.ets | 110 + .../ComponentNavNavigationToolBar0020.ets | 110 + .../ComponentNavNavigationToolBar0030.ets | 119 + .../ComponentNavNavigationToolBar0040.ets | 120 + .../ComponentNavNavigationToolBar0050.ets | 119 + .../ComponentNavNavigationToolBar0060.ets | 119 + .../ComponentNavNavigationToolBar0070.ets | 119 + .../ComponentNavNavigationToolBar0080.ets | 119 + .../ComponentNavNavigationToolBar0090.ets | 137 + .../ComponentNavNavigationToolBar0100.ets | 119 + .../ComponentNavNavigationToolBar0110.ets | 119 + .../ComponentNavNavigationToolBar0120.ets | 119 + .../ComponentNavNavigationToolBar0130.ets | 119 + .../ComponentNavNavigationToolBar0140.ets | 115 + .../ComponentNavNavigationToolBar0150.ets | 119 + .../ComponentNavNavigationToolBar0160.ets | 119 + .../ComponentNavNavigationToolBar0170.ets | 119 + .../ComponentNavNavigationToolBar0180.ets | 119 + .../ComponentNavNavigationToolBar0190.ets | 119 + .../ComponentNavNavigationToolBar0200.ets | 119 + .../ComponentNavNavigationToolBar0210.ets | 119 + .../ComponentNavNavigationToolBar0250.ets | 457 +++ .../PageOne.ets | 115 + .../PageTwo.ets | 64 + .../ComponentNavigationTestCase027.ets | 176 ++ .../ComponentNavigationTestCase036.ets | 152 + .../ComponentNavigationTestCase097.ets | 170 ++ .../ComponentNavigationTestCase0df.ets | 149 + .../ComponentNavigationTestCase27c.ets | 186 ++ .../ComponentNavigationTestCase388.ets | 170 ++ .../ComponentNavigationTestCase421.ets | 152 + .../ComponentNavigationTestCase59a.ets | 163 ++ .../ComponentNavigationTestCase5b3.ets | 176 ++ .../ComponentNavigationTestCase899.ets | 170 ++ .../ComponentNavigationTestCaseb25.ets | 176 ++ .../ComponentNavigationTestCaseb52.ets | 176 ++ .../ComponentNavigationTestCasecdd.ets | 170 ++ .../ComponentNavigationTestCased4d.ets | 170 ++ .../ComponentNavigationTestCased8a.ets | 177 ++ .../ComponentNavigationTestCasedc8.ets | 170 ++ .../ComponentNavigationTestCasef45.ets | 176 ++ .../ComponentNavigationTestCase/pageOne.ets | 101 + .../ComponentNavigationTestCase/pageThree.ets | 46 + .../ComponentNavigationTestCase/pageTwo.ets | 152 + ...UIAttributeFontInterfaceNavigation0010.ets | 65 + ...UIAttributeFontInterfaceNavigation0011.ets | 318 +++ .../UIAttributeFontInterfaceNavigation002.ets | 511 ++++ .../UIAttributeFontInterfaceNavigation003.ets | 627 ++++ .../UIAttributeFontInterfaceNavigation005.ets | 64 + .../UIAttributeFontInterfaceNavigation006.ets | 61 + .../UIAttributeFontInterfaceNavigation007.ets | 57 + .../UIAttributeFontInterfaceNavigation008.ets | 66 + .../UIAttributeFontInterfaceNavigation009.ets | 57 + ...UIAttributeFontInterfaceNavigation0280.ets | 318 +++ .../MyParam.ets | 4 + .../PageOne.ets | 61 + .../PageThree.ets | 66 + .../PageThree_Long.ets | 77 + .../PageTwo.ets | 98 + ...nentNavigationMenubarAvoidInterface001.ets | 121 + ...nentNavigationMenubarAvoidInterface002.ets | 122 + ...nentNavigationMenubarAvoidInterface003.ets | 119 + ...nentNavigationMenubarAvoidInterface004.ets | 119 + ...nentNavigationMenubarAvoidInterface005.ets | 119 + ...nentNavigationMenubarAvoidInterface006.ets | 119 + ...nentNavigationMenubarAvoidInterface007.ets | 119 + ...nentNavigationMenubarAvoidInterface008.ets | 121 + ...nentNavigationMenubarAvoidInterface009.ets | 117 + ...nentNavigationMenubarAvoidInterface010.ets | 140 + ...nentNavigationMenubarAvoidInterface011.ets | 148 + ...nentNavigationMenubarAvoidInterface012.ets | 146 + ...nentNavigationMenubarAvoidInterface013.ets | 143 + ...nentNavigationMenubarAvoidInterface014.ets | 134 + ...nentNavigationMenubarAvoidInterface015.ets | 151 + ...nentNavigationMenubarAvoidInterface017.ets | 159 ++ ...nentNavigationMenubarAvoidInterface018.ets | 159 ++ ...nentNavigationMenubarAvoidInterface020.ets | 147 + ...nentNavigationMenubarAvoidInterface021.ets | 155 + ...nentNavigationMenubarAvoidInterface022.ets | 136 + ...nentNavigationMenubarAvoidInterface023.ets | 136 + ...nentNavigationMenubarAvoidInterface024.ets | 63 + ...nentNavigationMenubarAvoidInterface025.ets | 69 + ...nentNavigationMenubarAvoidInterface028.ets | 130 + ...nentNavigationMenubarAvoidInterface029.ets | 156 + ...nentNavigationMenubarAvoidInterface030.ets | 159 ++ ...nentNavigationMenubarAvoidInterface031.ets | 151 + ...nentNavigationMenubarAvoidInterface032.ets | 129 + ...nentNavigationMenubarAvoidInterface033.ets | 121 + ...nentNavigationMenubarAvoidInterface034.ets | 121 + ...nentNavigationMenubarAvoidInterface035.ets | 121 + .../resources/base/element/string.json | 28 + .../src/ohosTest/resources/base/media/add.png | Bin 0 -> 334 bytes .../ohosTest/resources/base/media/eidt.png | Bin 0 -> 845 bytes .../resources/base/media/star_gray.png | Bin 0 -> 1887 bytes .../resources/base/media/star_selected.png | Bin 0 -> 2046 bytes .../resources/base/profile/test_pages.json | 224 +- 272 files changed, 45101 insertions(+), 5 deletions(-) create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITPdatabaseUpGradeTest/ArkUITPdatabaseUpGradeTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActionTest/ComponentNavNavigationActionTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActive/ComponentNavNavigationActiveTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationBackTest/ComponentNavNavigationBackTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapabilityTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationDialogTest/ComponentNavNavigationDialog.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationExpandSafeAreaTest/ComponentNavNavigationExpandSafeArea.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBarTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterfaceTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayoutTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPageInfoTest/ComponentNavNavigationPageInfo.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPushTest/ComponentNavNavigationPushTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePageTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterInterceptTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterTest/ComponentNavNavigationRouterTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZoneTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTestCaseTest/ComponentNavNavigationTestCaseTest.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlurTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBarTests.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation002.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation003.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationMenubarAvoidInterfaceTest/UIComponentNavigationMenubarAvoidInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction0850.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction1030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeAreaMain.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0670.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0710.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0720.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0730.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0740.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0750.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0260.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0280.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/CustomNavigationUtils.ts create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageThree.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterIntercept022.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageThree.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0470.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0480.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0250.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase27c.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase59a.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase899.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased8a.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageThree.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0280.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/MyParam.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageOne.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree_Long.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageTwo.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface022.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface023.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface024.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface028.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface029.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/add.png create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/eidt.png create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/star_gray.png create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/star_selected.png diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITPdatabaseUpGradeTest/ArkUITPdatabaseUpGradeTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITPdatabaseUpGradeTest/ArkUITPdatabaseUpGradeTests.test.ets new file mode 100755 index 000000000..c13c79ab5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITPdatabaseUpGradeTest/ArkUITPdatabaseUpGradeTests.test.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ArkUITPdatabaseUpGradeTests() { + + describe('ArkUITPdatabaseUpGradeTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_0200 + * @tc.name : SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_0200 + * @tc.desc : Navigation组件,路由跳转 + */ + it('SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_0200 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200') + await Utils.sleep(500); + let button = await driver.findComponent(ON.id('ArkUITPdatabaseUpGrade0200_button_01')); + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await driver.pressBack() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_01 + * @tc.name : SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_01 + * @tc.desc : Navigation组件,路由跳转 + */ + it('SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_01 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200') + await Utils.sleep(500); + let button = await driver.findComponent(ON.id('ArkUITPdatabaseUpGrade0200_button_01')); + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await driver.pressBack() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ARKUIX_TPDATABASEUPGRADE_01.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActionTest/ComponentNavNavigationActionTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActionTest/ComponentNavNavigationActionTests.test.ets new file mode 100755 index 000000000..292d6845c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActionTest/ComponentNavNavigationActionTests.test.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationActionTests() { + + describe('ComponentNavNavigationActionTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030 + * @tc.desc : Navigation组件,push页面后isActivated回调生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction1030') + await Utils.sleep(1000); + driver.click(1170, 1160) + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0850 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0850 + * @tc.desc : Navigation组件,下拉页面的同时,删除主标题,回弹后,输入主标题,主副标题位置正确 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0850 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction0850') + await Utils.sleep(2000); + let pushPageOne = await driver.findComponent(ON.id('list')); + let bounds = await pushPageOne.getBounds() + await Utils.sleep(100); + await driver.swipe(bounds.left + 100, bounds.top + 50, bounds.left + 100, bounds.top + 400, 200) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0850.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActive/ComponentNavNavigationActiveTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActive/ComponentNavNavigationActiveTests.test.ets new file mode 100755 index 000000000..a34180378 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationActive/ComponentNavNavigationActiveTests.test.ets @@ -0,0 +1,606 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' + +export default function ComponentNavNavigationActiveTests() { + + describe('ComponentNavNavigationActiveTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0010_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0020_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0030_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.text('Next Page')); + await pushNext1.click(); + await Utils.sleep(1000); + let pushNext2 = await driver.findComponent(ON.text('Next Page1')); + await pushNext2.click(); + await Utils.sleep(1000); + let pushNext3 = await driver.findComponent(ON.text('Next Page2')); + await pushNext3.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0040_1.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.id('Details')); + await pushNext1.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050_1 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050_1 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.id('Details')); + await pushNext1.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0050_1.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.id('Details')); + await pushNext1.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060_1 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060_1 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let pushNext1 = await driver.findComponent(ON.id('Details')); + await pushNext1.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(1000); + let back = await driver.findComponent(ON.id('back')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0060_1.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0070 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0070 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0070 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0070') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let index1 = await driver.findComponent(ON.text('index1')); + await index1.click(); + await Utils.sleep(1000); + let index2 = await driver.findComponent(ON.text('index2')); + await index2.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0070.`); + done(); + }) + /* +* @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0080 +* @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0080 +* @tc.desc : back +*/ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0080 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0080') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let index1 = await driver.findComponent(ON.text('index1')); + await index1.click(); + await Utils.sleep(1000); + let index2 = await driver.findComponent(ON.text('index2')); + await index2.click(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('change')); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0080.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_1 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_1.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_1.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_2 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_2.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(1000); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_2.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_3 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_3 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_3.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(1000); + await change.click(); + await Utils.sleep(1000); + await showSideBar.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0090_3.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_1 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_1.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_1.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_2 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_2.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(1000); + await change.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_2.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_3 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_3 + * @tc.desc back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_3.`); + Settings.createWindow('testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100'); + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id("change")); + await change.click(); + await Utils.sleep(1000); + let showSideBar = await driver.findComponent(ON.id("show")); + await showSideBar.click(); + await Utils.sleep(1000); + await change.click(); + await Utils.sleep(1000); + await showSideBar.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTIVE_0100_3.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationBackTest/ComponentNavNavigationBackTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationBackTest/ComponentNavNavigationBackTests.test.ets new file mode 100755 index 000000000..143a18346 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationBackTest/ComponentNavNavigationBackTests.test.ets @@ -0,0 +1,310 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' + +export default function ComponentNavNavigationBackTests() { + + describe('ComponentNavNavigationBackTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageTwo')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0110_1.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0150 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0150 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0150') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0150.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0160 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0160 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0160') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0160.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0170 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0170 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0170') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0170.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0180 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0180 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0180') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0180.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageTwo')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0240_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageTwo')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0250_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageTwo')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0260_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageOne')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270_1 + * @tc.desc : back + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270') + await Utils.sleep(2000); + let driver = Driver.create(); + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pageTwo')); + await push.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_BACK_0270_1.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapabilityTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapabilityTests.test.ets new file mode 100755 index 000000000..1266c437c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapabilityTests.test.ets @@ -0,0 +1,227 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationCapabilityTests() { + + describe('ComponentNavNavigationCapabilityTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0010 + * @tc.desc : 手势拖动窗口改变组件大小 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0010 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0010') + await Utils.sleep(200); + await driver.drag(1000, 300, 1500, 300, 1500); + await Utils.sleep(200) + await driver.drag(1500, 300, 1200, 300, 1500); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0010.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0020 + * @tc.desc : 鼠标拖动窗口改变组件大小 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0020 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0020') + await Utils.sleep(500); + await driver.mouseDrag({x:950,y:600},{x:1400,y:600},1500); + await Utils.sleep(200); + await driver.mouseDrag({x:1195,y:600},{x:900,y:600},1500); + await Utils.sleep(200) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0030 + * @tc.desc : 触摸板拖动窗口改变组件大小 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0030 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0030') + await Utils.sleep(500); + await driver.drag(1000, 300, 1500, 300, 1500); + await Utils.sleep(200) + await driver.drag(1500, 300, 1200, 300, 1500); + await Utils.sleep(200) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0040 + * @tc.desc : 设置导航栏最小宽度与最大宽度正常值测试 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0040 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0040') + await Utils.sleep(500); + await driver.drag(820, 600, 1400, 600, 1500); + await Utils.sleep(200); + await driver.drag(1270, 600, 900, 600, 1500); + await Utils.sleep(200); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0050 + * @tc.desc : 设置导航栏最小宽度与最大宽度为(300,300) + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0050 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0050') + await Utils.sleep(500); + await driver.drag(945, 300, 1400, 300, 1500); + await Utils.sleep(200); + await driver.drag(945, 300, 900, 300, 1500); + await Utils.sleep(200); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0050.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0060 + * @tc.desc : 设置导航栏最小宽度与最大宽度为(300,200) + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0060 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0060') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0070 + * @tc.desc : 设置导航栏最小宽度与最大宽度为(-2,400) + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0070 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0070') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0080 + * @tc.desc : 设置导航栏最小宽度与最大宽度为(280,400) + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0080 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0080') + await driver.drag(940, 300, 1400, 300, 1500); + await Utils.sleep(200); + await driver.drag(1260, 300, 1000, 300, 1500); + await Utils.sleep(200); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0160 + * @tc.desc : 鼠标拖动分割线 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0160 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0160') + await driver.mouseDrag({x:940,y:600},{x:1400,y:600},1500); + await Utils.sleep(200); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CAPABILITY_0160.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationDialogTest/ComponentNavNavigationDialog.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationDialogTest/ComponentNavNavigationDialog.test.ets new file mode 100755 index 000000000..ae161f26d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationDialogTest/ComponentNavNavigationDialog.test.ets @@ -0,0 +1,239 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, On } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' + +export default function ComponentNavNavigationDialog() { + + describe('ComponentNavNavigationDialog', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn2')); + await btn2.click(); + await Utils.sleep(1000); + await Utils.homeAndBackWithScreenlock(driver); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0140_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0160 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0160 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn3')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('dialog_btn4')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0160.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0170 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0170 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn3')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('dialog_btn5')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0170.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0180 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0180 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('dialog_btn6')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0180.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0260 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0260 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0260 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('dialog_btn')); + await btn.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn3')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('dialog_btn5')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0260.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0270 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0270 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('dialog_btn')); + await btn.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('dialog_btn2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('dialog_btn1')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('dialog_btn6')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_DIALOG_0270.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationExpandSafeAreaTest/ComponentNavNavigationExpandSafeArea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationExpandSafeAreaTest/ComponentNavNavigationExpandSafeArea.test.ets new file mode 100755 index 000000000..b7505ea1f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationExpandSafeAreaTest/ComponentNavNavigationExpandSafeArea.test.ets @@ -0,0 +1,301 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, On } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' + +export default function ComponentNavNavigationExpandSafeArea() { + + describe('ComponentNavNavigationExpandSafeArea', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0010 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0010 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0010.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0020 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0020 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0020.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0030 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0030 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn3')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0030.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0040 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0040 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn4')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0040.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0050 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0050 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn5')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0050.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0060 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0060 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('exp_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0060.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0070 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0070 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0070.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0080 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0080 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0080.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0090 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0090 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0090.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0100 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0100 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0100.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0110 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0110 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0110.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0120 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0120 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + // + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0120.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0130 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0130 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0130.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0140 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0140 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('exp_btn6')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('exp_btn7')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('exp_btn8')); + await btn3.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_EXPANDSAFEAREA_0140.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBarTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBarTests.test.ets new file mode 100755 index 000000000..b8911814c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBarTests.test.ets @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, On } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' + +export default function ComponentNavNavigationHideNavBarTests() { + + describe('ComponentNavNavigationHideNavBarTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0040 + * @tc.desc : navigation,hideNavBar为true,NavigationMode为auto双栏模式,动态改变hideNavBar为false模式 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0040 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0040') + await Utils.sleep(4500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0130 + * @tc.desc : navigation,hideNavBar为true,使用NavPathStack但内容为空 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0130 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0130') + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140 + * @tc.desc : navigation,hideNavBar为true,未使用NavPathStack + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0140') + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0150 + * @tc.desc : navigation,hideNavBar为true,未使用NavPathStack + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0140 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0150') + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0150.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0170 + * @tc.desc : navigation:test onBackPressed + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0170 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('Next Page')); + await btn1.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0170.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0210 + * @tc.desc : navigation:test onBackPressed + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0210 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('Next Page')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('Next Page')); + await btn2.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_HIDENAVBAR_0210.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterfaceTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterfaceTests.test.ets new file mode 100755 index 000000000..5fd60d892 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterfaceTests.test.ets @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationInterfaceTests() { + + describe('ComponentNavNavigationInterfaceTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0010 + * @tc.desc : NavDestination不设置hideTitleBar,默认false,显示标题栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0010 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0010') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0010.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0020 + * @tc.desc : NavDestination的hideTitleBar设置false,显示标题栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0020 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0020') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0030 + * @tc.desc : NavDestination的hideTitleBar设置true,隐藏标题栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0030 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0030') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0670 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0670 + * @tc.desc : onShown事件 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0670 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0670') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(5000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0670.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0710 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0710 + * @tc.desc : title页面标题参数类型为NavigationCommonTitle,设置成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0710 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0710') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(5000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0710.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0720 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0720 + * @tc.desc : title页面标题参数类型为NavigationCustomTitle,设置成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0720 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0720') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(5000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0720.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0730 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0730 + * @tc.desc : title页面标题参数类型为Resource,设置成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0730 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0730') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(5000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0730.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0740 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0740 + * @tc.desc : title页面标题参数类型为string设置为超长字符串,设置成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0740 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0740') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(5000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0740.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0750 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0750 + * @tc.desc : NavDestination页面title设置string类型 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0750 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0750') + await Utils.sleep(500); + let router = await driver.findComponent(ON.id('router')); + await Utils.sleep(200); + await router.click() + await Utils.sleep(1500); + + let input = await driver.findComponent(ON.id('input')); + await Utils.sleep(200); + input.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_1030.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayoutTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayoutTests.test.ets new file mode 100755 index 000000000..58c69ee56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayoutTests.test.ets @@ -0,0 +1,314 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' +import { window } from '@kit.ArkUI' + +export default function ComponentNavNavigationLayoutTests() { + + describe('ComponentNavNavigationLayoutTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0010 + * @tc.desc : navigation設置Navigation宽度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0010 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0010') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0010.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 + * @tc.desc : navigationNavContent子组件的标题,单栏模式,宽度为Navigation宽度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 + * @tc.desc : navigationNavContent子组件的标题,单栏模式,宽度为Navigation宽度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020') + await Utils.sleep(4000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0030 + * @tc.desc : navigationNavContent子组件的标题,有子标题,高度为82vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0030 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0030') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0030.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0040 + * @tc.desc : navigationNavContent子组件的标题,无子标题,高度为56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0040 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0040') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0060 + * @tc.desc : navigation布局设置NavigationTitleMode Mini,有子标题,高度为82vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0060 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0060') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0070 + * @tc.desc : navigation布局设置NavigationTitleMode.Mini,没有子标题,高度为56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0070 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0070') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0080 + * @tc.desc : navigation布局设置设置NavigationTitleModeFu,有子标题,高度为138vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0080') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090 + * @tc.desc : navigation布局设置设置NavigationTitleMode Full,没有子标题,高度为112vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0090') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0100 + * @tc.desc : navigation布局,NavBar分栏模式,宽度为navBarWidth宽度,高度56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0100 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0100') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0100.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0110 + * @tc.desc : NavBar宽度为navBarWidth默认的宽度,高度56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0110 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0110') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0110.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0120 + * @tc.desc : navigation布局设置Navigation的宽度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0120 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0120') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0130 + * @tc.desc : navigation布局,NavContent分栏模式,宽度为Navigation宽度减去NabBar子组件和1vp分割线,高度为Navigation高度减去NavContent的标题高度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0130 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0130') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0140 + * @tc.desc : navigation布局,NavContent单栏模式,宽度为Navigation宽度,高度为Navigation高度减去NavContent的标题高度 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0140 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0140') + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150 + * @tc.desc : navigation布局,Toolbar分栏模式,宽度为navBarWidth宽度,高度56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0150') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0160 + * @tc.desc : navigation布局,Toolbar分栏模式,宽度为navBarWidth默认的宽度,高度56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0150 start.`); + Settings.changeOrientation() + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0160') + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0170 + * @tc.desc : navigation布局,Toolbar单栏模式,宽度为Navigation的宽度,高度56vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0170 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0170') + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_LAYOUT_0170.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPageInfoTest/ComponentNavNavigationPageInfo.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPageInfoTest/ComponentNavNavigationPageInfo.test.ets new file mode 100755 index 000000000..4078d29fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPageInfoTest/ComponentNavNavigationPageInfo.test.ets @@ -0,0 +1,1385 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, On } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' + +export default function ComponentNavNavigationPageInfo() { + + describe('ComponentNavNavigationPageInfo', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0010_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0020_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0030_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0040 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0040 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pageFour')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0040.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0050 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0050 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pageFour')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0050.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0060 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0060 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pageFour')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0060.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0080_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0090_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0100_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0110_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0120_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0130_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0140_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x, y: point.y + }, true, 3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('pushPathOne_2')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pop')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0150_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn1')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathThree')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0170_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_4 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_4 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_4 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_4.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_5 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_5 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_5', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_5 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_5.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_6 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_6 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_6', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_6 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn3')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.text('clear')); + await btn5.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0180_6.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_1 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_1 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_1 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_1.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_2 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_2 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_2 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_2.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_3 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_3 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_3 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_3.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_4 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_4 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_4 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_4.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_5 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_5 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_5', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_5 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_5.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_6 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_6 + * @tc.desc : navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_6', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_6 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let pageInfoMain_btn1: Component = await driver.findComponent(ON.id('pageInfoMain_btn2')); + await pageInfoMain_btn1.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPath')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop')); + await btn4.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.text('clear')); + await btn5.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PAGEINFO_0190_6.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPushTest/ComponentNavNavigationPushTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPushTest/ComponentNavNavigationPushTests.test.ets new file mode 100755 index 000000000..994147d75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationPushTest/ComponentNavNavigationPushTests.test.ets @@ -0,0 +1,468 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' + +export default function ComponentNavNavigationPushTests() { + + describe('ComponentNavNavigationPushTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push01')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push01')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 + * @tc.desc : 通过pushDestinationByName接口,push页面PageOne,PageOne页面为透明页面push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push04')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 + * @tc.desc : 通过pushDestinationByName接口,push页面PageOne,PageOne页面为透明页面push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push04')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_004.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 + * @tc.desc : 通过pushDestinationByName接口,push页面PageFive,PageFive页面属性visibility为Hidden,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push07')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 + * @tc.desc : 通过pushDestinationByName接口,push页面PageFive,PageFive页面属性visibility为Hidden,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push07')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_007.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008 + * @tc.desc : 通过pushDestinationByName接口,push页面PageFour,PageFour页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push08')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push08')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_008.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 + * @tc.desc : push页面PageFour,PageFour页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push011')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 + * @tc.desc : push页面PageFour,PageFour页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push011')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_011.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push012')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012 + * @tc.desc : push页面PageFive,PageFive页面属性visibility为Hidden,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_001 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push012')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_012.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 + * @tc.desc : push页面PageSix,PageSix页面属性visibility设置为None,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013') + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + let push = await driver.findComponent(ON.id('push013')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 + * @tc.desc : push页面PageSix,PageSix页面属性visibility设置为None,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('push013')); + await Utils.sleep(100); + push.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_013.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_003 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_003 + * @tc.desc : push + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_003', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_003 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush003') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pushPage')); + await push.click() + await Utils.sleep(1000); + let start = await driver.findComponent(ON.id('start')); + await start.click() + await Utils.sleep(1000); + let push1 = await driver.findComponent(ON.id('pushPage')); + await push1.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_003.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_005 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_005 + * @tc.desc : push + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_005', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_005 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush005') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pushPage')); + await push.click() + await Utils.sleep(1000); + let start = await driver.findComponent(ON.id('start')); + await start.click() + await Utils.sleep(1000); + let push1 = await driver.findComponent(ON.id('pushPage')); + await push1.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_005.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_006 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_006 + * @tc.desc : push + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_006', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_006 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush006') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pushPage')); + await push.click() + await Utils.sleep(1000); + let start = await driver.findComponent(ON.id('start')); + await start.click() + await Utils.sleep(1000); + let push1 = await driver.findComponent(ON.id('pushPage')); + await push1.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_006.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_009 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_009 + * @tc.desc : push + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_009', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_009 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush009') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pushPage')); + await push.click() + await Utils.sleep(1000); + let start = await driver.findComponent(ON.id('start')); + await start.click() + await Utils.sleep(1000); + let push1 = await driver.findComponent(ON.id('pushPage')); + await push1.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_009.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_010 + * @tc.desc : push + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_010 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush010') + await Utils.sleep(1000); + let push = await driver.findComponent(ON.id('pushOnePage')); + await push.click() + await Utils.sleep(1000); + let pop = await driver.findComponent(ON.id('pop')); + await pop.click() + await Utils.sleep(1000); + let pushTwoPage = await driver.findComponent(ON.id('pushTwoPage')); + await pushTwoPage.click() + await Utils.sleep(1000); + let start = await driver.findComponent(ON.id('start')); + await start.click() + await Utils.sleep(1000); + let pushThreePage = await driver.findComponent(ON.id('pushThreePage')); + await pushThreePage.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_PUSH_010.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePageTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePageTests.test.ets new file mode 100755 index 000000000..85df3d515 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePageTests.test.ets @@ -0,0 +1,604 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationRemovePageTests() { + + describe('ComponentNavNavigationRemovePageTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0100 + * @tc.desc : navPathStack为空,调用removeByName删除name为pageOne的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0100 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0100') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let inputName = await driver.findComponent(ON.id('inputName')); + await Utils.sleep(100); + await inputName.click() + + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0110 + * @tc.desc : navPathStack为空,调用removeByIndexes删除index为0的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0110 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0110') + await Utils.sleep(2000); + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0120 + * @tc.desc : navPathStack为空,调用removeByIndexes删除索引为0和索引为1的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0120 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0120') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 + * @tc.desc : navPathStack传入2个页面,调用removeByName删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let inputName = await driver.findComponent(ON.id('inputName')); + await Utils.sleep(100); + await inputName.click() + + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 + * @tc.desc : navPathStack传入2个页面,调用removeByName删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('inputName')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + await Utils.sleep(1500); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 + * @tc.desc : navPathStack传入3个页面,调用removeByIndexes删除navPathStack全部的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let pushPageThree = await driver.findComponent(ON.id('pushPageThree')); + await Utils.sleep(100); + await pushPageThree.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 + * @tc.desc : navPathStack传入3个页面,调用removeByIndexes删除navPathStack全部的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let pushPageThree = await driver.findComponent(ON.id('pushPageThree')); + await Utils.sleep(100); + await pushPageThree.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0210 + * @tc.desc : 双栏模式,navPathStack传入3个页面,调用removeByIndexes删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0210') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0210.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0220 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0220 + * @tc.desc : navPathStack传入4个页面,调用removeByName删除navPathStack全部的页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0130 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0220') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + await pushPageOne.click() + + await Utils.sleep(1000); + await pushPageOne.click() + + await Utils.sleep(1000); + await pushPageOne.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('inputName')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + await Utils.sleep(1500); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0220.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0260 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0260 + * @tc.desc : 单栏模式,设置hideNavBar:true,navPathStack传入2个页面,调用removeByName删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0260 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0260') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('inputName')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + await Utils.sleep(1500); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0260.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.desc : 单栏模式,设置hideNavBar:true,navPathStack传入2个页面,调用removeBylndexes删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 start.`); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('showNavigation')); + await Utils.sleep(100); + await pushPath.click() + + await Utils.sleep(1000); + await pushPath.click() + await Utils.sleep(1000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.desc : 单栏模式,设置hideNavBar:true,navPathStack传入2个页面,调用removeBylndexes删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 start.`); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('showNavigation')); + await Utils.sleep(100); + await pushPath.click() + + await Utils.sleep(1000); + await pushPath.click() + await Utils.sleep(1000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 + * @tc.desc : 单栏模式,设置hideNavBar:true,navPathStack传入2个页面,调用removeBylndexes删除首页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('showNavigation')); + await Utils.sleep(100); + await pushPath.click() + + await Utils.sleep(1000); + await pushPath.click() + await Utils.sleep(1000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + let deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + + await Utils.sleep(1000); + let getAllPageName = await driver.findComponent(ON.id('getAllPageName')); + await Utils.sleep(100); + await getAllPageName.click() + + input0 = await driver.findComponent(ON.id('input0')); + await Utils.sleep(100); + await input0.click() + + await Utils.sleep(1000); + deletePageIndex = await driver.findComponent(ON.id('deletePageIndex')); + await Utils.sleep(100); + await deletePageIndex.click() + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0270.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0280 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0280 + * @tc.desc : navPathStack传入2个页面,调用clear清空栈内页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0280 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0280') + await Utils.sleep(2000); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await Utils.sleep(100); + await pushPageOne.click() + + await Utils.sleep(1000); + let pushPageTwo = await driver.findComponent(ON.id('pushPageTwo')); + await Utils.sleep(100); + await pushPageTwo.click() + + await Utils.sleep(1000); + let clearAll = await driver.findComponent(ON.id('clearAll')); + await Utils.sleep(100); + await clearAll.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEPAGE_0280.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterInterceptTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterInterceptTests.test.ets new file mode 100755 index 000000000..d56ac2613 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterInterceptTests.test.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationRouterInterceptTests() { + + describe('ComponentNavNavigationRouterInterceptTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTERINTERCEPT_022 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTERINTERCEPT_022 + * @tc.desc : 关闭系统动画,从navbar页面push一个pageOne页面,再手势右滑回退到navbar页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTERINTERCEPT_022', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTERINTERCEPT_022 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterIntercept022') + await Utils.sleep(2000); + let useAnimation = await driver.findComponent(ON.id('useAnimation')); + await useAnimation.click() + await Utils.sleep(1500); + + let pushPageOne = await driver.findComponent(ON.id('pushPageOne')); + await pushPageOne.click() + await Utils.sleep(1500); + + await driver.swipe(1250,1600,900 ,1600,1500) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTERINTERCEPT_022.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterTest/ComponentNavNavigationRouterTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterTest/ComponentNavNavigationRouterTests.test.ets new file mode 100755 index 000000000..608f83d3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationRouterTest/ComponentNavNavigationRouterTests.test.ets @@ -0,0 +1,479 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, On } from '@kit.TestKit' + +export default function ComponentNavNavigationRouterTests() { + + describe('ComponentNavNavigationRouterTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0020 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0020 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH pageThree')); + await btn1.click(); + await Utils.sleep(1000); + let back: Component = await driver.findComponent(ON.type('BackButton')); + await back.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0020.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0050 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0050 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH pageOne')); + await btn1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0050.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0290 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0290 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0290 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('设置name和param go to pageTwo')); + await btn1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0290.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0320 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0320 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0320 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('getParamByName')); + await btn2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0320.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0330 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0330 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0330 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('getParamByIndex传入index无效')); + await btn1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0330.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0350 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0350 + * @tc.desc : NavigationRouter --- fail + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0350 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('getParamByIndex pageOne')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0350.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0360 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0360 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0360 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('moveIndexToTop 0')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0360.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0370 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0370 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0370 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('moveToTop栈中不存在的页面')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0370.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0380 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0380 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0380 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('movelndexToTop pageOne')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0380.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0390 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0390 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0390 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pop')); + await btn1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0390.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0400 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0400 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0400 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pop')); + await btn2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0400.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0410 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0410 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0410 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('popToName栈中不存在的页面')); + await btn2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0410.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0420 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0420 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0420 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('popToName pageOne')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0420.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0430 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0430 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0430 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('popToIndex 0')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0430.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0440 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0440 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0440 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushDestination pageOne')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0440.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0450 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0450 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0450 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('pushPathByName pageOne')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0450.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0460 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0460 + * @tc.desc : NavigationRouter + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0460 start.`); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020') + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('PUSH_WITH_RECREATE pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('size')); + await btn3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0460.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0480 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0480 + * @tc.desc : 新增命名路由id + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0480 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0480') + await Utils.sleep(500); + let navRouter01 = await driver.findComponent(ON.id('NavRouter02')); + await navRouter01.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0480.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0470 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0470 + * @tc.desc : 单hap场景功能正常 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0470 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0470') + await Utils.sleep(500); + let navRouter01 = await driver.findComponent(ON.id('NavRouter01')); + await navRouter01.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ROUTER_0470.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZoneTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZoneTests.test.ets new file mode 100755 index 000000000..5ec1a9163 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZoneTests.test.ets @@ -0,0 +1,694 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' + +export default function ComponentNavNavigationSafeZoneTests() { + + describe('ComponentNavNavigationSafeZoneTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0020 + * @tc.desc : Navigation内部组件只含有标题栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0020 start.`); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0020') + await Utils.sleep(2000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(2000); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0030 + * @tc.desc : Navigation内部组件只含有工具栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0030 start.`); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0030') + await Utils.sleep(2000); + + let hideTitleBar = await driver.findComponent(ON.id('hideTitleBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(2000); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0040 + * @tc.desc : Navigation内部组件含有工具栏和标题栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0040 start.`); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0040') + await Utils.sleep(2000); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 + * @tc.desc : Navigation高度设置不贴边 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let expandSystemNotSupport = await driver.findComponent(ON.id('expandSystemNotSupport')); + await Utils.sleep(100); + let topBounds = await expandSystemNotSupport.getBounds() + await Utils.sleep(100); + await driver.click(topBounds.right - 10, topBounds.bottom - 10) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 + * @tc.desc : 动态修改expandSafeArea的types和edges参数 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let expandSystemNotSupport = await driver.findComponent(ON.id('expandSystemNotSupport')); + await Utils.sleep(100); + let topBounds = await expandSystemNotSupport.getBounds() + await Utils.sleep(100); + await driver.click(topBounds.right - 10, topBounds.bottom - 10) + + await Utils.sleep(1000); + let expandSystem = await driver.findComponent(ON.id('expandSystem')); + let bottomBounds = await expandSystem.getBounds() + await Utils.sleep(100); + driver.click(bottomBounds.right - 10, bottomBounds.bottom - 10) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070 + * @tc.desc : Navigation高度设置不贴边 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0070') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let counterTop = await driver.findComponent(ON.id('counterTop')); + await Utils.sleep(100); + let topBounds = await counterTop.getBounds() + await Utils.sleep(100); + await driver.click(topBounds.right - 10, topBounds.bottom - 10) + + await Utils.sleep(1000); + let counterBottom = await driver.findComponent(ON.id('counterBottom')); + let bottomBounds = await counterBottom.getBounds() + await Utils.sleep(100); + driver.click(bottomBounds.right - 10, bottomBounds.bottom - 10) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0080 + * @tc.desc : Navigation高度设置不贴边 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0070 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0080') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let counterTop = await driver.findComponent(ON.id('counterLeft')); + await Utils.sleep(100); + let topBounds = await counterTop.getBounds() + await Utils.sleep(100); + await driver.click(topBounds.right - 10, topBounds.bottom - 10) + + await Utils.sleep(1000); + let counterBottom = await driver.findComponent(ON.id('counterRight')); + let bottomBounds = await counterBottom.getBounds() + await Utils.sleep(100); + driver.click(bottomBounds.right - 10, bottomBounds.bottom - 10) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0090 + * @tc.desc : Navigation组件上下设置了文本 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0090 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0090') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1500); + let setTopText = await driver.findComponent(ON.id('setTopText')); + await Utils.sleep(100); + setTopText.click() + await Utils.sleep(1500); + let setBottomText = await driver.findComponent(ON.id('setBottomText')); + await Utils.sleep(100); + setBottomText.click() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0090.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0100 + * @tc.desc : Navigation组件上方设置了文本 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0100 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0100') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1500); + let setTopText = await driver.findComponent(ON.id('setTopText')); + await Utils.sleep(100); + setTopText.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0110 + * @tc.desc : Navigation组件下方设置了文本 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0110 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0110') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1500); + let setTopText = await driver.findComponent(ON.id('setBottomText')); + await Utils.sleep(100); + setTopText.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0120 + * @tc.desc : Navigation组件下方设置了文本 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0120 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0120') + await Utils.sleep(3000); + let hideTitleBar = await driver.findComponent(ON.id('hideTitleBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1500); + let counterMinWidth = await driver.findComponent(ON.id('counterMinWidth')); + let boundsMin=await counterMinWidth.getBounds() + await Utils.sleep(100); + driver.click(boundsMin.left+10,boundsMin.top+10) + await Utils.sleep(1500); + boundsMin=await counterMinWidth.getBounds() + await Utils.sleep(100); + driver.click(boundsMin.left+10,boundsMin.top+10) + await Utils.sleep(1500); + boundsMin=await counterMinWidth.getBounds() + await Utils.sleep(100); + driver.click(boundsMin.left+10,boundsMin.top+10) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0140 + * @tc.desc : Navigation组件下方设置了文本 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0140 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0140') + await Utils.sleep(3000); + + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(100); + hideTitleBar.click() + await Utils.sleep(1500); + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + changeBachGround.click() + await Utils.sleep(1500); + let doubleColumn = await driver.findComponent(ON.id('doubleColumn')); + await Utils.sleep(100); + doubleColumn.click() + await Utils.sleep(1500); + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + pushPath.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0150 + * @tc.desc : Navigation高度贴边,动态减少Navigation高度,使Navigation不贴边 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0150 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0150') + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('heightReduce')); + await Utils.sleep(100); + button.click() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0160 + * @tc.desc : 竖屏动态切换为横屏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0160 start.`); + await Utils.sleep(200); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0160') + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(100); + button.click() + await Utils.sleep(100); + Settings.changeOrientation() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0170 + * @tc.desc : 横屏动态切换为竖屏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0170 start.`); + Settings.changeOrientation() + await Utils.sleep(200); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0170') + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(100); + button.click() + await Utils.sleep(100); + Settings.changeOrientation() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 + * @tc.desc : Navigation组件中,连续push进多个页面,再连续点击返回键 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + await pushPath.click() + await Utils.sleep(1200); + Settings.changeOrientation() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 + * @tc.desc : Navigation组件中,连续push进多个页面,再连续点击返回键 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180') + await Utils.sleep(2000); + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + await pushPath.click() + await Utils.sleep(1200); + Settings.changeOrientation() + await Utils.sleep(2000); + Settings.changeOrientation() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0190 + * @tc.desc : Navigation外部设置一个滚动容器 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0190 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0190') + await Utils.sleep(3000); + + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0200 + * @tc.desc : Navigation内部设置一个滚动容器 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0200 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0200') + await Utils.sleep(3000); + + let changeBachGround = await driver.findComponent(ON.id('changeBackGround')); + await Utils.sleep(100); + await changeBachGround.click() + await Utils.sleep(1000); + let hideTitleBar = await driver.findComponent(ON.id('hideToolBar')); + await Utils.sleep(1000); + await hideTitleBar.click() + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.desc : Navigation组件中,连续push进多个页面,再连续点击返回键 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + await pushPath.click() + await Utils.sleep(2000); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.desc : Navigation组件中,连续push进多个页面,再连续点击返回键 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + await pushPath.click() + await Utils.sleep(1200); + + let pushPathByNameOne = await driver.findComponent(ON.id('pushPathByNameOne')); + await Utils.sleep(100); + await pushPathByNameOne.click() + await Utils.sleep(1200); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 + * @tc.desc : Navigation组件中,连续push进多个页面,再连续点击返回键 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210') + await Utils.sleep(2000); + + let pushPath = await driver.findComponent(ON.id('pushPath')); + await Utils.sleep(100); + await pushPath.click() + await Utils.sleep(1200); + + let pushPathByNameOne = await driver.findComponent(ON.id('pushPathByNameOne')); + await Utils.sleep(100); + await pushPathByNameOne.click() + await Utils.sleep(1200); + + await driver.click(608,428) + await Utils.sleep(1200); + + await driver.click(104,205) + await Utils.sleep(1200); + + await driver.click(104,205) + await Utils.sleep(1200); + + await driver.click(104,205) + await Utils.sleep(1200); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SAFEZONE_0210.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTestCaseTest/ComponentNavNavigationTestCaseTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTestCaseTest/ComponentNavNavigationTestCaseTest.test.ets new file mode 100755 index 000000000..a380a4ee0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTestCaseTest/ComponentNavNavigationTestCaseTest.test.ets @@ -0,0 +1,938 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + + +export default function ComponentNavNavigationTestCaseTest() { + + describe('ComponentNavNavigationTestCaseTest', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : TestCase_b3f7c073efbc468a9b58bld89ff38421 + * @tc.name : TestCase_b3f7c073efbc468a9b58bld89ff38421 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePath替换为pageTwo页面 + */ + it('TestCase_b3f7c073efbc468a9b58bld89ff38421', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421.`); + done(); + }) + + /* + * @tc.number : TestCase_b3f7c073efbc468a9b58bld89ff38421 + * @tc.name : TestCase_b3f7c073efbc468a9b58bld89ff38421 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePath替换为pageTwo页面 + */ + it('TestCase_b3f7c073efbc468a9b58bld89ff38421_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + let replaceToPageTwo: Component = await driver.findComponent(ON.id('replaceToPageTwo')) + await Utils.sleep(300) + replaceToPageTwo.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421.`); + done(); + }) + + /* + * @tc.number : TestCase_eb0e7b2d18e0427586alcbacd5bd3036 + * @tc.name : TestCase_eb0e7b2d18e0427586alcbacd5bd3036 + * @tc.desc : pageOne页面跳转到pageTwo面,将栈顶pageTwo页面通过removeByName删除,触发页面回调 + */ + it('TestCase_eb0e7b2d18e0427586alcbacd5bd3036', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421.`); + done(); + }) + + /* + * @tc.number : TestCase_eb0e7b2d18e0427586alcbacd5bd3036 + * @tc.name : TestCase_eb0e7b2d18e0427586alcbacd5bd3036 + * @tc.desc : pageOne页面跳转到pageTwo面,将栈顶pageTwo页面通过removeByName删除,触发页面回调 + */ + it('TestCase_eb0e7b2d18e0427586alcbacd5bd3036_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + let removeByName: Component = await driver.findComponent(ON.id('removeByName: PageTwo')) + await Utils.sleep(300) + removeByName.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_b3f7c073efbc468a9b58bld89ff38421.`); + done(); + }) + + + /* + * @tc.number : TestCase_cf6aalbbac2b4821becfc7b579ecfb25 + * @tc.name : TestCase_cf6aalbbac2b4821becfc7b579ecfb25 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePathByName替换为pageThree页面 + */ + it('TestCase_cf6aalbbac2b4821becfc7b579ecfb25', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_cf6aalbbac2b4821becfc7b579ecfb25 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_cf6aalbbac2b4821becfc7b579ecfb25.`); + done(); + }) + + /* + * @tc.number : TestCase_cf6aalbbac2b4821becfc7b579ecfb25 + * @tc.name : TestCase_cf6aalbbac2b4821becfc7b579ecfb25 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePathByName替换为pageThree页面 + */ + it('TestCase_cf6aalbbac2b4821becfc7b579ecfb25_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_cf6aalbbac2b4821becfc7b579ecfb25 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + let replaceToPageThreeByName: Component = await driver.findComponent(ON.id('replaceToPageThreeByName')) + await Utils.sleep(300) + replaceToPageThreeByName.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_cf6aalbbac2b4821becfc7b579ecfb25.`); + done(); + }) + + /* + * @tc.number : TestCase_e515c6d135614209b3e903b7710bb59a + * @tc.name : TestCase_e515c6d135614209b3e903b7710bb59a + * @tc.desc : 在willshow回调过程中from起始页面remove掉,查看效果 + */ + it('TestCase_e515c6d135614209b3e903b7710bb59a', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_e515c6d135614209b3e903b7710bb59a start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase59a') + await Utils.sleep(500); + let driver: Driver = Driver.create() + + let useAnimation: Component = await driver.findComponent(ON.id('useAnimation')) + await Utils.sleep(200) + useAnimation?.click() + await Utils.sleep(1000) + + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('removeStartPage')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + let pageThree: Component = await driver.findComponent(ON.id('pageThree')) + await Utils.sleep(300) + pageThree.click() + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `TestCase_e515c6d135614209b3e903b7710bb59a.`); + done(); + }) + + /* + * @tc.number : TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df + * @tc.name : TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈底pageOne页面通过removeByName删除,不会触发页面回调 + */ + it('TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df.`); + done(); + }) + + /* + * @tc.number : TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df + * @tc.name : TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈底pageOne页面通过removeByName删除,不会触发页面回调 + */ + it('TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + let removeByName: Component = await driver.findComponent(ON.id('removeByName:pageOne')) + await Utils.sleep(300) + removeByName.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_bfcdb8f8b05c4b60bleaba4adb79f0df.`); + done(); + }) + + /* + * @tc.number : TestCase_93b0bac5b045462ab07a9352b9eded8a + * @tc.name : TestCase_93b0bac5b045462ab07a9352b9eded8a + * @tc.desc : 检验willshow及didshow跳转顺序,添加navdestination的onShown回 + */ + it('TestCase_93b0bac5b045462ab07a9352b9eded8a', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_93b0bac5b045462ab07a9352b9eded8a start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased8a') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(500) + await pushOne.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(500) + await pushTwo.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_93b0bac5b045462ab07a9352b9eded8a.`); + done(); + }) + + /* + * @tc.number : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.name : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.desc : 使用pushPath,navbar页面(Navigation首页)跳转到pageOne页面,pageOne跳转到pageTwo页面,点击返回按钮返回pageOne页面 + */ + it('TestCase_eb38a8ea421e47c594a338153c263dc8', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8.`); + done(); + }) + + /* + * @tc.number : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.name : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.desc : 使用pushPath,navbar页面(Navigation首页)跳转到pageOne页面,pageOne跳转到pageTwo页面,点击返回按钮返回pageOne页面 + */ + it('TestCase_eb38a8ea421e47c594a338153c263dc8_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8.`); + done(); + }) + + /* + * @tc.number : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.name : TestCase_eb38a8ea421e47c594a338153c263dc8 + * @tc.desc : 使用pushPath,navbar页面(Navigation首页)跳转到pageOne页面,pageOne跳转到pageTwo页面,点击返回按钮返回pageOne页面 + */ + it('TestCase_eb38a8ea421e47c594a338153c263dc8_2', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pushOne: Component = await driver.findComponent(ON.id('pushOne')) + await Utils.sleep(200) + pushOne?.click() + await Utils.sleep(1000) + + let pushTwo: Component = await driver.findComponent(ON.id('pushTwo')) + await Utils.sleep(200) + pushTwo.click() + await Utils.sleep(1000) + + driver.click(110, 460) + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_eb38a8ea421e47c594a338153c263dc8.`); + done(); + }) + + /* + * @tc.number : TestCase_31b25e9359bb4c9abf80686e52ea9899 + * @tc.name : TestCase_31b25e9359bb4c9abf80686e52ea9899 + * @tc.desc : 通过NavRouter,将pageOne页面跳转到PageTwo页面,页面跳转触发回调 + */ + it('TestCase_31b25e9359bb4c9abf80686e52ea9899', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_31b25e9359bb4c9abf80686e52ea9899 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase899') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_07: Component = await driver.findComponent(ON.id('pushPageTwoByNavRouter')) + button_07?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_31b25e9359bb4c9abf80686e52ea9899.`); + done(); + }) + + /* + * @tc.number : TestCase_9a81dd057bd54527b8dfb8a274d13cdd + * @tc.name : TestCase_9a81dd057bd54527b8dfb8a274d13cdd + * @tc.desc : pageOne页面跳转到pageTwo页面,moveToTop将pageOne页面置于栈顶,页面跳转触发回调 + */ + it('TestCase_9a81dd057bd54527b8dfb8a274d13cdd', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_9a81dd057bd54527b8dfb8a274d13cdd start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_9a81dd057bd54527b8dfb8a274d13cdd.`); + done(); + }) + + /* + * @tc.number : TestCase_9a81dd057bd54527b8dfb8a274d13cdd + * @tc.name : TestCase_9a81dd057bd54527b8dfb8a274d13cdd + * @tc.desc : pageOne页面跳转到pageTwo页面,moveToTop将pageOne页面置于栈顶,页面跳转触发回调 + */ + it('TestCase_9a81dd057bd54527b8dfb8a274d13cdd_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_9a81dd057bd54527b8dfb8a274d13cdd start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + let button_05: Component = await driver.findComponent(ON.id('movePageOneToTop')) + button_05?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_9a81dd057bd54527b8dfb8a274d13cdd.`); + done(); + }) + + /* + * @tc.number : TestCase_a32eaea7edb24f9984cc146ee2f6a097 + * @tc.name : TestCase_a32eaea7edb24f9984cc146ee2f6a097 + * @tc.desc : pageOne页面跳转到pageTwo页面,pageTwo跳转到pageThree页面,使用clear清楚栈内页面,页面跳转到navbar首页,页面触发回调 + */ + it('TestCase_a32eaea7edb24f9984cc146ee2f6a097', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_a32eaea7edb24f9984cc146ee2f6a097 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + + let button_03: Component = await driver.findComponent(ON.id('pushPageThree')) + button_03?.click() + await Utils.sleep(1500) + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_a32eaea7edb24f9984cc146ee2f6a097.`); + done(); + }) + + /* + * @tc.number : TestCase_a32eaea7edb24f9984cc146ee2f6a097 + * @tc.name : TestCase_a32eaea7edb24f9984cc146ee2f6a097 + * @tc.desc : pageOne页面跳转到pageTwo页面,pageTwo跳转到pageThree页面,使用clear清楚栈内页面,页面跳转到navbar首页,页面触发回调 + */ + it('TestCase_a32eaea7edb24f9984cc146ee2f6a097_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_a32eaea7edb24f9984cc146ee2f6a097 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + + let button_03: Component = await driver.findComponent(ON.id('pushPageThree')) + button_03?.click() + await Utils.sleep(1000) + + let button_04: Component = await driver.findComponent(ON.id('clear')) + button_04?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_a32eaea7edb24f9984cc146ee2f6a097.`); + done(); + }) + + /* + * @tc.number : TestCase_31aef2a5cb984594a2e9cbdb525acd4d + * @tc.name : TestCase_31aef2a5cb984594a2e9cbdb525acd4d + * @tc.desc : pageOne页面跳转到pageTwo页面,movelndexToTop将pageOne页面置于栈顶页面跳转触发回调 + */ + it('TestCase_31aef2a5cb984594a2e9cbdb525acd4d', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01 = await driver.findComponent(ON.id('pushOne')) + await button_01?.click() + await Utils.sleep(1000) + let button_02 = await driver.findComponent(ON.id('pushTwo')) + await button_02?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d.`); + done(); + }) + + /* + * @tc.number : TestCase_31aef2a5cb984594a2e9cbdb525acd4d + * @tc.name : TestCase_31aef2a5cb984594a2e9cbdb525acd4d + * @tc.desc : pageOne页面跳转到pageTwo页面,movelndexToTop将pageOne页面置于栈顶页面跳转触发回调 + */ + it('TestCase_31aef2a5cb984594a2e9cbdb525acd4d_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01 = await driver.findComponent(ON.id('pushOne')) + await button_01?.click() + await Utils.sleep(1000) + let button_02 = await driver.findComponent(ON.id('pushTwo')) + await button_02?.click() + await Utils.sleep(1000) + let button_06 = await driver.findComponent(ON.id('inputIndex')) + await button_06?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d.`); + done(); + }) + /* + * @tc.number : TestCase_92290b2aae534e54bedbecbacf8f527c + * @tc.name : TestCase_92290b2aae534e54bedbecbacf8f527c + * @tc.desc : 通过pagePath,navbar进入pageFive页面,pageFive页面不存在,页面跳转到空白页面,触发回调 + */ + it('TestCase_92290b2aae534e54bedbecbacf8f527c', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_92290b2aae534e54bedbecbacf8f527c start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase27c') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let pageFive: Component = await driver.findComponent(ON.id('pageFive')) + pageFive?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_92290b2aae534e54bedbecbacf8f527c.`); + done(); + }) + + /* + * @tc.number : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.name : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.desc : 通点击按钮,切换为split模式,单栏变为双栏,触发回调 + */ + it('TestCase_22f968be99de4ab6ad3efa9e2aalaf45', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45') + await Utils.sleep(500); + Settings.changeOrientation() + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('split')) + button_09?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45.`); + done(); + }) + + /* + * @tc.number : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.name : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.desc : 通点击按钮,切换为split模式,单栏变为双栏,触发回调 + */ + it('TestCase_22f968be99de4ab6ad3efa9e2aalaf45_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45') + await Utils.sleep(500); + Settings.changeOrientation() + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('split')) + button_09?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('auto')) + button_02?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45.`); + done(); + }) + + /* + * @tc.number : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.name : TestCase_22f968be99de4ab6ad3efa9e2aalaf45 + * @tc.desc : 通点击按钮,切换为split模式,单栏变为双栏,触发回调 + */ + it('TestCase_22f968be99de4ab6ad3efa9e2aalaf45_2', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45 start.`); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45') + await Utils.sleep(500); + Settings.changeOrientation() + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('split')) + button_09?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('auto')) + button_02?.click() + await Utils.sleep(1000) + let button_06: Component = await driver.findComponent(ON.id('stack')) + button_06?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_22f968be99de4ab6ad3efa9e2aalaf45.`); + done(); + }) + + /* + * @tc.number : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.name : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.desc : 使用pushPath,关闭页面跳转动画,pageOne跳转到pageTwo页面,再pop回pageOne页面 + */ + it('TestCase_8600836eb1834d74a45370a43d9825b3', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('useAnimation')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('pushOne')) + button_09?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3.`); + done(); + }) + + /* + * @tc.number : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.name : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.desc : 使用pushPath,关闭页面跳转动画,pageOne跳转到pageTwo页面,再pop回pageOne页面 + */ + it('TestCase_8600836eb1834d74a45370a43d9825b3_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('useAnimation')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('pushOne')) + button_09?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3.`); + done(); + }) + + /* + * @tc.number : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.name : TestCase_8600836eb1834d74a45370a43d9825b3 + * @tc.desc : 使用pushPath,关闭页面跳转动画,pageOne跳转到pageTwo页面,再pop回pageOne页面 + */ + it('TestCase_8600836eb1834d74a45370a43d9825b3_2', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('useAnimation')) + button_01?.click() + await Utils.sleep(1000) + let button_09: Component = await driver.findComponent(ON.id('pushOne')) + button_09?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + let button_06: Component = await driver.findComponent(ON.id('Pop')) + button_06?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_8600836eb1834d74a45370a43d9825b3.`); + done(); + }) + + /* + * @tc.number : TestCase_5cc9281407c94c01a7764750ccaf4b52 + * @tc.name : TestCase_5cc9281407c94c01a7764750ccaf4b52 + * @tc.desc : 使用pushDestinationByName,pageOne跳转到pageTwo页面 + */ + it('TestCase_5cc9281407c94c01a7764750ccaf4b52', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_5cc9281407c94c01a7764750ccaf4b52 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_5cc9281407c94c01a7764750ccaf4b52.`); + done(); + }) + + /* + * @tc.number : TestCase_5cc9281407c94c01a7764750ccaf4b52 + * @tc.name : TestCase_5cc9281407c94c01a7764750ccaf4b52 + * @tc.desc : 使用pushDestinationByName,pageOne跳转到pageTwo页面 + */ + it('TestCase_5cc9281407c94c01a7764750ccaf4b52_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_5cc9281407c94c01a7764750ccaf4b52 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + let button_06: Component = await driver.findComponent(ON.id('Pop')) + button_06?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_5cc9281407c94c01a7764750ccaf4b52.`); + done(); + }) + + /* + * @tc.number : TestCase_80ec9dadf80b4bbc80da5b0936a77027 + * @tc.name : TestCase_80ec9dadf80b4bbc80da5b0936a77027 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePath替换为pageThree页面 + */ + it('TestCase_80ec9dadf80b4bbc80da5b0936a77027', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_80ec9dadf80b4bbc80da5b0936a77027 start.`); + await Utils.sleep(500); + Settings.changeOrientation() + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_80ec9dadf80b4bbc80da5b0936a77027.`); + done(); + }) + + /* + * @tc.number : TestCase_80ec9dadf80b4bbc80da5b0936a77027 + * @tc.name : TestCase_80ec9dadf80b4bbc80da5b0936a77027 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过replacePath替换为pageThree页面 + */ + it('TestCase_80ec9dadf80b4bbc80da5b0936a77027_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_80ec9dadf80b4bbc80da5b0936a77027 start.`); + await Utils.sleep(500); + Settings.changeOrientation() + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01: Component = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02: Component = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1000) + let replaceToPageThree: Component = await driver.findComponent(ON.id('replaceToPageThree')) + replaceToPageThree?.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_80ec9dadf80b4bbc80da5b0936a77027.`); + done(); + }) + + /* + * @tc.number : TestCase_2e5d56cdc52c45678a8e09984831c388 + * @tc.name : TestCase_2e5d56cdc52c45678a8e09984831c388 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过removeByIndex删除,触发页面回 + */ + it('TestCase_2e5d56cdc52c45678a8e09984831c388', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_2e5d56cdc52c45678a8e09984831c388 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01 = await driver.findComponent(ON.id('pushOne')) + button_01?.click() + await Utils.sleep(1000) + let button_02 = await driver.findComponent(ON.id('pushTwo')) + button_02?.click() + await Utils.sleep(1500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d.`); + done(); + }) + + /* + * @tc.number : TestCase_2e5d56cdc52c45678a8e09984831c388 + * @tc.name : TestCase_2e5d56cdc52c45678a8e09984831c388 + * @tc.desc : pageOne页面跳转到pageTwo页面,将栈顶pageTwo页面通过removeByIndex删除,触发页面回 + */ + it('TestCase_2e5d56cdc52c45678a8e09984831c388_1', 0, async (done: Function) => { + Logger.info('TEST', `TestCase_2e5d56cdc52c45678a8e09984831c388 start.`); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388') + await Utils.sleep(500); + let driver: Driver = Driver.create() + let button_01 = await driver.findComponent(ON.id('pushOne')) + await button_01?.click() + await Utils.sleep(1000) + let button_02 = await driver.findComponent(ON.id('pushTwo')) + await button_02?.click() + await Utils.sleep(1000) + let button_06 = await driver.findComponent(ON.id('inputIndex1')) + await button_06?.click() + await Utils.sleep(3000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `TestCase_31aef2a5cb984594a2e9cbdb525acd4d.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlurTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlurTests.test.ets new file mode 100755 index 000000000..008facb41 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlurTests.test.ets @@ -0,0 +1,1080 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' + +export default function ComponentNavNavigationTitleBarBlurTests() { + + describe('ComponentNavNavigationTitleBarBlurTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0010 + * @tc.desc : Split模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0010 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0010') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0010')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0010.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0020 + * @tc.desc : Stack模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0020 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0020') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0020')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 + * @tc.desc : Auto模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0030')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 + * @tc.desc : Auto模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0030')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0030.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 + * @tc.desc : Stack模式,工具栏材质模糊设置Thin,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0040')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 + * @tc.desc : Stack模式,工具栏材质模糊设置Thin,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0040')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0040')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0040.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 + * @tc.desc : Stack模式,工具栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0050')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 + * @tc.desc : Stack模式,工具栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0050')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0050')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0050.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 + * @tc.desc : Stack模式,工具栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0060')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 + * @tc.desc : Stack模式,工具栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0060')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0060')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 + * @tc.desc : Stack模式,工具栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0070')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 + * @tc.desc : Stack模式,工具栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0070')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0070')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0070.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 + * @tc.desc : Stack模式,工具栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0080')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 + * @tc.desc : Stack模式,工具栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0080')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0080')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 + * @tc.desc : tack模式,工具栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0090')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 + * @tc.desc : tack模式,工具栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0090')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0090')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 + * @tc.desc : Stack模式,工具栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0100')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 + * @tc.desc : Stack模式,工具栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0100')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0100')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 + * @tc.desc : Stack模式,工具栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0110')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 + * @tc.desc : Stack模式,工具栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0110')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0110')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 + * @tc.desc : Stack模式,工具栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0120')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 + * @tc.desc : Stack模式,工具栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0120')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0120')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130 + * @tc.desc : Split模式,工具栏材质模糊设置Thin,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0130')); + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130 + * @tc.desc : Split模式,工具栏材质模糊设置Thin,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130_1 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0130')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0130')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0130_1.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140 + * @tc.desc : Split模式,工具栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0140')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140 + * @tc.desc : Split模式,工具栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140_1 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0140')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0140')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0140_1.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 + * @tc.desc : Split模式,工具栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0150')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 + * @tc.desc : Split模式,工具栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0150')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0150')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0150.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 + * @tc.desc : Split模式,工具栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0160')); + await Utils.sleep(100); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 + * @tc.desc : Split模式,工具栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0160')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0160')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 + * @tc.desc : Split模式,工具栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0170')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 + * @tc.desc : Split模式,工具栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0170')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0170')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0180')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0180')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0180')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0180.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0190')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0190')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0190')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 + * @tc.desc : Split模式,工具栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0200')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 + * @tc.desc : Split模式,工具栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(200); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0200')); + await Utils.sleep(100); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0200')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0210')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 + * @tc.desc : Split模式,工具栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('toolMode0210')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('toolbarBlur0210')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TITLEBARBLUR_0210.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBarTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBarTests.test.ets new file mode 100755 index 000000000..8beb74e74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBarTests.test.ets @@ -0,0 +1,1077 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' + +export default function ComponentNavNavigationToolBarTests() { + + describe('ComponentNavNavigationToolBarTests', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0010 + * @tc.desc : Split模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0010 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0010') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0010')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0010.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0020 + * @tc.desc : Stack模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0020 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0020') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0020')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0020.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 + * @tc.desc : Auto模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0030')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 + * @tc.desc : Auto模式,不设置模糊材质,默认无模糊效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0030')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0030')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0030.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 + * @tc.desc : Stack模式,标题栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0050')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 + * @tc.desc : Stack模式,标题栏材质模糊设置Thick,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0050')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0050')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0050.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 + * @tc.desc : Stack模式,标题栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0060')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 + * @tc.desc : Stack模式,标题栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0060')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0060')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0060.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 + * @tc.desc : Stack模式,标题栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0070')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 + * @tc.desc : Stack模式,标题栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0070')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0070')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0070.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 + * @tc.desc : Stack模式,标题栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0080')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 + * @tc.desc : Stack模式,标题栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0080')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0080')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0080.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090') + await Utils.sleep(5000); + let mode = await driver.findComponent(ON.id('mode0090')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0090')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0090')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0090')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0090.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 + * @tc.desc : Stack模式,标题栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0100')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 + * @tc.desc : Stack模式,标题栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0100')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0100')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0100.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 + * @tc.desc : Stack模式,标题栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0110')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(2000); + mode.click() + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 + * @tc.desc : Stack模式,标题栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0110')); + await Utils.sleep(500); + mode.click() + await Utils.sleep(1000); + mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0110')); + await Utils.sleep(500); + blur.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0110.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 + * @tc.desc : Stack模式,标题栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0120')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 + * @tc.desc : Stack模式,标题栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0120')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0120')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0120.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0130')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0130')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0130')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140') + await Utils.sleep(500); + let mode = await driver.findComponent(ON.id('mode0140')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 + * @tc.desc : push页面PageOne,PageOne页面为透明页面,push成功 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0140')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0140')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 + * @tc.desc : Split模式,标题栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0150')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 + * @tc.desc : Split模式,标题栏材质模糊设置Regular,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0150')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0150')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 + * @tc.desc : Split模式,标题栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0160')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 + * @tc.desc : Split模式,标题栏材质模糊设置BACKGROUND_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0160 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0160')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0160')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 + * @tc.desc : Split模式,标题栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0170')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 + * @tc.desc : Split模式,标题栏材质模糊设置NONE,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0170')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0170')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0180')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0180')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0180')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0190')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_ULTRA_THICK,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0190')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0190')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 + * @tc.desc : Split模式,标题栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0200')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 + * @tc.desc : Split模式,标题栏材质模糊设置BACKGROUND_THIN,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0200')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0200')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0200.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0210')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(2000); + await mode.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 + * @tc.desc : Split模式,标题栏材质模糊设置COMPONENT_REGULAR,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210') + await Utils.sleep(1000); + let mode = await driver.findComponent(ON.id('mode0210')); + await Utils.sleep(500); + await mode.click() + await Utils.sleep(1000); + await mode.click() + await Utils.sleep(1000); + let blur = await driver.findComponent(ON.id('blurStyle0210')); + await Utils.sleep(500); + await blur.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0210.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0250 + * @tc.name : SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0250 + * @tc.desc : 系统设置深夜模式,标题栏材质模糊设置各种属性,属性生效 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0250 start.`); + Settings.changeOrientation() + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0250') + // await Utils.sleep(1000); + // let mode = await driver.findComponent(ON.id('mode0250')); + // await Utils.sleep(500); + // mode.click() + // await Utils.sleep(1000); + // mode.click() + // await Utils.sleep(1000); + // let blur = await driver.findComponent(ON.id('blurStyle0250')); + // await Utils.sleep(500); + // blur.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_TOOLBAR_0250.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 0860e1238..ab9f72d09 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -149,6 +149,36 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import ComponentNavNavigationInterfaceTests from '../test/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterfaceTests.test' +import ComponentNavNavigationCapabilityTests from '../test/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapabilityTests.test' +import ComponentNavNavigationLayoutTests from '../test/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayoutTests.test' +import ComponentNavNavigationActionTests from '../test/ComponentNavNavigationActionTest/ComponentNavNavigationActionTests.test' +import ComponentNavNavigationRouterTests from '../test/ComponentNavNavigationRouterTest/ComponentNavNavigationRouterTests.test' +import ComponentNavNavigationHideNavBarTests from '../test/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBarTests.test' +import ComponentNavNavigationSafeZoneTests from '../test/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZoneTests.test' +import ComponentNavNavigationPushTests from '../test/ComponentNavNavigationPushTest/ComponentNavNavigationPushTests.test' +import ComponentNavNavigationToolBarTests from '../test/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBarTests.test' +import ComponentNavNavigationTitleBarBlurTests from '../test/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlurTests.test' +import UIComponentNavigationMenubarAvoidInterface001 + from './UIComponentNavigationMenubarAvoidInterfaceTest/UIComponentNavigationMenubarAvoidInterface001.test' +import ComponentNavNavigationBackTests from './ComponentNavNavigationBackTest/ComponentNavNavigationBackTests.test' +import ComponentNavNavigationActiveTests from './ComponentNavNavigationActive/ComponentNavNavigationActiveTests.test' +import ComponentNavNavigationRemovePageTests from '../test/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePageTests.test'; +import ComponentNavNavigationPageInfo + from '../test/ComponentNavNavigationPageInfoTest/ComponentNavNavigationPageInfo.test'; +import ComponentNavNavigationDialog from '../test/ComponentNavNavigationDialogTest/ComponentNavNavigationDialog.test'; +import ComponentNavNavigationExpandSafeArea + from '../test/ComponentNavNavigationExpandSafeAreaTest/ComponentNavNavigationExpandSafeArea.test'; +import ComponentNavNavigationRouterInterceptTests from '../test/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterInterceptTests.test' +import ComponentNavNavigationTestCaseTest + from './ComponentNavNavigationTestCaseTest/ComponentNavNavigationTestCaseTest.test' +import UIAttributeFontInterfaceNavigation001 + from './UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation001.test' +import UIAttributeFontInterfaceNavigation002 + from './UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation002.test' +import UIAttributeFontInterfaceNavigation003 + from './UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation003.test' +import ArkUITPdatabaseUpGradeTests from './ArkUITPdatabaseUpGradeTest/ArkUITPdatabaseUpGradeTests.test' export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -239,6 +269,30 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + + UIComponentNavigationMenubarAvoidInterface001(); + ComponentNavNavigationInterfaceTests(); + ComponentNavNavigationCapabilityTests(); + ComponentNavNavigationLayoutTests(); + ComponentNavNavigationActionTests(); + ComponentNavNavigationRouterTests(); + ComponentNavNavigationHideNavBarTests(); + ComponentNavNavigationSafeZoneTests(); + ComponentNavNavigationPushTests(); + ComponentNavNavigationToolBarTests(); + ComponentNavNavigationTitleBarBlurTests(); + ComponentNavNavigationBackTests(); + ComponentNavNavigationActiveTests(); + ComponentNavNavigationRemovePageTests(); + ComponentNavNavigationPageInfo(); + ComponentNavNavigationDialog(); + ComponentNavNavigationExpandSafeArea(); + ComponentNavNavigationRouterInterceptTests(); + ComponentNavNavigationTestCaseTest(); + UIAttributeFontInterfaceNavigation001(); + UIAttributeFontInterfaceNavigation002(); + UIAttributeFontInterfaceNavigation003(); + ArkUITPdatabaseUpGradeTests(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation001.test.ets new file mode 100755 index 000000000..11554197c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation001.test.ets @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +import { + UiComponent, + UiDriver, + Component, + Driver, + UiWindow, + ON, + BY, + MatchPattern, + DisplayRotation, + ResizeDirection, + WindowMode, + PointerMatrix +} from '@ohos.UiTest'; + +/* + * demoTest_001:更改page路由 + * demoTest_002:更改page路由,像素密度 + * demoTest_003:更改page路由,窗口大小,位置,像素密度 + * demoTest_004:更改page路由,页面内元素属性 + * demoTest_005:更改page路由,注入点击事件 + * + * demoTest_004:更改属性需要配合页面路由配置globalThis.value.message + * demoTest_005:注入事件,引用'@ohos.UiTest',findComponent需要根据页面路由内组件配置情况更改 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + + +export default function UIAttributeFontInterfaceNavigation002() { + + + describe('UIAttributeFontInterfaceNavigation002', () => { + + afterEach(async (done: Function) => { + + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0690 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0690 + * @tc.desc 点击菜单与工具栏更多按钮 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0690 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('3')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0410 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0410 + * @tc.desc fontSize设置为0 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0410 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0060 + * @tc.desc 点击[effectStrategy]动态按钮切换 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0060 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0070 + * @tc.desc 点击切换'symbolEffect'属性按钮 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0070 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0100 + * @tc.desc 系统设置维吾尔语,点击工具栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0100 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + Settings.switchLocales() + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('8')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0110 + * @tc.desc 点击"mode"按钮,竖屏切换为横屏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0110 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let button3: Component = await driver.findComponent(ON.id('10')); + await Utils.sleep(500); + await button3.click(); + await Utils.sleep(1000); + Settings.changeOrientation() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.changeOrientation() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0120 + * @tc.desc 竖屏切换为横屏,点击"navBarPosition"按钮,切换为[End、Start],点击工具栏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0120 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + await Utils.sleep(1000) + Settings.changeOrientation() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.changeOrientation() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0210 + * @tc.desc 竖屏切换为横屏 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0210 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + await Utils.sleep(1000) + Settings.changeOrientation() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.changeOrientation() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0260 + * @tc.desc 点击开启子窗口 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0260 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + await Utils.sleep(1000) + // let driver: Driver = Driver.create(); + // await driver.delayMs(100); + // await driver.delayMs(600); + // let button3: Component = await driver.findComponent(ON.id('26')); + // await driver.delayMs(100); + // await button3.click(); + // await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0240 + * @tc.desc 锁屏后重启,上滑使应用进入后台,之后再切换回应用 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0240', 0, async (done: Function) => { + Logger.info('TEST', ` SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0240 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002") + let driver: Driver = Driver.create(); + await Utils.sleep(500); + await Utils.lockAndUnlock(driver) + await Utils.sleep(3000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0280 + * @tc.desc 示例代码 + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0280', 0, async (done: Function) => { + Logger.info('TEST', ` SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYMBOL_0280 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0280") + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation002.test.ets new file mode 100755 index 000000000..08eb4f86c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation002.test.ets @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { KeyCode } from '@kit.InputKit'; + +import { + UiComponent, + UiDriver, + Component, + Driver, + UiWindow, + ON, + BY, + MatchPattern, + DisplayRotation, + ResizeDirection, + WindowMode, + PointerMatrix +} from '@ohos.UiTest'; + +/* + * demoTest_001:更改page路由 + * demoTest_002:更改page路由,像素密度 + * demoTest_003:更改page路由,窗口大小,位置,像素密度 + * demoTest_004:更改page路由,页面内元素属性 + * demoTest_005:更改page路由,注入点击事件 + * + * demoTest_004:更改属性需要配合页面路由配置globalThis.value.message + * demoTest_005:注入事件,引用'@ohos.UiTest',findComponent需要根据页面路由内组件配置情况更改 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + + +export default function UIAttributeFontInterfaceNavigation003() { + + + describe('UIAttributeFontInterfaceNavigation003', () => { + + afterEach(async (done: Function) => { + + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0010 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0010 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button1: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button1.click(); + await driver.delayMs(1000); + let button2: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button2.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0070 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0070 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('3')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('4')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + await driver.triggerKey(KeyCode.KEYCODE_H); + await driver.triggerKey(KeyCode.KEYCODE_E); + await driver.triggerKey(KeyCode.KEYCODE_L); + await driver.triggerKey(KeyCode.KEYCODE_L); + await driver.triggerKey(KeyCode.KEYCODE_O); + await driver.triggerKey(KeyCode.KEYCODE_SPACE); + await driver.triggerKey(KeyCode.KEYCODE_T); + await driver.triggerKey(KeyCode.KEYCODE_E); + await driver.triggerKey(KeyCode.KEYCODE_S); + await driver.triggerKey(KeyCode.KEYCODE_T); + + let text4: Component = await driver.findComponent(ON.id('input1')); + let strText4 = await text4.getText(); + console.info('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040 END strText4'); + await driver.delayMs(100); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0030 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0030 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_0); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_1); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_2); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_3); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_4); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_5); + + let text4: Component = await driver.findComponent(ON.id('input1')); + let strText4 = await text4.getText(); + console.info('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0040 END strText4'); + await driver.delayMs(100); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0050 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0050 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('6')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0080 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0080 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('10')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + let button5: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button5.click(); + await driver.delayMs(1000); + let button6: Component = await driver.findComponent(ON.id('11')); + await driver.delayMs(100); + await button6.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0020 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0020 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0060 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_REMOVEBYID_0060 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('21')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation003.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation003.test.ets new file mode 100755 index 000000000..60f06c70f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceNavigationTest/UIAttributeFontInterfaceNavigation003.test.ets @@ -0,0 +1,446 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import uiAppearance from '@ohos.uiAppearance' +import { + UiComponent, + UiDriver, + Component, + Driver, + UiWindow, + ON, + BY, + MatchPattern, + DisplayRotation, + ResizeDirection, + WindowMode, + PointerMatrix +} from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit'; +/* + * demoTest_001:更改page路由 + * demoTest_002:更改page路由,像素密度 + * demoTest_003:更改page路由,窗口大小,位置,像素密度 + * demoTest_004:更改page路由,页面内元素属性 + * demoTest_005:更改page路由,注入点击事件 + * + * demoTest_004:更改属性需要配合页面路由配置globalThis.value.message + * demoTest_005:注入事件,引用'@ohos.UiTest',findComponent需要根据页面路由内组件配置情况更改 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + + +export default function UIAttributeFontInterfaceNavigation004() { + + + describe('UIAttributeFontInterfaceNavigation004', () => { + + afterEach(async (done: Function) => { + + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UILCOMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0070 + * @tc.name SUB_ACE_UILCOMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0070 + * @tc.desc Navigation + */ + it('SUB_ACE_UILCOMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UILCOMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0070 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('4')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0040 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0040 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0130 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0130 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0060 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0060 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0020 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0020 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('3')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0030 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0030 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0150 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0150 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('4')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0080 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0080 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0050 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0050 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0010 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('3')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0140 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0140 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('2')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0160 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0160 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('4')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0120 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0120 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0110 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0110 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0100 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0100 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0170 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0170 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await driver.delayMs(600); + let button3: Component = await driver.findComponent(ON.id('1')); + await driver.delayMs(100); + await button3.click(); + await driver.delayMs(1000); + let button4: Component = await driver.findComponent(ON.id('5')); + await driver.delayMs(100); + await button4.click(); + await driver.delayMs(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0180 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0180 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0200 + * @tc.desc Navigation + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_SYSTEMBARSTYLE 0190 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011"); + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationMenubarAvoidInterfaceTest/UIComponentNavigationMenubarAvoidInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationMenubarAvoidInterfaceTest/UIComponentNavigationMenubarAvoidInterface001.test.ets new file mode 100755 index 000000000..4cccb4616 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationMenubarAvoidInterfaceTest/UIComponentNavigationMenubarAvoidInterface001.test.ets @@ -0,0 +1,2509 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010:ContainerSpan 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentNavigationMenubarAvoidInterface001() { + + describe('UIComponentNavigationMenubarAvoidInterface001', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface001_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface001_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface001_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0010_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface002_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface002_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface002_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0020_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_01 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface003_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_02 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface003_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_03 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface003_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0030_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_01 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface004_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_02 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface004_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_03 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface004_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0040_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_01 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface005_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_02 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface005_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_03 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface005_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0050_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_01 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface006_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_02 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface006_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_03 + * @tc.desc customTitle Builder titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface006_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0060_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface007_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface007_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface007_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0070_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface008_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface008_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface008_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0080_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface009_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface009_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface009_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0090_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_04 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_04 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_04', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_04 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_04 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_05 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_05 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_05', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_05 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_05 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_06 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_06 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_06', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_06 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface010_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0100_06 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface011_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0110_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface012_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0120_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface013_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0130_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface014_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0140_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_001')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + await button_split?.click() + Utils.sleep(500) + await button?.click() + await Utils.sleep(500) + await button_mini?.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_002')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + await button_split?.click() + await Utils.sleep(500) + await button?.click() + await Utils.sleep(500) + await button_full?.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_003')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + await button_split?.click() + await Utils.sleep(500) + await button?.click() + await Utils.sleep(500) + await button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0150_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_04 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_001')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_002')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_003')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface015_006')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0160_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_04 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_001')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_002')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_003')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface017_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0170_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_001')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_002')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_003')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 400, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0180_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_001')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_002')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_003')) + let button_split: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_006')) + let button_navbar: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface018_007')) + await Utils.sleep(500) + button_split?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + button_navbar?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 400, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_01 + * @tc.desc 横竖屏 非自定义titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0190_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_02 + * @tc.desc 横竖屏 非自定义titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_03 + * @tc.desc 横竖屏 非自定义titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface020_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(1000) + await driver?.mouseScroll({ + x: 300, y: 400 + }, true + , 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0200_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_001')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_002')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_003')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_04 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_04 + * @tc.desc NavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_04', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_04 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_005')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_001')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_04 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_05 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_05 + * @tc.desc NavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_05', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_05 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_005')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_002')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_05 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_06 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_06 + * @tc.desc NavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_06', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_06 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_005')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_003')) + let button_width: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface021_006')) + await Utils.sleep(500) + button_width?.click() + await Utils.sleep(1000) + button?.click() + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0210_06 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0220 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface022_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0230 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface023_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0240 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface024") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface024_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + let button_pageTwo: Component = + await driver.findComponent(ON.id('start_pageTwo')) + await Utils.sleep(500) + button_pageTwo?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0250 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface025_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + let button_pageTwo: Component = + await driver.findComponent(ON.id('start_pageTwo')) + await Utils.sleep(500) + button_pageTwo?.click() + await Utils.sleep(1000) + let button_pageThree: Component = + await driver.findComponent(ON.id('start_pageThree')) + await Utils.sleep(500) + button_pageThree?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0260 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface025_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + let button_pageTwo: Component = + await driver.findComponent(ON.id('start_pageTwo')) + await Utils.sleep(500) + button_pageTwo?.click() + await Utils.sleep(1000) + let button_pageThree: Component = + await driver.findComponent(ON.id('start_pageThree_long')) + await Utils.sleep(500) + button_pageThree?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0260 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0270 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface025_001')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + let button_pageTwo: Component = + await driver.findComponent(ON.id('start_pageTwo')) + await Utils.sleep(500) + button_pageTwo?.click() + await Utils.sleep(1000) + let button_pageThree: Component = await driver.findComponent(ON.id('start_pageThree_long')) + await Utils.sleep(500) + button_pageThree?.click() + await Utils.sleep(500) + let button_hideTitle: Component = await driver.findComponent(ON.id('hide_titleBar')) + await Utils.sleep(500) + button_hideTitle?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0280 + * @tc.desc NavDestination + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface028") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface028_001')) + let button_hide: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface028_002')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + button_hide?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0280 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_01 + * @tc.desc tab customMenu + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_001')) + let button_title: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_004')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + button_title?.click() + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_02 + * @tc.desc tab customMenu + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_002')) + let button_title: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_004')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + button_title?.click() + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_03 + * @tc.desc tab customMenu + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_003')) + let button_title: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface030_004')) + await Utils.sleep(1000) + button?.click() + await Utils.sleep(1000) + button_title?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0300_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_01 + * @tc.desc tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface031_001')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + let m_button: Component = await driver.findComponent(ON.type('SymbolGlyph')) + await Utils.sleep(500) + m_button?.click() + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_02 + * @tc.desc tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface031_002')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + let m_button: Component = await driver.findComponent(ON.type('SymbolGlyph')) + await Utils.sleep(500) + m_button?.click() + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_03 + * @tc.desc tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface031_003')) + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(500) + let m_button: Component = await driver.findComponent(ON.type('SymbolGlyph')) + await Utils.sleep(500) + m_button?.click() + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(500) + await driver?.triggerKey(2049) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0310_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_01 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_004')) + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_001')) + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_02 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_004')) + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_002')) + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_03 + * @tc.desc CustomNavigationTitle titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_004')) + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface032_003')) + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + button?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0320_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface033_001')) + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface033_002')) + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface033_003')) + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0330_03 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface034_001')) + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface034_002')) + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface034_003')) + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0340_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_01 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_01 + * @tc.desc titleMode为NavigationTitleMode.Mini. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_01 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_mini: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface035_001')) + await Utils.sleep(500) + button_mini?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_02 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_02 + * @tc.desc titleMode为NavigationTitleMode.Full. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_02 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_full: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface035_002')) + await Utils.sleep(500) + button_full?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_03 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_03 + * @tc.desc titleMode为NavigationTitleMode.Free. + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_03 start.`); + Settings.createWindow("testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button_free: Component = + await driver.findComponent(ON.id('UIComponentNavigationMenubarAvoidInterface035_003')) + await Utils.sleep(500) + button_free?.click() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + await driver?.mouseScroll({ + x: 300, y: 500 + }, true, 100) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Settings?.changeOrientation() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_MENUBARAVOID_0350_03 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets index c74ae2724..07d1bbd86 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -36,14 +36,14 @@ async function sleep(time: number): Promise { } class Settings { - isPhone: boolean = true; + isPhone: boolean = false; windowClass: window.Window | undefined = undefined windowCreateType: string = "changeWindow"; private static DEFAULT_WIDTH: number = 720; - private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_HEIGHT: number = 1412; private static DEFAULT_DPI: number = 240; - private static DEFAULT_OFFSET_X: number = 0; - private static DEFAULT_OFFSET_Y: number = 60; + private static DEFAULT_OFFSET_X: number = 100; + private static DEFAULT_OFFSET_Y: number = 132; private portrait: boolean = true changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets index 7f06aa4d8..e5950e291 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -14,6 +14,9 @@ */ import {Driver , ON} from '@ohos.UiTest' +import { BusinessError, screenLock } from '@kit.BasicServicesKit'; +import Settings from './Settings'; +import { KeyCode } from '@kit.InputKit'; export default class Utils { @@ -38,6 +41,69 @@ export default class Utils { await component.click(); } + /** + * The app breathes and then lights up the screen + * + * @param driver + */ + static async lockAndUnlock(driver: Driver) { + await screenLock.lock((err: BusinessError, data: Boolean) => { + if (err) { + console.error(`Failed to lock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded in locking the screen. result: ${data}`); + }); + await Utils.sleep(2000); + await screenLock.unlock((err: BusinessError) => { + if (err) { + console.error(`Failed to unlock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded unlocking the screen.`); + }); + await driver.drag(100, 900, 100, 1, 1000); + } + + /** + * The application switches to the desktop and back to the application + * + * @param driver + */ + static async homeAndBack(driver: Driver) { + let currentWindow = await Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await Utils.sleep(2000); + await currentWindow.showWindow(); + } + } + static async homeAndBackWithScreenlock(driver: Driver) { + let currentWindow = await Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await screenLock.lock((err: BusinessError, data: Boolean) => { + if (err) { + console.error(`Failed to lock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded in locking the screen. result: ${data}`); + }); + await Utils.sleep(2000); + await screenLock.unlock((err: BusinessError) => { + if (err) { + console.error(`Failed to unlock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded unlocking the screen.`); + }); + await driver.drag(100, 900, 100, 1, 1000); + await Utils.sleep(2000); + await currentWindow.showWindow(); + } + } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200.ets new file mode 100755 index 000000000..a4c89c47f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITPdatabaseUpGrade/ArkUITPdatabaseUpGrade0200.ets @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class DerivedNavPathStack extends NavPathStack { + // usr defined property 'id' + id: string = "__default__" + + // new function in derived class + setId(id: string) { + this.id = id; + } + + // new function in derived class + getInfo(): string { + return "this page used Derived NavPathStack, id: " + this.id + } + + // overwrite function of NavPathStack + pushPath(info: NavPathInfo, animated?: boolean): void + pushPath(info: NavPathInfo, options?: NavigationOptions): void + pushPath(info: NavPathInfo, secArg?: boolean | NavigationOptions): void { + console.log('[derive-test] reached DerivedNavPathStack\'s pushPath'); + if (typeof secArg === 'boolean') { + super.pushPath(info, secArg); + } else { + super.pushPath(info, secArg); + } + } + + // overwrite and overload function of NavPathStack + pop(animated?: boolean | undefined): NavPathInfo | undefined + pop(result: Object, animated?: boolean | undefined): NavPathInfo | undefined + pop(result?: Object, animated?: boolean | undefined): NavPathInfo | undefined { + console.log('[derive-test] reached DerivedNavPathStack\'s pop'); + return super.pop(result, animated); + } + + // other function of base class... +} + +class param { + info: string = "__default_param__"; + + constructor(info: string) { + this.info = info + } +} + +@Entry +@Component +struct ArkUITPdatabaseUpGrade0200 { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + @State log: string = ''; + + aboutToAppear(): void { + this.derivedStack.setId('origin stack'); + } + + @Builder + pageMap(name: string) { + PageOne() + } + + build() { + Navigation(this.derivedStack) { + Button('to Page One').margin(20).onClick(() => { + this.derivedStack.pushPath({ + name: 'pageOne', + param: new param('push pageOne in homePage when stack size: ' + this.derivedStack.size()) + }); + }).id('ArkUITPdatabaseUpGrade0200_button_01') + Text(this.log).margin(20) + }.navDestination(this.pageMap) + .onNavBarStateChange((isVisible: boolean) => { + this.log = this.log + '\nonNavBarStateChange isVisible = ' + isVisible; + console.log('onNavBarStateChange isVisible = ' + isVisible); + }) + .title('Home Page') + } +} + +@Component +struct PageOne { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = "NA"; + + build() { + NavDestination() { + Column() { + Text(this.derivedStack.getInfo()) + .margin(10) + .fontSize(25) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Start) + Text('current page param info:') + .margin(10) + .fontSize(25) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Start) + Text(this.curStringifyParam) + .margin(20) + .fontSize(20) + .textAlign(TextAlign.Start) + }.backgroundColor(Color.Pink) + + Button('to Page One').margin(20).onClick(() => { + this.derivedStack.pushPath({ + name: 'pageOne', + param: new param('push pageOne in pageOne when stack size: ' + this.derivedStack.size()) + }); + }) + }.title('Page One') + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] reached PageOne\'s onReady'); + // get derived stack from navdestinationContext + this.derivedStack = context.pathStack as DerivedNavPathStack; + console.log('[derive-test] -- got derivedStack: ' + this.derivedStack.id); + this.curStringifyParam = JSON.stringify(context.pathInfo.param); + console.log('[derive-test] -- got param: ' + this.curStringifyParam); + }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction0850.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction0850.ets new file mode 100755 index 000000000..386e03f24 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction0850.ets @@ -0,0 +1,395 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import prompt from '@system.prompt'; + +@Component +export struct MyFirstIndex { + @Consume('pathInfos') pathInfos: NavPathStack + name: string = '' + @State value: string = '' + + build() { + NavDestination() { + Text(this.value) + }.title(this.name) + .backgroundColor(Color.Orange) + } +} + +interface menuitem { + value: string, + icon: string, + action: () => void +} + +interface titleType { + free: string, + full: string, + mini: string +} + +interface navBarType { + start: string, + end: string, + +} + +interface BuildSize { + text: string, + num: number +} + +interface modeType { + stack: string, + split: string, + auto: string +} + +@Entry +@Component +struct ComponentNavNavigationAction0850 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + @State menus: menuitem[] = [ + { + value: "1", icon: "/image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "2", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "3", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "4", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "5", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "6", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "7", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "8", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "9", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "10", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + } + ] + //hideBackButton + @Provide titleModeType: titleType = { + free: 'NavigationTitleMode.Free', + full: 'NavigationTitleMode.Full', + mini: 'NavigationTitleMode.Mini', + } + @State currentIndex: number = 0 + @State navHeight: string = '60%' + @State title: string = 'title' + @State Build: BuildSize[] = [ + { + text: '0', + num: 0 + }, + { + text: '1', + num: 1 + }, + { + text: '2', + num: 2 + } + ] + @State backButton: boolean = false + + @Builder + NavigationToolbar() { + Row() { + ForEach(this.Build, (item: BuildSize) => { + Column() { + Image(this.currentIndex == item.num ? './image/ic_public_highlightsed.svg' : + './image/ic_public_highlights.svg') + .width(24) + .height(24) + Text(item.text) + .fontColor(this.currentIndex == item.num ? '#007DFF' : '#182431') + .fontSize(10) + .lineHeight(14) + .fontWeight(500) + .margin({ top: 3 }) + }.width('30%').height(56).backgroundColor(Color.Yellow) + .onClick(() => { + this.currentIndex = item.num + }) + }) + }.width('100%').backgroundColor(Color.Pink).justifyContent(FlexAlign.Center) + } + + @Provide('pathInfos') pathInfos: NavPathStack = new NavPathStack() + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State navBarWidth: number = 200 + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @Provide navBarPositionType: navBarType = { + start: 'NavBarPosition.Start', + end: 'NavBarPosition.End' + } + @State navBarPosition: NavBarPosition = NavBarPosition.Start + @Provide modeType: modeType = { + stack: 'NavBarPosition.Stack', + split: 'NavBarPosition.Split', + auto: 'NavigationMode.Auto' + } + @State mode: NavigationMode = NavigationMode.Stack + + // Navigation的navDestination属性方法设置的构建函数,在路由栈变化时触发该构建函数创建新的路由页面。 + @Builder + myRouter(name: string, param: string) { + MyFirstIndex({ name: name, value: param }) + } + + @State mainTitle: string = 'title是NavigationCommonTitle类型' + @State subTitle: string = 'title是NavigationCommonTitle类型' + @State isVisible: boolean = false + @State isRefreshing: boolean = false + private contentNode?: ComponentContent = undefined + @State navigationCommonTitle: NavigationCommonTitle = { main: this.mainTitle, sub: this.subTitle } + + build() { + Column() { + Navigation(this.pathInfos) { + TextInput({ text: this.mainTitle, placeholder: 'title...' }) + .onChange((value: string) => { + this.mainTitle = value + }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + + TextInput({ text: this.subTitle, placeholder: 'title...' }) + .onChange((value: string) => { + this.subTitle = value + }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + Refresh({ refreshing: $$this.isRefreshing, refreshingContent: this.contentNode }) { + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + NavRouter({ name: 'Page' + item, param: "this is page" + item }) { + Row() { + Flex({ wrap: FlexWrap.Wrap }) { + if (item == 0) { + Row() { + Text('titleMode:' + this.titleMode).width('100%') + } + + Button('titleMode为NavigationTitleMode.Mini').onClick(() => { + this.titleMode = NavigationTitleMode.Mini + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('titleMode为NavigationTitleMode.Free').onClick(() => { + this.titleMode = NavigationTitleMode.Free + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('titleMode为NavigationTitleMode.Full').onClick(() => { + this.titleMode = NavigationTitleMode.Full + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 1) { + Row() { + Text('hideTitleBar:' + this.hideTitleBar).width('100%') + } + + Button('hideTitleBar=true').onClick(() => { + this.hideTitleBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideTitleBar=false').onClick(() => { + this.hideTitleBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 2) { + Row() { + Text('hideToolBar:' + this.hideToolBar).width('100%') + } + + Button('hideToolBar=true').onClick(() => { + this.hideToolBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideToolBar=false').onClick(() => { + this.hideToolBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 3) { + Row() { + Text('navBarWidth:' + this.navBarWidth).width('100%') + + } + + Button('navBarWidth++').onClick(() => { + this.navBarWidth++ + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('navBarWidth--').onClick(() => { + this.navBarWidth-- + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 4) { + Row() { + Text('navBarPosition:' + this.navBarPosition).width('100%') + } + + Button('navBarPosition=Start').onClick(() => { + this.navBarPosition = NavBarPosition.Start + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('navBarPosition=End').onClick(() => { + this.navBarPosition = NavBarPosition.End + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 5) { + Row() { + Text('mode:' + this.mode).width('100%') + } + + Button('mode=NavigationMode.Auto').onClick(() => { + this.mode = NavigationMode.Auto + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('mode=NavigationMode.Stack').onClick(() => { + this.mode = NavigationMode.Stack + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('mode=NavigationMode.Split').onClick(() => { + this.mode = NavigationMode.Split + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 6) { + Row() { + Text('menus数量:' + this.menus.length).width('100%') + } + + Button('menus+1').onClick(() => { + this.menus.push({ + value: this.menus.length + 1 + '', + icon: "/image/ic_public_view_list_filled.svg", + action: () => { + } + }) + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('menus-1').onClick(() => { + this.menus.splice(this.menus.length - 1, 1) + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 7) { + Row() { + Text('backButton:' + this.backButton).width('100%') + } + + Button('backButton=false').onClick(() => { + this.backButton = false + + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('backButton=true').onClick(() => { + this.backButton = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 8) { + Row() { + Text('hideNavBar:' + this.hideNavBar).width('100%') + } + + Button('hideNavBar=false').onClick(() => { + this.hideNavBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideNavBar=true').onClick(() => { + this.hideNavBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if ([9, 11].includes(item)) { + Text('' + item) + .height(72) + .width('10%') + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Start) + } + } + }.width('90%').borderRadius(24).backgroundColor('#FFFFFF') + }.onStateChange((isActivated: boolean) => { + prompt.showToast({ message: 'isActivated' + isActivated }) + }) + }.editable(true) + }, (item: string) => item) + } + .height(this.navHeight) + .width('100%') + .margin({ top: 12, left: '10%' }) + .id('list') + }.onOffsetChange((num: number) => { + if (num > 60) { + this.isRefreshing = false + setTimeout(()=>{ + + this.navigationCommonTitle = { main: this.mainTitle, sub: this.subTitle } + },1000) + return + } + + if (num > 30) { + this.navigationCommonTitle = { main: "", sub: this.subTitle } + } + }) + } + .onNavBarStateChange((isVisible: boolean) => { + this.isVisible = isVisible + console.log('NavBarStateChange:' + this.isVisible) + }) + .title(this.navigationCommonTitle) + .menus(this.menus) + .titleMode(this.titleMode) + .toolBar(this.NavigationToolbar) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .navBarPosition(this.navBarPosition) + .navDestination(this.myRouter) + .hideBackButton(this.backButton) + .hideTitleBar(this.hideTitleBar) + .hideNavBar(this.hideNavBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([200, 432]) + .minContentWidth('50vp') + .mode(this.mode) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction1030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction1030.ets new file mode 100755 index 000000000..fa8fbbbfb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActionTest/ComponentNavNavigationAction1030.ets @@ -0,0 +1,395 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import prompt from '@system.prompt'; + +@Component +export struct MyFirstIndex { + @Consume('pathInfos') pathInfos: NavPathStack + name: string = '' + @State value: string = '' + + build() { + NavDestination() { + Text(this.value) + }.title(this.name) + .backgroundColor(Color.Orange) + } +} + +interface menuitem { + value: string, + icon: string, + action: () => void +} + +interface titleType { + free: string, + full: string, + mini: string +} + +interface navBarType { + start: string, + end: string, + +} + +interface BuildSize { + text: string, + num: number +} + +interface modeType { + stack: string, + split: string, + auto: string +} + +@Entry +@Component +struct ComponentNavNavigationAction1030 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + @State menus: menuitem[] = [ + { + value: "1", icon: "/image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "2", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "3", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "4", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "5", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "6", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "7", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "8", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "9", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + }, + { + value: "10", icon: "./image/ic_public_view_list_filled.svg", action: () => { + } + } + ] + //hideBackButton + @Provide titleModeType: titleType = { + free: 'NavigationTitleMode.Free', + full: 'NavigationTitleMode.Full', + mini: 'NavigationTitleMode.Mini', + } + @State currentIndex: number = 0 + @State navHeight: string = '60%' + @State title: string = 'title' + @State Build: BuildSize[] = [ + { + text: '0', + num: 0 + }, + { + text: '1', + num: 1 + }, + { + text: '2', + num: 2 + } + ] + @State backButton: boolean = false + + @Builder + NavigationToolbar() { + Row() { + ForEach(this.Build, (item: BuildSize) => { + Column() { + Image(this.currentIndex == item.num ? './image/ic_public_highlightsed.svg' : + './image/ic_public_highlights.svg') + .width(24) + .height(24) + Text(item.text) + .fontColor(this.currentIndex == item.num ? '#007DFF' : '#182431') + .fontSize(10) + .lineHeight(14) + .fontWeight(500) + .margin({ top: 3 }) + }.width('30%').height(56).backgroundColor(Color.Yellow) + .onClick(() => { + this.currentIndex = item.num + }) + }) + }.width('100%').backgroundColor(Color.Pink).justifyContent(FlexAlign.Center) + } + + @Provide('pathInfos') pathInfos: NavPathStack = new NavPathStack() + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State navBarWidth: number = 200 + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @Provide navBarPositionType: navBarType = { + start: 'NavBarPosition.Start', + end: 'NavBarPosition.End' + } + @State navBarPosition: NavBarPosition = NavBarPosition.Start + @Provide modeType: modeType = { + stack: 'NavBarPosition.Stack', + split: 'NavBarPosition.Split', + auto: 'NavigationMode.Auto' + } + @State mode: NavigationMode = NavigationMode.Stack + + // Navigation的navDestination属性方法设置的构建函数,在路由栈变化时触发该构建函数创建新的路由页面。 + @Builder + myRouter(name: string, param: string) { + MyFirstIndex({ name: name, value: param }) + } + + @State mainTitle: string = 'title是NavigationCommonTitle类型' + @State subTitle: string = 'title是NavigationCommonTitle类型' + @State isVisible: boolean = false + @State isRefreshing: boolean = false + private contentNode?: ComponentContent = undefined + @State navigationCommonTitle: NavigationCommonTitle = { main: this.mainTitle, sub: this.subTitle } + + build() { + Column() { + Navigation(this.pathInfos) { + TextInput({ text: this.mainTitle, placeholder: 'title...' }) + .onChange((value: string) => { + this.mainTitle = value + }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + + TextInput({ text: this.subTitle, placeholder: 'title...' }) + .onChange((value: string) => { + this.subTitle = value + }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + Refresh({ refreshing: $$this.isRefreshing, refreshingContent: this.contentNode }) { + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + NavRouter({ name: 'Page' + item, param: "this is page" + item }) { + Row() { + Flex({ wrap: FlexWrap.Wrap }) { + if (item == 0) { + Row() { + Text('titleMode:' + this.titleMode).width('100%') + } + + Button('titleMode为NavigationTitleMode.Mini').onClick(() => { + this.titleMode = NavigationTitleMode.Mini + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('titleMode为NavigationTitleMode.Free').onClick(() => { + this.titleMode = NavigationTitleMode.Free + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('titleMode为NavigationTitleMode.Full').onClick(() => { + this.titleMode = NavigationTitleMode.Full + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 1) { + Row() { + Text('hideTitleBar:' + this.hideTitleBar).width('100%') + } + + Button('hideTitleBar=true').onClick(() => { + this.hideTitleBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideTitleBar=false').onClick(() => { + this.hideTitleBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 2) { + Row() { + Text('hideToolBar:' + this.hideToolBar).width('100%') + } + + Button('hideToolBar=true').onClick(() => { + this.hideToolBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideToolBar=false').onClick(() => { + this.hideToolBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 3) { + Row() { + Text('navBarWidth:' + this.navBarWidth).width('100%') + + } + + Button('navBarWidth++').onClick(() => { + this.navBarWidth++ + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('navBarWidth--').onClick(() => { + this.navBarWidth-- + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 4) { + Row() { + Text('navBarPosition:' + this.navBarPosition).width('100%') + } + + Button('navBarPosition=Start').onClick(() => { + this.navBarPosition = NavBarPosition.Start + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('navBarPosition=End').onClick(() => { + this.navBarPosition = NavBarPosition.End + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 5) { + Row() { + Text('mode:' + this.mode).width('100%') + } + + Button('mode=NavigationMode.Auto').onClick(() => { + this.mode = NavigationMode.Auto + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('mode=NavigationMode.Stack').onClick(() => { + this.mode = NavigationMode.Stack + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('mode=NavigationMode.Split').onClick(() => { + this.mode = NavigationMode.Split + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 6) { + Row() { + Text('menus数量:' + this.menus.length).width('100%') + } + + Button('menus+1').onClick(() => { + this.menus.push({ + value: this.menus.length + 1 + '', + icon: "/image/ic_public_view_list_filled.svg", + action: () => { + } + }) + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('menus-1').onClick(() => { + this.menus.splice(this.menus.length - 1, 1) + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 7) { + Row() { + Text('backButton:' + this.backButton).width('100%') + } + + Button('backButton=false').onClick(() => { + this.backButton = false + + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('backButton=true').onClick(() => { + this.backButton = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if (item == 8) { + Row() { + Text('hideNavBar:' + this.hideNavBar).width('100%') + } + + Button('hideNavBar=false').onClick(() => { + this.hideNavBar = false + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + Button('hideNavBar=true').onClick(() => { + this.hideNavBar = true + }).margin({ bottom: 10 }).clickEffect({ level: this.Click, scale: 0.8 }) + } + if ([9, 11].includes(item)) { + Text('' + item) + .height(72) + .width('10%') + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Start) + } + } + }.width('90%').borderRadius(24).backgroundColor('#FFFFFF') + }.onStateChange((isActivated: boolean) => { + prompt.showToast({ message: 'isActivated:' + isActivated }) + }) + }.editable(true) + }, (item: string) => item) + } + .height(this.navHeight) + .width('100%') + .margin({ top: 12, left: '10%' }) + .id('list') + }.onOffsetChange((num: number) => { + if (num > 60) { + this.isRefreshing = false + setTimeout(()=>{ + + this.navigationCommonTitle = { main: this.mainTitle, sub: this.subTitle } + },1000) + return + } + + if (num > 30) { + this.navigationCommonTitle = { main: "", sub: this.subTitle } + } + }) + } + .onNavBarStateChange((isVisible: boolean) => { + this.isVisible = isVisible + console.log('NavBarStateChange:' + this.isVisible) + }) + .title(this.navigationCommonTitle) + .menus(this.menus) + .titleMode(this.titleMode) + .toolBar(this.NavigationToolbar) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .navBarPosition(this.navBarPosition) + .navDestination(this.myRouter) + .hideBackButton(this.backButton) + .hideTitleBar(this.hideTitleBar) + .hideNavBar(this.hideNavBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([200, 432]) + .minContentWidth('50vp') + .mode(this.mode) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010.ets new file mode 100755 index 000000000..7ca98cd87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0010.ets @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0010 { + @Provide('pageInfo') pageInfo: NavPathStack = new NavPathStack(); + @State @Watch("info") message: number = 0; + @State logNumber: number = 0; + info() { + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneStack({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageTwo') { + pageTwoStack({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageThree') { + pageThreeStack({message: this.message, logNumber: this.logNumber}); + } + } + + build() { + Column({space: 5 }) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + Navigation(this.pageInfo) { + Column() { + Button('Next Page', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageOne' }); + }) + } + }.title('NavIndex') + .navDestination(this.PageMap) + .mode(NavigationMode.Split) + .borderWidth(1) + } + } +} + +@Component +struct pageOneStack{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 1 + @Link message: number; + @Link logNumber: number + build() { + NavDestination() { + Column() { + NavigationContentMsgStack({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page1', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageTwo' }); + }) + + + }.width('100%').height('100%') + }.title('pageOne') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageTwoStack{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 2; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page2', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageThree' }); + }) + + }.width('100%').height('100%') + }.title('pageTwo') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageThreeStack{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 3; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Button('Back Page', { stateEffect: true, type: ButtonType.Capsule }) + .id('back') + .height(40) + .onClick(() => { + this.pageInfo.pop(); + }) + + }.width('100%').height('100%') + }.title('pageThree') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component({ freezeWhenInactive: false }) +struct NavigationContentMsgStack { + @Link @Watch("info") message: number; + @Link index: number; + @Link logNumber: number; + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020.ets new file mode 100755 index 000000000..0eda8686e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0020.ets @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0020 { + @Provide('pageInfo') pageInfo: NavPathStack = new NavPathStack(); + @State @Watch("info") message: number = 0; + @State logNumber: number = 0; + info() { + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneStack1({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageTwo') { + pageTwoStack1({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageThree') { + pageThreeStack1({message: this.message, logNumber: this.logNumber}); + } + } + + build() { + Column({space: 5 }) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + Navigation(this.pageInfo) { + Column() { + Button('Next Page', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageOne' }); + }) + } + }.title('NavIndex') + .navDestination(this.PageMap) + .mode(NavigationMode.Split) + .borderWidth(1) + } + } +} + +@Component +struct pageOneStack1{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 1 + @Link message: number; + @Link logNumber: number + build() { + NavDestination() { + Column() { + NavigationContentMsgStack1({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page1', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageTwo' }); + }) + + + }.width('100%').height('100%') + }.title('pageOne') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageTwoStack1{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 2; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack1({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page2', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageThree' }); + }) + + }.width('100%').height('100%') + }.title('pageTwo') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageThreeStack1{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 3; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack1({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Button('Back Page', { stateEffect: true, type: ButtonType.Capsule }) + .id('back') + .height(40) + .onClick(() => { + this.pageInfo.pop(); + }) + + }.width('100%').height('100%') + }.title('pageThree') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component({ freezeWhenInactive: true }) +struct NavigationContentMsgStack1 { + @Link @Watch("info") message: number; + @Link index: number; + @Link logNumber: number; + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030.ets new file mode 100755 index 000000000..3f0a2a58b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0030.ets @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0030 { + @Provide('pageInfo') pageInfo: NavPathStack = new NavPathStack(); + @State @Watch("info") message: number = 0; + @State logNumber: number = 0; + info() { + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneStack2({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageTwo') { + pageTwoStack2({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageThree') { + pageThreeStack2({message: this.message, logNumber: this.logNumber}); + } + } + + build() { + Column({space: 5 }) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + Navigation(this.pageInfo) { + Column() { + Button('Next Page', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageOne' }); + }) + } + }.title('NavIndex') + .navDestination(this.PageMap) + .mode(NavigationMode.Stack) + .borderWidth(1) + } + } +} + +@Component +struct pageOneStack2{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 1 + @Link message: number; + @Link logNumber: number + build() { + NavDestination() { + Column() { + NavigationContentMsgStack2({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page1', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageTwo' }); + }) + + + }.width('100%').height('100%') + }.title('pageOne') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageTwoStack2{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 2; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack2({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page2', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageThree' }); + }) + + }.width('100%').height('100%') + }.title('pageTwo') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageThreeStack2{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 3; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack2({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Button('Back Page', { stateEffect: true, type: ButtonType.Capsule }) + .id('back') + .height(40) + .onClick(() => { + this.pageInfo.pop(); + }) + + }.width('100%').height('100%') + }.title('pageThree') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component({ freezeWhenInactive: false }) +struct NavigationContentMsgStack2 { + @Link @Watch("info") message: number; + @Link index: number; + @Link logNumber: number; + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040.ets new file mode 100755 index 000000000..ac24a37e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0040.ets @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0040 { + @Provide('pageInfo') pageInfo: NavPathStack = new NavPathStack(); + @State @Watch("info") message: number = 0; + @State logNumber: number = 0; + info() { + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneStack3({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageTwo') { + pageTwoStack3({message: this.message, logNumber: this.logNumber}); + } else if (name === 'pageThree') { + pageThreeStack3({message: this.message, logNumber: this.logNumber}); + } + } + + build() { + Column({space: 5 }) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + Navigation(this.pageInfo) { + Column() { + Button('Next Page', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageOne' }); + }) + } + }.title('NavIndex') + .navDestination(this.PageMap) + .mode(NavigationMode.Stack) + .borderWidth(1) + } + } +} + +@Component +struct pageOneStack3{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 1 + @Link message: number; + @Link logNumber: number + build() { + NavDestination() { + Column() { + NavigationContentMsgStack3({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page1', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageTwo' }); + }) + + + }.width('100%').height('100%') + }.title('pageOne') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageTwoStack3{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 2; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack3({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Button('Next Page2', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfo.pushPath({ name: 'pageThree' }); + }) + + }.width('100%').height('100%') + }.title('pageTwo') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component +struct pageThreeStack3{ + @Consume('pageInfo') pageInfo: NavPathStack; + @State index: number = 3; + @Link message: number; + @Link logNumber: number; + + build() { + NavDestination() { + Column() { + NavigationContentMsgStack3({message: this.message, index: this.index, logNumber: this.logNumber}) + Text("cur stack size:" + `${this.pageInfo.size()}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Button('Back Page', { stateEffect: true, type: ButtonType.Capsule }) + .id('back') + .height(40) + .onClick(() => { + this.pageInfo.pop(); + }) + + }.width('100%').height('100%') + }.title('pageThree') + .onBackPressed(() => { + this.pageInfo.pop(); + return true; + }) + } +} + +@Component({ freezeWhenInactive: true }) +struct NavigationContentMsgStack3 { + @Link @Watch("info") message: number; + @Link index: number; + @Link logNumber: number; + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050.ets new file mode 100755 index 000000000..73ebc2802 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050.ets @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component({ freezeWhenInactive: false }) +struct ComponentNavNavigationActive0050 { + @StorageLink('freezeWhenInactive_Navigator_mes') + @Watch("first") message: number = 0; + @StorageLink('freezeWhenInactive_Navigator_logNum') + logNumber: number = 0; + first(){ + this.logNumber++ + } + + build() { + Column({space:10}){ + Button('change message:') + .id('change') + .onClick(() => { + this.message++ + }) + + Text('logNum:' + this.logNumber) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + + Navigator({ target: 'testability/pages/ComponentNavNavigationActive/Details', type: NavigationType.Push }) { + Text('Details').backgroundColor(Color.Pink).height('50vp').id('Details') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060.ets new file mode 100755 index 000000000..e937c9f89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060.ets @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component({ freezeWhenInactive: true }) +struct ComponentNavNavigationActive0060 { + @StorageLink('freezeWhenInactive_Navigator_mes') + @Watch("first") message: number = 0; + @StorageLink('freezeWhenInactive_Navigator_logNum') + logNumber: number = 0; + first(){ + this.logNumber++ + } + + build() { + Column({space:10}){ + Button('change message:') + .id('change') + .onClick(() => { + this.message++ + }) + + Text('logNum:' + this.logNumber) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + + Navigator({ target: 'testability/pages/ComponentNavNavigationActive/Details1', type: NavigationType.Push }) { + Text('Details').backgroundColor(Color.Pink).height('50vp').id('Details') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0070.ets new file mode 100755 index 000000000..940c10615 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0070.ets @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0070 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + @State message: number = 0 + @State logNumber: number = 0 + + + build() { + Column({space:10}) { + Button('change message:' +this.message) + .id('change') + .onClick(() => { + this.message++ + }) + + Navigation() { + NavRouter() { + Row() { + Text("index1") + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('90%') + .height(72) + + NavDestination() { + NavRouterContentMsg2({message: this.message, logNumber: this.logNumber}) + }.hideTitleBar(false).backgroundColor('#0c182431') + + }.backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(24) + .mode(NavRouteMode.PUSH) + .onStateChange((isActivated: boolean) => { + this.isActiveWLAN = isActivated + }) + + NavRouter() { + Row() { + Text("index2" ) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('90%') + .height(72) + + NavDestination() { + NavRouterContentMsg2({message: this.message, logNumber: this.logNumber}) + }.hideTitleBar(false).backgroundColor('#0c182431') + + }.backgroundColor(this.isActiveBluetooth ? '#ccc' : '#fff') + .borderRadius(24) + .mode(NavRouteMode.PUSH) + .onStateChange((isActivated: boolean) => { + this.isActiveBluetooth = isActivated + }) + } + .title('设置') + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Split) + .navBarWidth(140) + .hideTitleBar(false) + .hideToolBar(true) + }.height('100%') + } +} + + +@Component({ freezeWhenInactive: false }) +struct NavRouterContentMsg2 { + + @Link @Watch("info") message: number + @Link logNumber: number + + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0080.ets new file mode 100755 index 000000000..335d96ed7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0080.ets @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0080 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + @State message: number = 0 + @State logNumber: number = 0 + + + build() { + Column({space:10}) { + Button('change message:' +this.message) + .id('change') + .onClick(() => { + this.message++ + }) + + Navigation() { + NavRouter() { + Row() { + Text("index1") + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('90%') + .height(72) + + NavDestination() { + NavRouterContentMsg3({message: this.message, logNumber: this.logNumber}) + }.hideTitleBar(false).backgroundColor('#0c182431') + + }.backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(24) + .mode(NavRouteMode.PUSH) + .onStateChange((isActivated: boolean) => { + this.isActiveWLAN = isActivated + }) + + NavRouter() { + Row() { + Text("index2" ) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('90%') + .height(72) + + NavDestination() { + NavRouterContentMsg3({message: this.message, logNumber: this.logNumber}) + }.hideTitleBar(false).backgroundColor('#0c182431') + + }.backgroundColor(this.isActiveBluetooth ? '#ccc' : '#fff') + .borderRadius(24) + .mode(NavRouteMode.PUSH) + .onStateChange((isActivated: boolean) => { + this.isActiveBluetooth = isActivated + }) + } + .title('设置') + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Split) + .navBarWidth(140) + .hideTitleBar(false) + .hideToolBar(true) + }.height('100%') + } +} + + +@Component({ freezeWhenInactive: true }) +struct NavRouterContentMsg3 { + + @Link @Watch("info") message: number + @Link logNumber: number + + info() { + this.logNumber ++ + } + build() { + Column() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + Text("log number:" + `${this.logNumber}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090.ets new file mode 100755 index 000000000..441505a06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0090.ets @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0090 { + normalIcon: Resource = $r("app.media.icon"); + selectedIcon: Resource = $r("app.media.icon"); + @State message: number = 0; + @State current: number = 1; + @State logNumber: number = 0; + @State show1: boolean = true; + + build() { + Column({space:10}) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + + Button('showSideBar' + this.show1) + .id('show') + .onClick(() => { + this.show1 = !this.show1; + }) + + + SideBarContainer(SideBarContainerType.Embed) { + Column() { + SideBarContentMsg1({message: this.message, logNumber: this.logNumber}) + }.width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + .backgroundColor('#19000000') + + Column() { + Text('log number: ' + `${this.logNumber}`) + .fontSize(30) + } + .margin({ top: 50, left: 20, right: 30 }) + } + .height('90%') + .sideBarWidth(120) + .minSideBarWidth(50) + .maxSideBarWidth(300) + .id('SideBarContainer') + .minContentWidth(0) + .showSideBar($$this.show1) + .divider({ strokeWidth: '1vp', color: Color.Gray, startMargin: '4vp', endMargin: '4vp' }) + } + } +} + +@Component({ freezeWhenInactive: false }) +struct SideBarContentMsg1 { + @Link @Watch("info") message: number; + @Link logNumber: number; + info() { + this.logNumber++; + } + build() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100.ets new file mode 100755 index 000000000..f39092b77 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0100.ets @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ComponentNavNavigationActive0100 { + normalIcon: Resource = $r("app.media.icon"); + selectedIcon: Resource = $r("app.media.icon"); + @State message: number = 0; + @State current: number = 1; + @State logNumber: number = 0; + @State show1: boolean = true; + + build() { + Column({space:10}) { + Button('change message' +this.message) + .id('change') + .onClick(() => { + this.message++; + }) + + Button('showSideBar' + this.show1) + .id('show') + .onClick(() => { + this.show1 = !this.show1; + }) + + + SideBarContainer(SideBarContainerType.Embed) { + Column() { + SideBarContentMsg({message: this.message, logNumber: this.logNumber}) + }.width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + .backgroundColor('#19000000') + + Column() { + Text('log number: ' + `${this.logNumber}`) + .fontSize(30) + } + .margin({ top: 50, left: 20, right: 30 }) + } + .height('90%') + .sideBarWidth(120) + .minSideBarWidth(50) + .maxSideBarWidth(300) + .id('SideBarContainer') + .minContentWidth(0) + .showSideBar($$this.show1) + .divider({ strokeWidth: '1vp', color: Color.Gray, startMargin: '4vp', endMargin: '4vp' }) + } + } +} + +@Component({ freezeWhenInactive: true }) +struct SideBarContentMsg { + @Link @Watch("info") message: number; + @Link logNumber: number; + info() { + this.logNumber++; + } + build() { + Text("msg:" + `${this.message}`) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details.ets new file mode 100755 index 000000000..88936e97d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details.ets @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component({ freezeWhenInactive: false }) +struct Details { + // 接收Navigator.ets的传参 + @StorageLink('freezeWhenInactive_Navigator_mes') + @Watch("info") message: number = 0 + @StorageLink('freezeWhenInactive_Navigator_logNum') + logNumber: number = 0; + + info () { + this.logNumber++ + } + + build() { + Column({space:10}){ + Button('change message:') + .id('change') + .onClick(() => { + this.message++ + }) + + Text('logNum:' + this.logNumber) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Navigator({ target: 'testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0050', type: NavigationType.Back }) { + Text('Back to first page').backgroundColor(Color.Pink).height('50vp').id('back') + } + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details1.ets new file mode 100755 index 000000000..664ef28d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationActive/Details1.ets @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component({ freezeWhenInactive: true }) +struct Details1 { + // 接收Navigator.ets的传参 + @StorageLink('freezeWhenInactive_Navigator_mes') + @Watch("info") message: number = 0 + @StorageLink('freezeWhenInactive_Navigator_logNum') + logNumber: number = 0; + + info () { + this.logNumber++ + } + + build() { + Column({space:10}){ + Button('change message:') + .id('change') + .onClick(() => { + this.message++ + }) + + Text('logNum:' + this.logNumber) + .fontSize(30) + .fontWeight(FontWeight.Bold) + + Navigator({ target: 'testability/pages/ComponentNavNavigationActive/ComponentNavNavigationActive0060', type: NavigationType.Back }) { + Text('Back to first page').backgroundColor(Color.Pink).height('50vp').id('back') + } + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110.ets new file mode 100755 index 000000000..27642f4c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0110.ets @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageTwo') + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0110 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .navDestination(this.myRouter) + .mode(NavigationMode.Stack) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0150.ets new file mode 100755 index 000000000..4eabfb358 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0150.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon(null) + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(new SymbolGlyphModifier($r('sys.symbol.ohos_star')).fontColor([Color.Blue])) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0150 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Stack) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0160.ets new file mode 100755 index 000000000..4d15a946c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0160.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon(undefined) + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(new SymbolGlyphModifier($r('sys.symbol.ohos_star')).fontColor([Color.Blue])) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0160 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Stack) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0170.ets new file mode 100755 index 000000000..5d2a36779 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0170.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon('') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(new SymbolGlyphModifier($r('sys.symbol.ohos_star')).fontColor([Color.Blue])) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0170 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Stack) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0180.ets new file mode 100755 index 000000000..be3a05da6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0180.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon('abcd') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(new SymbolGlyphModifier($r('sys.symbol.ohos_star')).fontColor([Color.Blue])) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0180 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Stack) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240.ets new file mode 100755 index 000000000..c99f1c25a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0240.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon(null) + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(null) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0240 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Split) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250.ets new file mode 100755 index 000000000..03ac4071d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0250.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon(undefined) + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon(undefined) + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0250 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(360) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Split) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260.ets new file mode 100755 index 000000000..a47e318dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0260.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon('') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon('') + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0260 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(200) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Split) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270.ets new file mode 100755 index 000000000..3aed0c9f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationBack/ComponentNavNavigationBack0270.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from "@kit.ArkUI" + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageOne') + .backButtonIcon('abcd') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } + .title('PageTwo') + .backButtonIcon('abcd') + } +} + +@Entry +@Component +struct ComponentNavNavigationBack0270 { + @State pageInfos: NavPathStack = new NavPathStack(); + @State message: string = ""; + @State titleMode: NavigationTitleMode= NavigationTitleMode.Full; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pageOne') + .onClick(() => { + console.info('PageOne') + this.pageInfos.pushDestinationByName('PageOne', 'id'); + }) + .id('pageOne') + Button('pageTwo') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null); + }) + .id('pageTwo') + } + } + .navBarWidth(200) + .title('navigation') + .titleMode(this.titleMode) + .navDestination(this.myRouter) + .mode(NavigationMode.Split) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0010.ets new file mode 100755 index 000000000..8e85cfd50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0010.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0010 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([280, 500]) + .navBarWidth(300) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0020.ets new file mode 100755 index 000000000..00570f3d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0020.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0020 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([300, 500]) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0030.ets new file mode 100755 index 000000000..8e85cfd50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0030.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0010 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([280, 500]) + .navBarWidth(300) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0040.ets new file mode 100755 index 000000000..f7b76ebf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0040.ets @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0040 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([200, 400]) + .navBarWidth(260) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0050.ets new file mode 100755 index 000000000..b13718726 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0050.ets @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0050 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([300, 300]) + .navBarWidth(260) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0060.ets new file mode 100755 index 000000000..a0d1845d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0060.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationCapability0060 { + private stack : NavPathStack = new NavPathStack(); + + build() { + Navigation(this.stack) { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .navBarWidthRange([300,200]) + .width(260) + .height('100%') + .title('Navigation') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0070.ets new file mode 100755 index 000000000..27ee0e197 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0070.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationCapability0070 { + private stack : NavPathStack = new NavPathStack(); + + build() { + Navigation(this.stack) { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .navBarWidthRange([-2,400]) + .width(260) + .height('100%') + .title('Navigation') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0080.ets new file mode 100755 index 000000000..d7e9d0561 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0080.ets @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + .backgroundColor('#f1f3f5') + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0080 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([280, 400]) + .navBarWidth(260) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0160.ets new file mode 100755 index 000000000..dc3398523 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationCapabilityTest/ComponentNavNavigationCapability0160.ets @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationCapability0160 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + @Builder + CustomDivider() { + Divider() + .strokeWidth('1px') + .color($r('sys.color.ohos_id_color_list_separator')) + .margin({ left: 8, right: 8 }) + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([300, 600]) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog.ets new file mode 100755 index 000000000..8b601a860 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationDialog/ComponentNavNavigationDialog.ets @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class MyParam { + operation: number = 1 + text: string = '' +} + +@Component +export struct PageOne { + @Link lifeCycle:string; + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "PageTwo click logInfo:\n"; + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Column() { + Button('PushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.text = 'PageOne click accept'; + }) + Text('' + this.text) + // Text('' + this.lifeCycle).width('90%').borderWidth(2).borderColor(Color.Blue) + } + .width(350) + .height(400).borderWidth(1).borderColor(Color.Yellow) + } + .title('PageOne') + .hitTestBehavior(HitTestMode.None) + .onWillAppear(() => { + this.lifeCycle += "testTag PageOne onWillAppear \n" + }) + .onWillShow(() => { + this.lifeCycle += "testTag PageOne onWillShow \n" + }) + .onShown(() => { + this.lifeCycle += "testTag PageOne onShown \n" + }) + .onAppear(() => { + this.lifeCycle += "testTag PageOne onAppear \n"; + }) + .onHidden(() => { + this.lifeCycle += "\nTODO background:\ntestTag PageOne onHidden \n"; + }) + .mode(NavDestinationMode.DIALOG) + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Component +export struct PageTwo { + @Link lifeCycle:string; + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "PageTwo click logInfo:\n"; + @State num: number = 0; + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Column() { + Button('PushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.text = 'pageTwo click accept'; + }) + Button('getSize222', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn6') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.num = this.pageInfos?.size(); + this.text = 'log:pageTwo getSize222 Click accept'; + }) + Text('' + this.num) + Text('' + this.text) + } + .width(300) + .height(350).borderWidth(1) + } + .title('PageTwo') + .onWillAppear(() => { + this.lifeCycle += "testTag PageTwo onWillAppear \n" + }) + .onWillShow(() => { + this.lifeCycle += "testTag PageTwo onWillShow \n" + }) + .onShown(() => { + this.lifeCycle += "testTag PageTwo onShown \n" + }) + .onAppear(() => { + this.lifeCycle += "testTag PageTwo onAppear \n"; + }) + .onHidden(() => { + this.lifeCycle += "\nTODO background:\ntestTag PageTwo onHidden \n"; + }) + .mode(NavDestinationMode.DIALOG) + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Component +struct pageThree { + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "pageThree click logInfo:\n"; + @State text2: string = "none"; + @State lifeCycle: string = "LifeCycle pageThree: \n"; + @State number: number = 1 + @State number2: number = 1 + + aboutToAppear() { + } + + build() { + NavDestination() { + Column() { + Button('getSize11', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn4') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.number2 = this.pageInfos.size(); + this.text = 'log:pageThree getSize11 Click accept'; + }) + Text('' + this.number2).fontSize(30).fontColor(Color.Orange) + Button('getSize222', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn5') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.number = this.pageInfos.size(); + this.text = 'log:pageThree getSize222 Click accept'; + }) + Text('' + this.number).fontSize(30).fontColor(Color.Orange) + Text(this.text) + .fontSize(20) + .borderWidth(5) + .borderColor(Color.Blue) + .width('80%') + .margin({ top: 10 }) + /*Text(this.lifeCycle) + .fontSize(20) + .borderWidth(5) + .borderColor(Color.Green) + .width('80%') + .margin({ top: 10 })*/ + }.backgroundColor('#ddeeff66') + .width('90%') + .height(400).borderWidth(1) + } + .onWillAppear(() => { + this.lifeCycle += "testTag pageOne onWillAppear" + }) + .onWillShow(() => { + this.lifeCycle += "testTag pageOne onWillShow" + }) + .onShown(() => { + this.lifeCycle += "testTag pageOne " + }) + .onAppear(() => { + this.lifeCycle += "testTag pageOne "; + }) + .title('pageThree') + .mode(NavDestinationMode.STANDARD) + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationDialog { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + @State mode: number = NavigationMode.Auto; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOne({ + lifeCycle:this.lifeCycle + }) + } else if (name === 'pageTwo') { + PageTwo({ lifeCycle: this.lifeCycle }) + } else if (name === 'pageThree') { + pageThree() + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + + } + } + .mode(this.mode) + .width('100%') + .height('50%') + .navDestination(this.PageMap) + .title("Navigation") + + Scroll() { + Column() { + Text(this.lifeCycle).width('80%') + .margin({ top: 10 }).fontColor(Color.Brown).borderWidth(5).borderColor(Color.Orange) + Button('Push Page One', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn1') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('Push Page Two', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn2') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.pageInfos.pushPath({ name: 'pageTwo', param: p }) + }) + Button('Push Page Three', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn3') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.pageInfos.pushPath({ name: 'pageThree', param: p }) + }) + Button('双栏', { stateEffect: true, type: ButtonType.Capsule }) + .id('dialog_btn') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.text = 'log:pageThree 双栏 Click accept'; + this.mode = NavigationMode.Split; + }) + }.width('100%').height(350) + }.width('100%').height(380).borderWidth(2).borderColor(Color.Red) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010.ets new file mode 100755 index 000000000..513a04776 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationExpandSafeArea0010 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State _navWidth: number | string = '100%'; + @State _navHeight: number | string = '100%'; + @State _Width: number | string = '100%'; + @State _Height: number | string = '100%'; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('text: ' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .width(this._navWidth) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Mini) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020.ets new file mode 100755 index 000000000..b828d11a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0020.ets @@ -0,0 +1,332 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationExpandSafeArea0010 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State currentIndex: number = 0 + @State _navWidth: number | string = '100%'; + @State _navHeight: number | string = '100%'; + @State _Width: number | string = '100%'; + @State _Height: number | string = '100%'; + @State _navMarginTopBottom: number | string = 0; + @State _navMarginLeftRight: number | string = 0; + @State topVisibility: Visibility = Visibility.None + @State botVisibility: Visibility = Visibility.None + @State scollVisibility: Visibility = Visibility.None + @State toolItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .opacity(0.4) + .margin({ top: 2, bottom: 2 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOne() + } else if (name === 'pageTwo') { + PageTwo() + } else if (name === 'pageThree') { + pageThree() + } + } + + build() { + Column() { + Text('It is text on top') + .fontColor(Color.Blue) + .visibility(this.topVisibility) + .margin(6) + .height(100) + .borderWidth(3) + Scroll() { + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('Scroll text: ' + item) + .width('90%') + .height(50) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + }.borderWidth(3) + .height(200) + .width('100%') + .margin({ top: 12, left: 5 }) + }.height(210).visibility(this.scollVisibility) + .width('100%') + + Navigation(this.pageInfos) { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(150) + .width('100%') + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('Navigation text:' + item) + .width('90%') + .height(50) + .backgroundColor('#Fdd') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(200) + .width('100%') + .margin({ top: 12, left: 5 }) + + Row() { + Button('Top Text Show', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn1') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this.topVisibility = Visibility.Visible; + }) + Button('Bottom Text Show', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn2') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this.botVisibility = Visibility.Visible; + }) + Button('Scroll Show', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn3') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this.scollVisibility = Visibility.Visible; + }) + }.margin(20) + + Row() { + Button('_navMarginTopBottom', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn4') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this._navMarginTopBottom = 10 + }) + Button('_navMarginLeftRight', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn5') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this._navMarginLeftRight = 10 + }) + }.margin(20) + + /*Button('_navHeight', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn6') + .height(30) + .margin({ top: 10, left: 10 }) + .onClick(() => { + this._navHeight = '80%' + })*/ + + Row() { + Button('Push PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn6') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) + }) + }.margin(20) + } + .margin({ + top: this._navMarginTopBottom, + bottom: this._navMarginTopBottom, + left: this._navMarginLeftRight, + right: this._navMarginLeftRight + }) + .borderWidth(3) + .backgroundColor(Color.Pink) + .layoutWeight(1) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Mini) + .navDestination(this.PageMap) + .backButtonIcon('return.png') + .expandSafeArea([SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD], + [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]) + .toolbarConfiguration(this.toolItems) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Text('It is text on bottom').fontColor(Color.Blue).visibility(this.botVisibility).margin(10) + .height(80) + } + .width('100%') + .height('100%') + .backgroundColor('#Fddd2d') + } +} + +@Component +export struct PageOne { + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "PageTwo click logInfo:\n"; + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Column() { + Button('Push PageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn7') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) + }) + } + .width(350) + .height(400).borderWidth(1).borderColor(Color.Yellow) + } + .title('PageOne') + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Component +export struct PageTwo { + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "PageTwo click logInfo:\n"; + @State num: number = 0; + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Column() { + Button('Push PageThree', { stateEffect: true, type: ButtonType.Capsule }) + .id('exp_btn8') + .width('80%') + .height(40) + .margin({ top: 10 }) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) + }) + } + .width(300) + .height(350).borderWidth(1) + } + .title('PageTwo') + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Component +struct pageThree { + @Consume('pageInfos') pageInfos: NavPathStack; + @State text: string = "It is pageThree"; + + build() { + NavDestination() { + Column() { + Text(this.text) + .fontSize(20) + .borderWidth(5) + .borderColor(Color.Blue) + .width('80%') + .margin({ top: 10 }) + }.backgroundColor('#ddeeff66') + .width('90%') + .height(400).borderWidth(1) + } + .title('pageThree') + .mode(NavDestinationMode.STANDARD) + .onReady((ctx: NavDestinationContext) => { + try { + this.pageInfos = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeAreaMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeAreaMain.ets new file mode 100755 index 000000000..f4aafaca0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeAreaMain.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { router } from '@kit.ArkUI' + +@Entry +@Component +struct ComponentNavNavigationExpandSafeAreaMain { + pageInfo: NavPathStack = new NavPathStack() + + build() { + Navigation(this.pageInfo) { + Column() { + Button('Navigation未配置expandSafeArea', { stateEffect: true, type: ButtonType.Capsule }) + .id('ExpandSafeArea_btn1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationExpandSafeArea/ComponentNavNavigationExpandSafeArea0010' + }) + }) + Button('test2 @private', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageInfoMain_btn2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationPageInfo/test2' + }) + }) + Button('test3 @Provide', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageInfoMain_btn3') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationPageInfo/test3' + }) + }) + } + }.title('ExpandSafeArea Test') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0040.ets new file mode 100755 index 000000000..06bc6e9d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0040.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FaultLogger } from "@kit.PerformanceAnalysisKit"; + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationHideNavBar0040 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + isHideNavBar: boolean = true + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + onPageShow() { + setTimeout(() => { + this.isHideNavBar = false + }, 2000) + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .title('Navigation') + .width('100%') + .height('100%') + .hideNavBar(this.isHideNavBar) + .mode(NavigationMode.Auto) + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0130.ets new file mode 100755 index 000000000..ad1b0448f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0130.ets @@ -0,0 +1,25 @@ +import { Prompt } from '@kit.ArkUI'; +import prompt from '@system.prompt'; + +@Entry +@Component +struct ComponentNavNavigationHideNavBar0130 { + private stack : NavPathStack = new NavPathStack(); + + build() { + Navigation(this.stack) { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .hideNavBar(true) + .width('100%') + .height('100%') + .title('Navigation') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0140.ets new file mode 100755 index 000000000..1c2311337 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0140.ets @@ -0,0 +1,20 @@ +@Entry +@Component +struct ComponentNavNavigationHideNavBar0140 { + build() { + Navigation() { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .hideNavBar(true) + .width('100%') + .height('100%') + .title('Navigation') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0150.ets new file mode 100755 index 000000000..eb03ab4d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0150.ets @@ -0,0 +1,24 @@ +import { Prompt } from '@kit.ArkUI'; +import prompt from '@system.prompt'; + +@Entry +@Component +struct ComponentNavNavigationHideNavBar0150 { + build() { + Navigation() { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .hideNavBar(true) + .width('100%') + .height('100%') + .backgroundColor("#ff4aa2e6") + .title('Navigation') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160.ets new file mode 100755 index 000000000..1eac947ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationHideNavBarTest/ComponentNavNavigationHideNavBar0160.ets @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import observer from '@ohos.arkui.observer'; + +@Component +export struct MyButton { + text: string = "" + onClickFunction: (event: ClickEvent) => void = () => { + } + + build() { + Button() { + Text(this.text) + .fontSize(25) + .fontWeight(FontWeight.Bold) + } + .type(ButtonType.Capsule) + .margin({ top: 20 }) + .onClick(this.onClickFunction) + .borderWidth(3) + .borderColor(Color.Orange) + .backgroundColor(Color.Pink) + } +} + +@Entry +@Component +struct ComponentNavNavigationHideNavBar0160 { + @Provide('stack') stack: NavPathStack = new NavPathStack() + + aboutToAppear(): void { + this.getUIContext().getUIObserver().on('routerPageUpdate', (info) => { + console.log('[router] observerInfo: ' + JSON.stringify(info)) + }) + } + + @Builder + pageMap(name: string) { + if (name.substring(0, 7) == "pageOne") { + PageOne() + } else if (name.substring(0, 7) == "pageTwo") { + PageTwo() + } + } + + @State mode: NavigationMode = NavigationMode.Auto + + build() { + Navigation(this.stack) { + Text('MainPage') + .fontSize(30) + .height('80%') + .width('100%') + .margin(10) + .borderRadius(10) + .backgroundColor('#C0C0C0') + MyButton({ + text: "Next Page", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + + }.navDestination(this.pageMap).title({ main: 'MainPage', sub: 'sub' }, { backgroundColor: Color.Blue }) + .mode(NavigationMode.Auto).toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + } +} + +@Component +export struct PageOne { + @Consume('stack') stack: NavPathStack + name: string = "PAGE_ONE" + + build() { + NavDestination() { + Text('PageOne: test onBackPressed false') + .fontSize(30) + .height('80%') + .width('100%') + .margin(10) + .borderRadius(10) + .backgroundColor('#C0C0C0') + MyButton({ + text: "push pageOne", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + + MyButton({ + text: "Next Page", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }) + } + }) + + } + .title('Page One') + .id("2").onBackPressed(() => { + return false; + }) + } +} + +@Component +export struct PageTwo { + @Consume('stack') stack: NavPathStack + @State stackSize: number = -1 + @State stackArray: Array = [] + @State count: number = 0; + color: Color = (this.count) % 2 == 0 ? Color.Pink : Color.Gray + @State name: string = "PAGE_TWO" + @State mode: NavigationMode = NavigationMode.Auto + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback,info:${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + aboutToDisappear(): void { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + build() { + NavDestination() { + Text('PageTwo: test onBackPressed undefined') + .fontSize(30) + .height('80%') + .width('100%') + .margin(10) + .borderRadius(10) + .backgroundColor('#C0C0C0') + + MyButton({ + text: "Next Page", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + } + .title(this.name) + .backgroundColor(this.color) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0010.ets new file mode 100755 index 000000000..981e6927d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0010.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0020 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('pageOne') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0020.ets new file mode 100755 index 000000000..1d2f0c4d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0020.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0010 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('test') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0030.ets new file mode 100755 index 000000000..0d23c3832 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0030.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0030 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('test') + .hideTitleBar(true) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0670.ets new file mode 100755 index 000000000..873a0a0d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0670.ets @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + @State msg:string="" + + @Builder + CustomDivider() { + Divider() + .strokeWidth('1px') + .color($r('sys.color.ohos_id_color_list_separator')) + .margin({ left: 8, right: 8 }) + } + + build() { + NavDestination() { + Row() { + Text(this.msg).fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + .backgroundColor('#f1f3f5') + .onShown(()=>{ + this.msg="on shown" + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationInterface0670 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + @Builder + CustomDivider() { + Divider() + .strokeWidth('1px') + .color($r('sys.color.ohos_id_color_list_separator')) + .margin({ left: 8, right: 8 }) + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([280, 400]) + .navBarWidth(260) + .title('Navigation') + .backgroundColor('#f1f3f5') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0710.ets new file mode 100755 index 000000000..3418ac3d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0710.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0710 { + pageInfos: NavPathStack = new NavPathStack() + title:NavigationCommonTitle= { + main: 'testTitle', + sub: '' + } + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title(this.title) + .hideTitleBar(false) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0720.ets new file mode 100755 index 000000000..53f343d08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0720.ets @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +export function PageOneBuilder() { + Row() { + Text('NavigationCustomTitle') + .fontSize(20) + .fontWeight(FontWeight.Bold) + } +} + +@Entry +@Component +struct ComponentNavNavigationInterface0720 { + private stack : NavPathStack = new NavPathStack(); + title:NavigationCustomTitle= { + builder:PageOneBuilder.bind(this), + height: TitleHeight.MainOnly + } + + build() { + Navigation(this.stack) { + Stack({alignContent: Alignment.Center}) { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + } + .width('100%') + .height('100%') + } + .width('100%') + .height('100%') + .title(this.title) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0730.ets new file mode 100755 index 000000000..b3d65d86e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0730.ets @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0730 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + }.width('100%').height('100%') + } + .title($r('app.string.navigation_test')) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0740.ets new file mode 100755 index 000000000..918c1cfd4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0740.ets @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0740 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + }.width('100%').height('100%') + } + .title("HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0750.ets new file mode 100755 index 000000000..7bd0e8c5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationInterfaceTest/ComponentNavNavigationInterface0750.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0750 { + @State title: string = 'AAAAAAAAAAAAA' + text: string = "" + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width("90%") + .height(40) + .backgroundColor(Color.Orange) + + NavRouter() { + Text("NavRouter1") + .width("100%") + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + NavDestination() { + TextInput({ text: this.title, placeholder: 'input your title...' }) + .key("mainTitle") + .width(390) + .height(40) + .margin({ top: 20, bottom: 20 }) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.title = value + }) + + Button('input') + .onClick(() => { + this.title = this.title + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + }) + .id('input') + } + .title(this.title) + } + .id("router") + .width("90%") + .backgroundColor(Color.Green) + .margin({ top: 12 }) + } + .titleMode(NavigationTitleMode.Full) + .title("主标题") + .mode(NavigationMode.Auto) + } + .height('100%') + .width('100%') + .backgroundColor(Color.Blue) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0010.ets new file mode 100755 index 000000000..e26e3926c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0010.ets @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 108, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title("WLAN", { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0010 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + setTimeout(()=>{ + this.pathInfo.pushPath({ name: 'one' }); + },2000) + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('80%') + .height('100%') + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020.ets new file mode 100755 index 000000000..f2bf329b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0020.ets @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 108, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title("WLAN", { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0020 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + setTimeout(()=>{ + this.pathInfo.pushPath({ name: 'one' }); + },2000) + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('80%') + .height('100%') + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0030.ets new file mode 100755 index 000000000..89c66b21c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0030.ets @@ -0,0 +1,92 @@ + +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Top }) { + Button('button (height = 82vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('82vp') + } + .width('100%') + .height('100%') + + }.title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + .margin({top:1}) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0030 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('80%') + .height('100%') + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0040.ets new file mode 100755 index 000000000..39a8b0e16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0040.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0040 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('pageOne') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0050.ets new file mode 100755 index 000000000..2962ee3d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0050.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0050 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('pageOne') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0060.ets new file mode 100755 index 000000000..944b9491e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0060.ets @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0060 { + private stack : NavPathStack = new NavPathStack(); + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Navigation(this.stack) { + Button('button (height = 82vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .height('82vp') + } + .titleMode(NavigationTitleMode.Mini) + .width(360) + .height('100%') + .margin({top:1}) + .title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0070.ets new file mode 100755 index 000000000..c7ae8d6d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0070.ets @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0070 { + private stack : NavPathStack = new NavPathStack(); + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: '' + } + + build() { + Navigation(this.stack) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({top:'56vp'}) + .height('56vp') + } + .titleMode(NavigationTitleMode.Mini) + .width(360) + .height('100%') + .margin({top:1}) + .title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0080.ets new file mode 100755 index 000000000..10d888f3c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0080.ets @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0080 { + private stack : NavPathStack = new NavPathStack(); + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Navigation(this.stack) { + Button('button (height = 138vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({top:'138vp'}) + .height('138vp') + } + .titleMode(NavigationTitleMode.Full) + .width(360) + .height('100%') + .margin({top:1}) + .title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0090.ets new file mode 100755 index 000000000..9fc9ffcf9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0090.ets @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0090 { + private stack : NavPathStack = new NavPathStack(); + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: '' + } + + build() { + Navigation(this.stack) { + Button('button (height = 112vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({top:'112vp'}) + .height('112vp') + } + .titleMode(NavigationTitleMode.Full) + .width(360) + .height('100%') + .margin({top:1}) + .title('MainTitle', { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0100.ets new file mode 100755 index 000000000..c7f33854d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0100.ets @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 108, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title("WLAN", { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0100 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('Navigation', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(300) + .title('Navigation') + .width('100%') + .height('100%') + .mode(NavigationMode.Split) + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0110.ets new file mode 100755 index 000000000..fbf5f8a8a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0110.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0110 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('pageOne') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0120.ets new file mode 100755 index 000000000..e432354c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0120.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationInterface0120 { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + }.width('100%').height('100%') + }.title('pageOne') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0130.ets new file mode 100755 index 000000000..629e1aaa7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0130.ets @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 108, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title("WLAN", { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0130 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('Navigation', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(300) + .title('Navigation') + .width('100%') + .height('100%') + .mode(NavigationMode.Split) + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0140.ets new file mode 100755 index 000000000..fa1b739d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0140.ets @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 108, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title("WLAN", { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0140 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) + .navBarWidthRange([300, 300]) + .navBarWidth(260) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0150.ets new file mode 100755 index 000000000..4fb48a9f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0150.ets @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + + build() { + NavDestination() { + Row() { + Text('Navigation Content').fontSize(20).fontWeight(FontWeight.Medium) + Blank() + }.width('100%').height(26).margin({ top: 38, bottom: 24 }) + .padding({ left: 24, right: 24 }) + + }.title('WLAN') + .hideTitleBar(true) + } +} + +@Entry +@Component +struct ComponentNavNavigationLayout0150 { + @State pathInfo: NavPathStack = new NavPathStack(); + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + aboutToAppear() { + this.pathInfo.pushPath({ name: 'one' }); + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({alignContent: Alignment.Bottom}) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('99%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } + }.onBreakpointChange((breakpoint: string) => { + this.currentBreakPoint = breakpoint; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0160.ets new file mode 100755 index 000000000..26f59146e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0160.ets @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationLayout0160 { + @State pathInfo: NavPathStack = new NavPathStack(); + + build() { + Navigation() { + Stack({ alignContent: Alignment.Bottom }) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + } + .title('Navigation') + .width('100%') + .height('99%') + .alignSelf(ItemAlign.Center) + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0170.ets new file mode 100755 index 000000000..c1e17e725 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0170.ets @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationLayout0170 { + private stack : NavPathStack = new NavPathStack(); + + build() { + Navigation(this.stack) { + Stack({alignContent: Alignment.Bottom}) { + Button('button (height = 56vp)', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .height('56vp') + } + .width('100%') + .height('100%') + } + .width(360) + .height('99%') + .title('Navigation') + .toolbarConfiguration([ + {value: "a"}, + {value: "b"} + ], { + backgroundColor: "#80004AAF", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0180.ets new file mode 100755 index 000000000..afc48d9a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationLayoutTest/ComponentNavNavigationLayout0180.ets @@ -0,0 +1,79 @@ +// xxx.ets +@Entry +@Component +struct ComponentNavNavigationLayout0180 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + build() { + Navigation() { + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`WLAN`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用WLAN').fontSize(30).padding({ left: 15 }) + } + }.title("WLAN") + } + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + console.info("test--isActivated1") + this.isActiveWLAN = isActivated + }) + + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`蓝牙`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用蓝牙').fontSize(30).padding({ left: 15 }) + } + }.title("蓝牙") + } + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveBluetooth ? '#ccc' : '#fff') + .borderRadius(20) + .mode(NavRouteMode.REPLACE) + .onStateChange((isActivated: boolean) => { + console.info("test--isActivated2") + this.isActiveBluetooth = isActivated + }) + } + .height('100%') + .width('100%') + .title('设置') + .backgroundColor("#F2F3F5") + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Auto) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain.ets new file mode 100755 index 000000000..4df54bbbe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/ComponentNavNavigationPageInfoMain.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { router } from '@kit.ArkUI' + +@Entry +@Component +struct ComponentNavNavigationPageInfoMain { + pageInfo: NavPathStack = new NavPathStack() + + build() { + Navigation(this.pageInfo) { + Column() { + Button('test1 @State', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageInfoMain_btn1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationPageInfo/test1' + }) + }) + Button('test2 @private', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageInfoMain_btn2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationPageInfo/test2' + }) + }) + Button('test3 @Provide', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageInfoMain_btn3') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/ComponentNavNavigationPageInfo/test3' + }) + }) + } + }.title('MainPage') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageOne.ets new file mode 100755 index 000000000..0d57076be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageOne.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./test1"; + +export class pages { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageOneTmp { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text :string = '' + @State text2 :string = '' + @State opacity1: number = 1 + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin({ top:10 }) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageOne" + this.pathStack?.pushPath({ name: 'pageTwo' , param: p}) + }) + Button('pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin({ top:10 }) + .onClick(() => { + this.pathStack?.pop(); + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin({ top:10 }) + .onClick(() => { + this.pathStack?.clear() + }) + Text(this.text) + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(()=>{ + this.lifeCycle += "" + }) + .onHidden(()=>{ + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageOne') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageTwo.ets new file mode 100755 index 000000000..0799720fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/PageTwo.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./test1"; + +export class pages { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageTwoTmp { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text: string = '' + @State text2: string = '' + @State opacity1: number = 1 + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40).margin({ top: 10 }) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageTwo" + this.pathStack?.pushPath({ name: 'pageOne', param: p }) + }) + Button('pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40).margin({ top: 10 }) + .onClick(() => { + this.pathStack?.pop(); + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40).margin({ top: 10 }) + .onClick(() => { + this.pathStack?.clear() + }) + Text(this.text) + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageTwo') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test1.ets new file mode 100755 index 000000000..f312de316 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test1.ets @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; +import { pageOneTmp } from './PageOne' +import { pageTwoTmp } from './pageTwo' + +export class MyParam { + operation: number = 1 + text: string = '' +} + +@Component +struct pageThreeTmp { + private pathStack: NavPathStack | null = null; + @State text: string = "none"; + @State text2: string = "none"; + @State lifeCycle: string = ""; + @State opacity1: number = 1 + + aboutToAppear() { + } + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageThree" + this.pathStack?.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.pop(); + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.clear() + }) + Text(this.text) + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageThree') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Entry +@Component +struct test1 { + @State stack: NavPathStack = new NavPathStack(); + @State stack2: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + build() { + Column() { + Button("back to Main page", { stateEffect: true, type: ButtonType.Capsule }) + .onClick(() => { + router.back(); + }) + Navigation(this.stack) { + Scroll() { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageOne', param: p }) + }) + Button('pushPathTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pushPathThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageThree', param: p }) + }) + + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`pageFour`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Column() { + Text('pageFour') + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageFour') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text2 = JSON.stringify(ctx.pathInfo) + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } + .margin({ top: 10, bottom: 10 }) + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + }) + + Navigation(this.stack2) { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from children navigation" + this.stack2.pushPath({ name: 'pageOne', param: p }) + }) + } + }.navDestination(this.PageMap).title("children") + + } + .width('100%') + .height('100%') + }.width('100%').height(750) + } + .width('100%') + .height('100%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test2.ets new file mode 100755 index 000000000..9d4683219 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test2.ets @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; +import { pageOneTmp } from './PageOne' +import { pageTwoTmp } from './pageTwo' + +export class MyParam { + operation: number = 1 + text: string = '' +} + +@Component +struct pageThreeTmp { + private pathStack: NavPathStack | null = null; + @State text: string = "none"; + @State text2: string = "none"; + @State lifeCycle: string = ""; + @State opacity1: number = 1 + + aboutToAppear() { + } + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageThree" + this.pathStack?.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.pop(); + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.clear() + }) + Text(this.text) + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageThree') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Entry +@Component +struct test2 { + private stack: NavPathStack = new NavPathStack(); + private stack2: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + build() { + Column() { + Button("back to Main page", { stateEffect: true, type: ButtonType.Capsule }) + .onClick(() => { + router.back(); + }) + Navigation(this.stack) { + Scroll() { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageOne', param: p }) + }) + Button('pushPathTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pushPathThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageThree', param: p }) + }) + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`pageFour`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Column() { + Text('pageFour') + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageFour') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text2 = JSON.stringify(ctx.pathInfo) + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } + .margin({ top: 10, bottom: 10 }) + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + }) + + Navigation(this.stack2) { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from children navigation" + this.stack2.pushPath({ name: 'pageOne', param: p }) + }) + } + }.navDestination(this.PageMap).title("children") + + } + .width('100%') + .height('100%') + }.width('100%').height(750) + } + .width('100%') + .height('100%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test3.ets new file mode 100755 index 000000000..6ae45ff65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPageInfo/test3.ets @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; +import { pageOneTmp } from './PageOne' +import { pageTwoTmp } from './pageTwo' + +export class MyParam { + operation: number = 1 + text: string = '' +} + +@Component +struct pageThreeTmp { + private pathStack: NavPathStack | null = null; + @State text: string = "none"; + @State text2: string = "none"; + @State lifeCycle: string = ""; + @State opacity1: number = 1 + + aboutToAppear() { + } + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageThree" + this.pathStack?.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.pop(); + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack?.clear() + }) + Text(this.text) + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageThree') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} + +@Entry +@Component +struct test3 { + @Provide stack: NavPathStack = new NavPathStack(); + @Provide stack2: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + build() { + Column() { + Button("back to Main page", { stateEffect: true, type: ButtonType.Capsule }) + .onClick(() => { + router.back(); + }) + Navigation(this.stack) { + Scroll() { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageOne', param: p }) + }) + Button('pushPathTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageTwo', param: p }) + }) + Button('pushPathThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from mainPage" + this.stack.pushPath({ name: 'pageThree', param: p }) + }) + + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`pageFour`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Column() { + Text('pageFour') + Text(this.text2) + Text(this.lifeCycle) + } + .width('100%') + .height('100%') + } + .onShown(() => { + this.lifeCycle += "" + }) + .onHidden(() => { + this.lifeCycle += "" + }) + .onAppear(() => { + this.lifeCycle += ""; + }) + .onDisAppear(() => { + this.lifeCycle += ""; + }) + .title('pageFour') + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text2 = JSON.stringify(ctx.pathInfo) + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } + .margin({ top: 10, bottom: 10 }) + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + }) + + Navigation(this.stack2) { + Column() { + Button('pushPathOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushPathOne_2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from children navigation" + this.stack2.pushPath({ name: 'pageOne', param: p }) + }) + } + }.navDestination(this.PageMap).title("children") + + } + .width('100%') + .height('100%') + }.width('100%').height(750) + } + .width('100%') + .height('100%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001.ets new file mode 100755 index 000000000..8bfbb7459 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush001.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush001 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushPath({ name: 'PageOne' }); + }) + .id('push01') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush003.ets new file mode 100755 index 000000000..28b805342 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush003.ets @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from "@kit.BasicServicesKit"; + + +@Component +export struct PageThree { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageThree') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush003 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State buildMapSelect: boolean = true; + @State result: string = ""; + @State result1: string = ""; + @State selectBuildMapText: string = "开启buildMap函数"; + + @Builder + myRouter(name: string, param?: number | undefined) { + PageThree(); + } + + build() { + Column() { + if (this.buildMapSelect) { + Navigation(this.pageInfos) { + Column() { + Text("开启buildMap函数 " + this.result) + } + }.title('Index').navDestination(this.myRouter).height(200) + } else { + Navigation(this.pageInfos) { + Column() { + Text("关闭buildMap函数 " + this.result1) + } + }.title('Index').height(200) + + } + Column() { + Button(this.selectBuildMapText) + .width("80%") + .height(40) + .margin(5) + .id('start') + .onClick(() => { + this.buildMapSelect = !this.buildMapSelect + if (this.buildMapSelect) { + this.selectBuildMapText = "开启buildMap函数"; + } else { + this.selectBuildMapText = "关闭buildMap函数"; + } + }) + Button('pushPage') + .id('pushPage') + .onClick(() => { + this.pageInfos.pushDestinationByName('pageThree', null) + .then(() => { + }).catch((error: BusinessError) => { + if (this.buildMapSelect) { + this.result = JSON.stringify(error.code); + } else { + this.result1 = JSON.stringify(error.code); + } + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004.ets new file mode 100755 index 000000000..3b0ac71ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush004.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageOne') + .mode(NavDestinationMode.DIALOG) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush007 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushByNamePageOne', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushDestinationByName('PageOne', 'id'); + }) + .id('push04') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush005.ets new file mode 100755 index 000000000..a637b4322 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush005.ets @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from "@kit.BasicServicesKit"; + + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush005 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State buildMapSelect: boolean = true; + @State result: string = ""; + @State result1: string = ""; + @State selectBuildMapText: string = "开启buildMap函数"; + + @Builder + myRouter(name: string, param?: number | undefined) { + PageTwo(); + } + + build() { + Column() { + if (this.buildMapSelect) { + Navigation(this.pageInfos) { + Column() { + Text("开启buildMap函数 " + this.result) + } + }.title('Index').navDestination(this.myRouter).height(200) + } else { + Navigation(this.pageInfos) { + Column() { + Text("关闭buildMap函数 " + this.result1) + } + }.title('Index').height(200) + + } + Column() { + Button(this.selectBuildMapText) + .width("80%") + .height(40) + .margin(5) + .id('start') + .onClick(() => { + this.buildMapSelect = !this.buildMapSelect + if (this.buildMapSelect) { + this.selectBuildMapText = "开启buildMap函数"; + } else { + this.selectBuildMapText = "关闭buildMap函数"; + } + }) + Button('pushPage') + .id('pushPage') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null) + .then(() => { + }).catch((error: BusinessError) => { + if (this.buildMapSelect) { + this.result = JSON.stringify(error.code); + } else { + this.result1 = JSON.stringify(error.code); + } + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush006.ets new file mode 100755 index 000000000..b66fbb18d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush006.ets @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from "@kit.BasicServicesKit"; + + +@Component +export struct PageThree { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageThree') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush006 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State buildMapSelect: boolean = true; + @State result: string = ""; + @State result1: string = ""; + @State selectBuildMapText: string = "开启buildMap函数"; + + @Builder + myRouter(name: string, param?: number | undefined) { + PageThree(); + } + + build() { + Column() { + if (this.buildMapSelect) { + Navigation(this.pageInfos) { + Column() { + Text("开启buildMap函数 " + this.result) + } + }.title('Index').navDestination(this.myRouter).height(200) + } else { + Navigation(this.pageInfos) { + Column() { + Text("关闭buildMap函数 " + this.result1) + } + }.title('Index').height(200) + + } + Column() { + Button(this.selectBuildMapText) + .width("80%") + .height(40) + .margin(5) + .id('start') + .onClick(() => { + this.buildMapSelect = !this.buildMapSelect + if (this.buildMapSelect) { + this.selectBuildMapText = "开启buildMap函数"; + } else { + this.selectBuildMapText = "关闭buildMap函数"; + } + }) + Button('pushPage') + .id('pushPage') + .onClick(() => { + this.pageInfos.pushDestinationByName('pageThree', null) + .then(() => { + }).catch((error: BusinessError) => { + if (this.buildMapSelect) { + this.result = JSON.stringify(error.code); + } else { + this.result1 = JSON.stringify(error.code); + } + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007.ets new file mode 100755 index 000000000..fccfdf446 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush007.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageFive { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageFive') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageFive') + .visibility(Visibility.Hidden) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush007 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageFive() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushByNamePageFive', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushDestinationByName('PageFive', 'id'); + }) + .id('push07') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008.ets new file mode 100755 index 000000000..94329948a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush008.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageFour { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageFour') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageFour') + .mode(NavDestinationMode.DIALOG) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush008 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageFour() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushBynamePageFour', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushDestinationByName('PageFour', 'id'); + }) + .id('push08') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush009.ets new file mode 100755 index 000000000..ff72713e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush009.ets @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from "@kit.BasicServicesKit"; + + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush009 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State buildMapSelect: boolean = true; + @State result: string = ""; + @State result1: string = ""; + @State selectBuildMapText: string = "开启buildMap函数"; + + @Builder + myRouter(name: string, param?: number | undefined) { + PageTwo(); + } + + build() { + Column() { + if (this.buildMapSelect) { + Navigation(this.pageInfos) { + Column() { + Text("开启buildMap函数 " + this.result) + } + }.title('Index').navDestination(this.myRouter).height(200) + } else { + Navigation(this.pageInfos) { + Column() { + Text("关闭buildMap函数 " + this.result1) + } + }.title('Index').height(200) + + } + Column() { + Button(this.selectBuildMapText) + .width("80%") + .height(40) + .margin(5) + .id('start') + .onClick(() => { + this.buildMapSelect = !this.buildMapSelect + if (this.buildMapSelect) { + this.selectBuildMapText = "开启buildMap函数"; + } else { + this.selectBuildMapText = "关闭buildMap函数"; + } + }) + Button('pushPage') + .id('pushPage') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null) + .then(() => { + }).catch((error: BusinessError) => { + if (this.buildMapSelect) { + this.result = JSON.stringify(error.code); + } else { + this.result1 = JSON.stringify(error.code); + } + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush010.ets new file mode 100755 index 000000000..035aad08d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush010.ets @@ -0,0 +1,163 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from "@kit.BasicServicesKit"; + + +@Component +export struct PageOne { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageOne') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Component +export struct PageTwo { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageTwo') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Component +export struct PageThree { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Text('PageThree') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + } +} + +@Entry +@Component +struct ComponentNavNavigationPush010 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); + @State buildMapSelect: boolean = false; + @State result: string = ""; + @State result1: string = ""; + @State selectBuildMapText: string = "开启buildMap函数"; + + @Builder + myRouter(name: string, param?: number | undefined) { + if (name === 'PageOne') { + PageOne(); + } else if (name === 'PageTwo') { + PageTwo(); + } else if (name === 'PageThree') { + PageThree(); + } + } + + build() { + Column() { + if (this.buildMapSelect) { + Navigation(this.pageInfos) { + Column() { + Text("开启buildMap函数 " + this.result) + } + }.title('Index').navDestination(this.myRouter).height(200) + } else { + Navigation(this.pageInfos) { + Column() { + Text("关闭buildMap函数 " + this.result1) + } + }.title('Index').height(200) + + } + Column() { + Button(this.selectBuildMapText) + .width("80%") + .height(40) + .margin(5) + .id('start') + .onClick(() => { + this.buildMapSelect = !this.buildMapSelect + if (this.buildMapSelect) { + this.selectBuildMapText = "开启buildMap函数"; + } else { + this.selectBuildMapText = "关闭buildMap函数"; + } + }) + Button('pushOnePage') + .id('pushOnePage') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageOne', null); + }) + Button('pop') + .id('pop') + .onClick(() => { + this.pageInfos.pop(); + }) + Button('pushTwoPage') + .id('pushTwoPage') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageTwo', null) + .then(() => { + }).catch((error: BusinessError) => { + this.result1 = JSON.stringify(error.code); + }) + }) + Button('pushThreePage') + .id('pushThreePage') + .onClick(() => { + this.pageInfos.pushDestinationByName('PageThree', null) + .then(() => { + }).catch((error: BusinessError) => { + this.result = JSON.stringify(error.code); + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011.ets new file mode 100755 index 000000000..27615d460 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush011.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageFour { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageFour') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageFour') + .mode(NavDestinationMode.DIALOG) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush011 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageFour() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushPageFour', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushPath({ name: 'PageFour' }); + }) + .id('push011') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012.ets new file mode 100755 index 000000000..46dd6dd84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush012.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageFive { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageFive') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageFive') + .visibility(Visibility.Hidden) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush012 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageFive() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushPageFive', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushPath({ name: 'PageFive' }); + }) + .id('push012') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013.ets new file mode 100755 index 000000000..c204c5187 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationPushTest/ComponentNavNavigationPush013.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageSix { + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Text('PageSix') + .width('40%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + .align(Alignment.Center) + } + .width('100%') + .height('100%') + }.title('PageSix') + .visibility(Visibility.None) + } +} + +@Entry +@Component +struct ComponentNavNavigationPush013 { + @State pathInfo: NavPathStack = new NavPathStack(); + + @Builder + myRouter(name: string, param?: number | undefined) { + PageSix() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('pushPageSix', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.pathInfo.pushPath({ name: 'PageSix' }); + }) + .id('push013') + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .title('Navigation') + .width('100%') + .height('100%') + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0100.ets new file mode 100755 index 000000000..bbe5b9966 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0100.ets @@ -0,0 +1,394 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0100 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText: string = '0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({ text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(() => { + this.inputText = 'pageOne' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .width('60%') + + Button("input0") + .onClick(() => { + this.text1 = 'pageOne' + }).id('inputName').width('40%') + + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .id('removeNyName') + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0110.ets new file mode 100755 index 000000000..089e56010 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0110.ets @@ -0,0 +1,386 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0110 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0120.ets new file mode 100755 index 000000000..d870f12f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0120.ets @@ -0,0 +1,386 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0120 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0,1' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130.ets new file mode 100755 index 000000000..fa1eafd06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0130.ets @@ -0,0 +1,394 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0130 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText: string = '0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({ text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(() => { + this.inputText = 'pageOne' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .width('60%') + + Button("input0") + .onClick(() => { + this.text1 = 'pageOne' + }).id('inputName').width('40%') + + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .id('removeNyName') + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170.ets new file mode 100755 index 000000000..ef2295f38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0170.ets @@ -0,0 +1,388 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0170 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageThree') + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0,1,2' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = this.pageInfos.getAllPathName().length+"" //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .margin({left:10}) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0210.ets new file mode 100755 index 000000000..5f9cca161 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0210.ets @@ -0,0 +1,388 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0210 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageThree') + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .margin({left:10}) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0220.ets new file mode 100755 index 000000000..c02e6b2ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0220.ets @@ -0,0 +1,394 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0220 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText: string = '0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({ text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(() => { + this.inputText = 'pageOne' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .width('60%') + + Button("input0") + .onClick(() => { + this.text1 = 'pageOne' + }).id('inputName').width('40%') + + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .id('removeNyName') + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0260.ets new file mode 100755 index 000000000..7ecad74c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0260.ets @@ -0,0 +1,395 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0260 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText: string = '0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({ text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(() => { + this.inputText = 'pageOne' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .width('60%') + + Button("input0") + .onClick(() => { + this.text1 = 'pageOne' + }).id('inputName').width('40%') + + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + .id('removeNyName') + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270.ets new file mode 100755 index 000000000..94e54de79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0270.ets @@ -0,0 +1,387 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0270 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0280.ets new file mode 100755 index 000000000..b1263a15f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/ComponentNavNavigationRemovePage0280.ets @@ -0,0 +1,390 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { pageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import { pageThreeTmp } from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRemovePage0280 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State text: string = '' + @State text1: string = '' + @State number: number = 0 + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 160 + @State navigationWidth: number = 400 + @State minNavBarWidth: number = 130 + @State maxNavBarWidth: number = 350 + @State minContentWidth: number = 100 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State hideNavBar: boolean = false + @State text2: string = '' + @State text3: string = '' + @State text4: string = '' + @State result: string = '' + @State result1: string = '' + @State opacity1: number = 1 + @State number1: number = 0 + @State index: string = '' + @State indexes: Array = new Array() + @State inputText:string='0' + + @Styles + clickedStyles(): void { + .backgroundColor(0x808080) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text('navBarWidth') + } + + Row() { + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + } + + Row() { + Text('minContentWidth') + } + + Row() { + Counter() { + Text(this.minContentWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minContentWidth += 10 + }) + .onDec(() => { + this.minContentWidth -= 10 + }) + } + + Row() { + Text('minNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth += 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }) + } + + Row() { + Text('maxNavBarWidthRange:') + } + + Row() { + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth += 10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }) + } + + Row() { + Text('navigationWidth:') + } + + Row() { + Counter() { + Text(this.navigationWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navigationWidth += 50 + }) + .onDec(() => { + this.navigationWidth -= 50 + }) + } + + } + } + .title('NavIndex') + .navDestination(this.PageMap) + .height('40%') + .border({ width: 1 }) + .clip(true) + .mode(this.mode) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .minContentWidth(this.minContentWidth) + .hideNavBar(this.hideNavBar) + .width(this.navigationWidth) + .backgroundColor(0xCCCCCC) + + Column() { + Row() { + Row() { + Row() { + Button('Split模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Split + }) + } + + Row() { + Button('Stack模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + } + + Row() { + Button('Auto模式', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + } + + } + } + + Row() { + Row() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageOne') + } + + Row() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .height(40) + .width('33.3%') + .type(ButtonType.Normal) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageTwo') + } + + Row() { + Button('pushPageThree', { stateEffect: true, type: ButtonType.Capsule }) + .type(ButtonType.Normal) + .height(40) + .width('33.3%') + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageThree' }) //将name指定的NavDestination页面信息入栈 + }) + .id('pushPageThree') + } + } + + + Column() { + Row() { + TextInput({text: this.inputText, placeholder: '输入删除索引(用逗号隔开)' }) + .type(InputType.Normal).onChange((value) => { + this.indexes = [] + let separator = ','; + let result = value.split(separator); + if (result.length > 0) { + this.index = '' + } + for (let i = 0; i < result.length; ++i) { + this.indexes[i] = parseInt(result[i]); + this.index += this.indexes[i] + if (i != result.length - 1) { + this.index += ',' + } + } + }).id("input").width('70%') + + Button("input0") + .onClick(()=>{ + this.inputText='0' + }).id('input0').width('30%') + } + + Row() { + Button('删除索引在indexes的页面') + .type(ButtonType.Normal) + .width('100%') + .onClick(() => { + let ret = this.pageInfos.removeByIndexes(this.indexes) + this.result = '' + ret + }) + .id('deletePageIndex') + } + + Row() { + Text('removeByIndex result : ' + this.result) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + } + + Column() { + Row() { + TextInput({ text: this.text1, placeholder: '输入删除页面(无需符号分隔)' }) + .fontSize(20) + .borderRadius(10)// .textAlign(TextAlign.Center) + .type(InputType.Normal) + .onChange((value: string) => { + this.text1 = value + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + } + + Button('remove') + .onClick(() => { + let ret1 = this.pageInfos.removeByName(this.text1) + this.result1 = '' + ret1 + }) + + Row() { + Text('removeByname result : ' + this.result1) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .copyOption(CopyOptions.InApp) + } + + Row() { + Row() { + Button('清除全部页面') + .type(ButtonType.Normal) + + .width('50%') + .height(40) + .onClick(() => { + this.pageInfos.clear() //将name指定的NavDestination页面信息入栈 + }) + .id('clearAll') + } + + Row() { + Button(this.hideNavBar ? '点击显示导航栏' : '点击隐藏导航栏') + .width('50%') + .type(ButtonType.Normal) + .onClick(() => { + this.hideNavBar = !this.hideNavBar + }).id('showNavigation') + } + } + + Button('获取栈中所有页面的名称') + .width('100%') + .type(ButtonType.Normal) + .height(40) + .onClick(() => { + this.text4 = JSON.stringify(this.pageInfos.getAllPathName()) //将name指定的NavDestination页面信息入栈 + }) + .id('getAllPageName') + Row() { + Text('' + this.text4) + .fontSize(12) + .lineHeight(20) + .width('100%') + .height(40) + .margin({left:10}) + } + } + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/CustomNavigationUtils.ts b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/CustomNavigationUtils.ts new file mode 100755 index 000000000..8a1a731da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/CustomNavigationUtils.ts @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const customTransitionMap: Map void,isexit: boolean, isPop: boolean) => void> = new Map() + +export class CustomTransition { + private constructor() {} + + static delegate = new CustomTransition(); + + static getInstance(): CustomTransition { + return this.delegate; + } + + // 注册转场动画 + registerNavParam(name: string, animatedParams: (isPush: boolean, onFinish: () => void,isexit: boolean, isPop: boolean) => void) { + customTransitionMap.set(name, animatedParams) + } + // 删除转场动画 + unRegisterNavParam(name: string) { + customTransitionMap.delete(name) + } + + // 获取注册的转场动画 + getNavParam(name: string): (isPush: boolean, onFinish: () => void,isexit: boolean, isPop: boolean) => void { + return customTransitionMap.get(name) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageOne.ets new file mode 100755 index 000000000..259982419 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageOne.ets @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {CustomTransition} from './CustomNavigationUtils' +export class pages { + names: string = "" + values: NavPathStack | null = null +} +let durationOne: number = 1000 + +@Entry +@Component +export struct pageOneTmp { + @Consume('pageInfos') pageInfos: NavPathStack; + @State text :string = '' + @State x: number = 300 + @State opacity1: number = 1 + @State duration: number = durationOne + + aboutToAppear() { + CustomTransition.getInstance().registerNavParam('pageOne', (isPush: boolean, onFinish: () => void,isexit:boolean, isPop: boolean) => { + if (isexit && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPush && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPop) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } + }) + } + + build() { + NavDestination() { + Column() { + + }.width(350).height(400).border({width:1}).borderColor(Color.Yellow) + }.title('pageOne') + .mode(NavDestinationMode.STANDARD) + .onShown(()=>{ + console.log("onshow1"+ this.pageInfos.getAllPathName().toString()); + }) + .onHidden(()=>{ + console.log("onHidden1 "+ this.pageInfos.getAllPathName().toString()); + }) + .onAppear(()=>{ + console.log("onAppear1 "+ this.pageInfos.getAllPathName().toString()); + }) + .onDisAppear(()=>{ + console.log("onDisappear1:"+ this.pageInfos.getAllPathName().toString()); + }) + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageThree.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageThree.ets new file mode 100755 index 000000000..8280b8ffb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageThree.ets @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CustomTransition } from './CustomNavigationUtils' + +export class pages { + names: string = "" + values: NavPathStack | null = null +} + +let durationOne: number = 1000 + +@Component +export struct pageThreeTmp { + @Consume('pageInfos') pageInfos: NavPathStack + @State text: string = '' + @State number: number = 0 + @State number2: number = 0 + @State x: number = 300 + @State opacity1: number = 1 + @State duration: number = durationOne + + aboutToAppear() { + CustomTransition.getInstance() + .registerNavParam('pageOne', (isPush: boolean, onFinish: () => void, isexit: boolean, isPop: boolean) => { + if (isexit && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPush && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPop) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } + }) + } + + build() { + NavDestination() { + Column() { + + }.width(300).height(300).border({ width: 1 }) + } + .title('pageThree') + .mode(NavDestinationMode.STANDARD) + .onShown(() => { + console.log("onshow3" + this.pageInfos.getAllPathName().toString()); + }) + .onHidden(() => { + + console.log("onHidden3 " + this.pageInfos.getAllPathName().toString()); + }) + .onAppear(() => { + console.log("onAppear3 " + this.pageInfos.getAllPathName().toString()); + }) + .onDisAppear(() => { + console.log("onDisappear3 " + this.pageInfos.getAllPathName().toString()); + }) + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageTwo.ets new file mode 100755 index 000000000..3575b1618 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRemovePageTest/pageTwo.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {CustomTransition} from './CustomNavigationUtils' + +export class pages { + names: string = "" + values: NavPathStack | null = null +} +let durationOne: number = 1000 + +@Entry +@Component +export struct pageTwoTmp { + @Consume('pageInfos') pageInfos: NavPathStack + @State text :string = '' + @State x: number = 300 + @State opacity1: number = 1 + @State duration: number = durationOne + + aboutToAppear() { + CustomTransition.getInstance().registerNavParam('pageOne', (isPush: boolean, onFinish: () => void,isexit:boolean, isPop: boolean) => { + if (isexit && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPush && isPop == false) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } else if (isPop) { + this.opacity1 = 0 + animateTo({ duration: durationOne, onFinish: onFinish }, () => { + this.opacity1 = 1 + }) + } + }) + } + build() { + NavDestination() { + Column() { + + }.width(300).height(350).border({width:1}).borderColor(Color.Red) + }.title('pageTwo') + .mode(NavDestinationMode.STANDARD) + .onShown(()=>{ + console.log(" onshow2"+ this.pageInfos.getAllPathName().toString()); + }) + .onHidden(()=>{ + console.log(" onHidden2 "+ this.pageInfos.getAllPathName().toString()); + }) + .onAppear(()=>{ + console.log("= onAppear2 "+ this.pageInfos.getAllPathName().toString()); + }) + .onDisAppear(()=>{ + console.log(" onDisappear2 "+ this.pageInfos.getAllPathName().toString()); + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterIntercept022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterIntercept022.ets new file mode 100755 index 000000000..14e021be9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/ComponentNavNavigationRouterIntercept022.ets @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { PageOneTmp } from './pageOne' +import { pageTwoTmp } from './pageTwo' +import {PageThreeTmp} from './pageThree' + +@Entry +@Component +struct ComponentNavNavigationRouterIntercept022 { + pageInfos: NavPathStack = new NavPathStack() + @State disableAnimation: boolean = false; + @State log: string = 'log:\r\n'; + @StorageLink('mode') mode: NavigationMode = NavigationMode.Auto + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === "pageThree") { + PageThreeTmp() + } + } + + aboutToAppear(): void { + this.registerInterception(); + } + + registerInterception() { + this.pageInfos.setInterception({ + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + let fromName: string = ""; + if (typeof from === "string") { + fromName = from.toString(); + } else { + fromName = from?.pathInfo?.name; + } + let toName: string = ""; + if (typeof to === "string") { + toName = to.toString(); + } else { + toName = to?.pathInfo?.name; + } + this.log='log:\r\n'+`will show from page name: ${fromName}, toName is ${toName}, operation: ${operation}, animated: ${animated}` + console.log(`will show from page name: ${fromName}, toName is ${toName}, operation: ${operation}, animated: ${animated}`) + }, + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + let fromName: string = ""; + if (typeof from === "string") { + fromName = from.toString(); + } else { + fromName = from?.pathInfo?.name; + } + let toName: string = ""; + if (typeof to === "string") { + toName = to.toString(); + } else { + toName = to?.pathInfo?.name; + } + console.log(`did show from page name: ${fromName}, toName is ${toName}, operation: ${operation}, animated: ${isAnimated}`) + }, + modeChange: (mode: NavigationMode) => { + console.log(`current navigation mode is ${mode}`); + } + }) + } + + build() { + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + .id("pushPageOne") + Button(`page Five`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPathByName('pageFive', null); + }) + + Button(`suspend pageOne`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.setInterception({ + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext| "navBar", operation: NavigationOperation, animated: boolean)=>{ + console.log(" ==== trigger will show ====="); + while (true) { + console.log("==== suspend ====="); + } + } + }); + this.pageInfos.pushPath({name: 'pageOne'}) + }) + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + + Text(this.log) + .width('80%') + .height(80) + .margin(20) + } + }.title('NavIndex').navDestination(this.PageMap).mode(this.mode) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageOne.ets new file mode 100755 index 000000000..6c12460af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageOne.ets @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class TmpClass{ + count:number=10 +} +@Entry +@Component +export struct PageOneTmp { + pageInfos: NavPathStack = new NavPathStack(); + @State isChange: boolean = false; + + build() { + NavDestination() { + Column() { + Text(`${this.isChange ? 'PushPathByName' : 'pushDestinationByName'}`) + Button('changePush', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(()=>{ + this.isChange = !this.isChange; + }) + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let tmp = new TmpClass() + if (this.isChange) { + this.pageInfos.pushPath({name: 'pageTwo', param: tmp}) //将name指定的NavDestination页面信息入栈,传递的数据为param + } else { + this.pageInfos.pushDestinationByName('pageTwo', null); + } + }) + NavRouter({name: 'pageTwo'}) { + Button('pushPageTwoByNavRouter') + } + Button('pageThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let tmp = new TmpClass() + this.pageInfos.pushPathByName('pageThree', tmp) //将name指定的NavDestination页面信息入栈,传递的数据为param + }) + + Button('Auto', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { +AppStorage.setOrCreate('mode', NavigationMode.Auto); +}) +Button('Split', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + AppStorage.setOrCreate('mode', NavigationMode.Split); + }) +Button('Stack', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + AppStorage.setOrCreate('mode', NavigationMode.Stack); + }) +Button(`remove start page`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.setInterception({ + willShow: (from: NavDestinationContext| "navBar", to: NavDestinationContext| "navBar", operation: NavigationOperation, isAnimated: boolean)=>{ + if (typeof from !== "string") { + this.pageInfos.removeByName(from.pathInfo.name); + } + } + }) + }) +}.width('100%').height('100%') +}.title('pageOne') + .onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack; + }) +} +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageThree.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageThree.ets new file mode 100755 index 000000000..8b63a8f94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageThree.ets @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class TmpClass{ + count:number=10 +} +@Entry +@Component +export struct PageThreeTmp { + pathStack: NavPathStack = new NavPathStack(); + + build() { + NavDestination() { + Column() { + Button('Pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.pop(); + }) + Button('Clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.clear(); + }) + }.width('100%').height('100%') + }.title('pageThree').onReady((context: NavDestinationContext)=>{ + this.pathStack = context.pathStack; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageTwo.ets new file mode 100755 index 000000000..63ed2df29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterInterceptTest/pageTwo.ets @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface Info { + name: string; + type?: number; + callback: (stack: NavPathStack, index?: string)=>void +} +@Entry +@Component +export struct pageTwoTmp { + pathStack: NavPathStack = new NavPathStack(); + index: string = ""; + + checkArray: Array = [ + {name: 'push pageThree', callback: (stack: NavPathStack)=>{stack.pushPath({name:'pageThree'});}}, + {name: 'Pop', callback: (stack: NavPathStack)=>{stack.pop();}}, + {name: 'PopToOneByName', callback: (stack: NavPathStack) => {stack.popToName('pageOne');}}, + {name: 'popToOneByIndex', callback: (stack: NavPathStack) => { + let index = stack.getIndexByName('pageOne')[0]; + stack.popToIndex(index); + }}, + {name: 'replaceToPageThree', callback: (stack: NavPathStack) => { + stack.replacePath({name: 'pageThree'}); + }}, + {name: 'replaceToPageThreeByName', callback: (stack: NavPathStack)=>{ + stack.replacePathByName('pageThree', null); + }}, + {name: 'replaceToPageTwo', callback: (stack: NavPathStack)=>{ + stack.replacePath({name: 'pageTwo'}) + }}, + { + name: 'replacePageOneToPageTwo', callback: (stack: NavPathStack)=>{ + + } + }, + { + name: 'removeByName: PageTwo', callback: (stack: NavPathStack) => { + stack.removeByName('pageTwo'); + } }, + { + name: 'removeByName:pageOne', callback: (stack: NavPathStack) => { + stack.removeByName('pageOne'); + } + }, + { + name: 'removeByIndex', + type: 1, + callback: (stack: NavPathStack, index?: string)=>{ + console.log("remove index " + index); + stack.removeByIndexes([Number(index)]) + } + }, + {name: 'movePageOneToTop', callback: (stack: NavPathStack)=>{ + stack.moveToTop('pageOne'); + }}, + {name: 'moveIndexToTop', callback: (stack: NavPathStack, index?: string)=>{stack.moveIndexToTop(Number(index));}, type: 1} + ]; + + build() { + NavDestination() { + Column() { + List() { + ForEach(this.checkArray, (item: Info) => { + ListItem() { + if (item.type) { + Row() { + Text(item.name + ":") + TextInput({placeholder: 'please enter index'}).width('30%').onSubmit(()=>{ + item.callback(this.pathStack, this.index); + }).onChange((val:string)=>{ + this.index = val; + }) + } + } else { + Button(item.name) + .width('80%') + .height(40) + .margin(20).onClick(()=>{ + item.callback(this.pathStack); + }) + } + } + }) + } + }.width('100%').height('100%') + }.title('pageTwo').onReady((context: NavDestinationContext) => { + this.pathStack = context.pathStack; + }).onShown(()=>{ + console.log("pageTwo onShown"); + }) + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020.ets new file mode 100755 index 000000000..a96abeef3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0020.ets @@ -0,0 +1,504 @@ +import { BusinessError, Callback } from '@ohos.base'; +import { JSON } from '@kit.ArkTS'; +import observer from '@ohos.arkui.observer'; + +class DerivedNavPathStack extends NavPathStack { + // usr defined property 'id' + id: string = "__default__" + + // new function in derived class + setId(id: string) { + this.id = id; + } + + // new function in derived class + getInfo(): string { + return "this page used Derived NavPathStack, id: " + this.id + } + + // overwrite function of NavPathStack + pushPath(info: NavPathInfo): void + pushPath(info: NavPathInfo, animated?: boolean): void + pushPath(info: NavPathInfo, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack pushPath'); + super.pushPath(info, animated); + } + + pushPathByName1(name: string, param: ESObject, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s pushPathByName'); + super.pushPathByName(name, param, animated); + } + + pushPathByName2(name: string, param: ESObject, onPop: Callback, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s pushPathByName(onPop)'); + super.pushPathByName(name, param, onPop, animated); + } + + pushDestination(info: NavPathInfo): Promise + pushDestination(info: NavPathInfo, animated?: boolean): Promise + pushDestination(info: NavPathInfo, animated?: boolean): Promise { + console.log('testTag reached DerivedNavPathStack pushDestination'); + return super.pushDestination(info, animated); + } + + pushDestinationByName1(name: string, param: Object, animated?: boolean): Promise { + console.log('testTag reached DerivedNavPathStack\'s pushDestinationByName10'); + return super.pushDestinationByName(name, param, animated); + } + + pushDestinationByName2(name: string, param: Object, onPop: Callback, animated?: boolean): Promise { + console.log('testTag reached DerivedNavPathStack\'s pushDestinationByName2'); + return super.pushDestinationByName(name, param, onPop, animated); + } + + replacePath(info: NavPathInfo): void + replacePath(info: NavPathInfo, animated?: boolean): void + replacePath(info: NavPathInfo, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s replacePath'); + super.replacePath(info, animated); + } + + replacePathByName(name: string, param: Object, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s replacePathByName'); + super.replacePathByName(name, param, animated); + } + + removeByIndexes(indexes: Array): number { + console.log('testTag reached DerivedNavPathStack\'s removeByIndexes'); + return super.removeByIndexes(indexes); + } + + removeByName(name: string): number { + console.log('testTag reached DerivedNavPathStack\'s removeByName'); + return super.removeByName(name); + } + + pop(animated?: boolean | undefined): NavPathInfo | undefined + pop(result: Object, animated?: boolean | undefined): NavPathInfo | undefined + pop(result?: Object, animated?: boolean | undefined): NavPathInfo | undefined { + console.log('testTag reached DerivedNavPathStack\'s pop'); + return super.pop(result, animated); + } + + popToName(name: string, animated?: boolean): number + popToName(name: string, result: Object, animated?: boolean): number + popToName(name: string, result?: Object, animated?: boolean): number { + console.log('testTag reached DerivedNavPathStack\'s popToName'); + return super.popToName(name, result, animated); + } + + popToIndex(index: number, animated?: boolean): void + popToIndex(index: number, result: Object, animated?: boolean): void + popToIndex(index: number, result?: Object, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s popToIndex'); + super.popToIndex(index, result, animated); + } + + moveToTop(name: string, animated?: boolean): number { + console.log('testTag reached DerivedNavPathStack\'s moveToTop'); + return super.moveToTop(name, animated); + } + + moveIndexToTop(index: number, animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s moveIndexToTop'); + super.moveIndexToTop(index, animated); + } + + clear(animated?: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s clear'); + super.clear(animated); + } + + getAllPathName(): Array { + console.log('testTag reached DerivedNavPathStack\'s getAllPathName'); + return super.getAllPathName(); + } + + getParamByIndex(index: number): ESObject | undefined { + console.log('testTag reached DerivedNavPathStack\'s getParamByIndex'); + return super.getParamByIndex(index); + } + + getParamByName(name: string): Array { + console.log('testTag reached DerivedNavPathStack\'s getParamByName'); + return super.getParamByName(name); + } + + getIndexByName(name: string): Array { + console.log('testTag reached DerivedNavPathStack\'s getIndexByName'); + return super.getIndexByName(name); + } + + size(): number { + console.log('testTag reached DerivedNavPathStack\'s size'); + return super.size(); + } + + disableAnimation(value: boolean): void { + console.log('testTag reached DerivedNavPathStack\'s disableAnimation'); + super.disableAnimation(value); + } + + getParent(): NavPathStack | null { + console.log('testTag reached DerivedNavPathStack\'s getParent'); + return super.getParent(); + } + + setInterception(interception: NavigationInterception): void { + console.log('testTag reached DerivedNavPathStack\'s setInterception'); + super.setInterception(interception); + } + + pushAndPopIndex(): void { + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.popToIndex(1); + } + + pushAndReplace(): void { + super.pushPathByName('pageOne', new param('ok')); + super.replacePathByName('pageTwo', new param('ok')); + } +} + +class param { + info: string = "default_param"; + + constructor(info: string) { + this.info = info + } +} + +@Entry +@Component +struct ComponentNavNavigationRouter0020 { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + @State disableAnimationValue: boolean = false + @State modeValue: NavigationMode[] = [NavigationMode.Stack, NavigationMode.Split, NavigationMode.Auto] + @State modeValueIndex: number = 0 + @State modeValueStr: string[] = ['NavigationMode.Stack', 'NavigationMode.Split', 'NavigationMode.Auto'] + @State lifeCycle: string = ""; + @State navRouteMode:number |undefined=undefined + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback, info: ${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + @Builder + pageMap(name: string) { + if (name === 'pageOne') { + PageOne({ + lifeCycle: this.lifeCycle + }) + } else if (name === 'pageTwo') { + PageTwo({ + lifeCycle: this.lifeCycle + }) + } else if (name === 'pageThree') { + PageThree({ + lifeCycle: this.lifeCycle + }) + } + } + + @State text: string | undefined = undefined + + build() { + Column({ space: 3 }) { + Text(this.lifeCycle) + .width('95%') + .margin({ top: 10 }) + .fontColor(Color.Brown) + .height('30%') + .borderWidth(3) + .borderColor(Color.Orange) + + Navigation(this.derivedStack) { + NavRouter() { + Column() { + Scroll() { + Column({ space: 5 }) { + Button('PUSH pageOne') + .onClick(() => { + this.derivedStack.pushPath({ name: 'pageOne', param: new param('go to pageOne') }, true) + }) + Button('设置name和param go to pageTwo') + .onClick(() => { + this.derivedStack.pushPath({ name: 'pageTwo', param: new param('go to pageTwo') }, true) + }) + Button('PUSH pageThree') + .onClick(() => { + this.derivedStack.pushPath({ name: 'pageThree', param: new param('go to pageThree') }, true) + }) + Button('getParamByIndex传入index无效') + .onClick(() => { + this.lifeCycle = 'getParamByIndex传入index无效返回值: '+ this.derivedStack.getParamByIndex(-1) + }) + Button('PUSH_WITH_RECREATE pageOne') + .onClick(() => { + this.navRouteMode = NavRouteMode.PUSH_WITH_RECREATE; + this.derivedStack.pushPath({ name: 'pageOne', param: 1 }, false) + }) + Button('PUSH_WITH_RECREATE pageTwo') + .onClick(() => { + this.navRouteMode = NavRouteMode.PUSH_WITH_RECREATE; + this.derivedStack.pushPath({ name: 'pageTwo', param: new param('go to pageTwo') }, true) + }) + Button('getParamByName') + .onClick(() => { + this.lifeCycle = 'testTag getParamByName返回值: '+this.derivedStack.getParamByName('pageOne')+'\n' + }) + Button('pop') + .onClick(() => { + this.lifeCycle = 'testTag pop返回值:'+ JSON.stringify(this.derivedStack.pop()) + }) + } + + }.width('100%').height('95%').borderWidth(1).borderColor('#ea6') + } + }.mode(this.navRouteMode) + } + .borderWidth(1) + .height('70%') + .backgroundColor('#ee4') + .title('Navigation') + .minContentWidth(50) + .navDestination(this.pageMap) + .mode(this.modeValue[this.modeValueIndex]) + .navBarWidthRange(['240vp', '432vp']) + } + } +} + +@Component +struct PageOne { + @Link lifeCycle: string; + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + Button('PUSH_WITH_RECREATE pageTwo') + .onClick(() => { + this.derivedStack.pushPath({ name: 'pageTwo', param: new param('go to pageTwo') }, true) + }) + Button('pop') + .onClick(() => { + this.lifeCycle = 'testTag pop返回值:'+ JSON.stringify(this.derivedStack.pop())+'\n' + }) + Button('popToName栈中不存在的页面') + .onClick(() => { + this.lifeCycle = 'testTag popToName返回值:'+ JSON.stringify(this.derivedStack.popToName('pageThree'))+'\n' + }) + Button('getAllPathName') + .onClick(() => { + let mes = JSON.stringify(this.derivedStack.getAllPathName()) + console.log('testTag getAllPathName return :' + mes) + this.lifeCycle += 'testTag getAllPathName返回值:' + mes+'\n' + }) + Button('getParamByName') + .onClick(() => { + this.lifeCycle = 'testTag getParamByName返回值: '+this.derivedStack.getParamByName('pageOne')+'\n' + }) + } + } + .title('pageOne') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('testTag PageOne onReady'); + this.lifeCycle += 'testTag PageOne onReady\n'; + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`testTag pageOne on backpress`) + this.lifeCycle += 'testTag pageOne on backpress\n'; + this.derivedStack?.pop() + return true + }) + .onShown(() => { + this.lifeCycle += 'testTag pageOne onShown\n'; + }) + .onHidden(() => { + this.lifeCycle += 'testTag pageOne onHidden\n'; + }) + /*.onWillAppear(() => { + this.lifeCycle += 'testTag pageOne onWillAppear\n'; + }) + .onAppear(() => { + this.lifeCycle += 'testTag pageOne onAppear\n'; + }) + .onWillShow(() => { + this.lifeCycle += 'testTag pageOne onWillShow\n'; + }) + .onWillHide(() => { + this.lifeCycle += 'testTag pageOne onWillHide\n'; + }) + .onWillDisappear(() => { + this.lifeCycle += 'testTag pageOne onWillDisappear\n'; + }) + .onDisAppear(() => { + this.lifeCycle += 'testTag pageOne onDisAppear\n'; + })*/ + } +} + +@Component +struct PageTwo { + @Link lifeCycle: string; + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 4 }) { + Button('moveIndexToTop 0') + .onClick(() => { + this.derivedStack.moveIndexToTop(0); + }) + Button('moveToTop栈中不存在的页面') + .onClick(() => { + this.lifeCycle = 'testTag moveToTop返回值: '+JSON.stringify(this.derivedStack.moveToTop('pageThree'))+'\n' + console.log('testTag moveToTop return :' + this.lifeCycle) + }) + Button('movelndexToTop pageOne') + .onClick(() => { + this.lifeCycle = 'testTag moveToTop pageOne返回值: '+JSON.stringify(this.derivedStack.moveToTop('pageOne'))+'\n' + }) + Button('getParamByIndex pageOne') + .onClick(() => { + this.lifeCycle = 'testTag getIndexByName返回值: '+this.derivedStack.getIndexByName('pageOne')+'\n' + }) + Button('popToName pageOne') + .onClick(() => { + this.lifeCycle = 'testTag popToName pageOne返回值:'+ JSON.stringify(this.derivedStack.popToName('pageOne'))+'\n' + }) + Button('popToIndex 0') + .onClick(() => { + this.lifeCycle = 'testTag popToIndex 0返回值:'+ this.derivedStack.popToIndex(0)+'\n' + }) + Button('getAllPathName') + .onClick(() => { + let mes = JSON.stringify(this.derivedStack.getAllPathName()) + console.log('testTag getAllPathName return :' + mes) + this.lifeCycle += 'testTag getAllPathName返回值:' + mes+'\n' + }) + Button('pushDestination pageOne') + .onClick(() => { + this.derivedStack.pushDestination({ name: 'pageOne', param: new param('pageOne') }, true) + }) + Button('pushPathByName pageOne') + .onClick(() => { + this.derivedStack.pushPathByName1('pageOne', new param('pageOne')) + }) + Button('size') + .onClick(() => { + this.lifeCycle = 'testTag size返回值:' +JSON.stringify(this.derivedStack.size()); + }) + } + } + .title('pageTwo') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('testTag PageTwo onReady'); + this.lifeCycle += 'testTag PageTwo onReady\n'; + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`testTag PageTwo on backpress`) + this.lifeCycle += 'testTag PageTwo on backpress\n'; + this.derivedStack?.pop() + return true + }) + .onShown(() => { + this.lifeCycle += 'testTag PageTwo onShown\n'; + }) + .onHidden(() => { + this.lifeCycle += 'testTag PageTwo onHidden\n'; + }) + + /* + .onWillAppear(() => { + this.lifeCycle += 'testTag PageTwo onWillAppear\n'; + }) + .onAppear(() => { + this.lifeCycle += 'testTag PageTwo onAppear\n'; + }) + .onWillShow(() => { + this.lifeCycle += 'testTag PageTwo onWillShow\n'; + }).onWillHide(() => { + this.lifeCycle += 'testTag PageTwo onWillHide\n'; + }) + .onWillDisappear(() => { + this.lifeCycle += 'testTag PageTwo onWillDisappear\n'; + }) + .onDisAppear(() => { + this.lifeCycle += 'testTag PageTwo onDisAppear\n'; + })*/ + } +} + +@Component +struct PageThree { + @Link lifeCycle: string; + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .mode(NavDestinationMode.DIALOG) + .title('pageThree') + .backgroundColor(Color.Pink) + + .onReady((context: NavDestinationContext) => { + console.log('testTag PageThree onReady'); + this.lifeCycle += 'testTag PageThree onReady\n'; + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`testTag PageThree on backpress`) + this.lifeCycle += 'testTag PageThree on backpress return true!!!\n'; + this.derivedStack?.pop() + return true + }) + .onShown(() => { + this.lifeCycle += 'testTag PageThree onShown\n'; + }) + .onHidden(() => { + this.lifeCycle += 'testTag PageThree onHidden\n'; + }) + + /*.onWillAppear(() => { + this.lifeCycle += 'testTag PageThree onWillAppear\n'; + }) + .onAppear(() => { + this.lifeCycle += 'testTag PageThree onAppear\n'; + }) + .onWillShow(() => { + this.lifeCycle += 'testTag PageThree onWillShow\n'; + })*/ + /*.onWillHide(() => { + this.lifeCycle += 'testTag PageThree onWillHide\n'; + }) + .onWillDisappear(() => { + this.lifeCycle += 'testTag PageThree onWillDisappear\n'; + }) + .onDisAppear(() => { + this.lifeCycle += 'testTag PageThree onDisAppear\n'; + })*/ + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0470.ets new file mode 100755 index 000000000..0378ee4c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0470.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationRouter0470 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + build() { + Navigation() { + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`WLAN`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用WLAN').fontSize(30).padding({ left: 15 }) + } + }.title("WLAN") + .id('three') + } + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(20) + .id('NavRouter01') + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + console.info("test--isActivated1") + this.isActiveWLAN = isActivated + }) + } + .height('100%') + .width('100%') + .title('设置') + .backgroundColor("#F2F3F5") + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Auto) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0480.ets new file mode 100755 index 000000000..687266e38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationRouterTest/ComponentNavNavigationRouter0480.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationRouter0480 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + build() { + Navigation() { + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`WLAN`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用WLAN').fontSize(30).padding({ left: 15 }) + } + }.title("WLAN") + .id('three') + } + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .id('NavRouter02') + .onStateChange((isActivated: boolean) => { + console.info("test--isActivated1") + this.isActiveWLAN = isActivated + }) + } + .height('100%') + .width('100%') + .title('设置') + .backgroundColor("#F2F3F5") + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Auto) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0020.ets new file mode 100755 index 000000000..699f5e117 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0020.ets @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0020 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ListItem() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }) + .id('hideToolBar') + } + + ListItem() { + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + } + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0030.ets new file mode 100755 index 000000000..f98c9ab59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0030.ets @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0030 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ListItem() { + Button(this.hideTitleBar ? '点击显示标题栏' : '点击隐藏标题栏').onClick(() => { + this.hideTitleBar = !this.hideTitleBar + }).id('hideTitleBar') + } + + ListItem() { + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + } + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0040.ets new file mode 100755 index 000000000..8cf995d96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0040.ets @@ -0,0 +1,146 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0040 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ListItem() { + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + } + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060.ets new file mode 100755 index 000000000..f6b4875db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0060.ets @@ -0,0 +1,190 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0060 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + + Column({ space: 10 }) { + Column({ space: 10 }) { + Text('扩展安全区域的类型:') + Column() { + Button('SYSTEM') + .onClick(() => { + if (!this.types.some(item => item == SafeAreaType.SYSTEM)) { + this.types.push(SafeAreaType.SYSTEM) + } + }).id('expandSystem').margin({top:10}) + Button('CUTOUT') + .onClick(() => { + if (!this.types.some(item => item == SafeAreaType.CUTOUT)) { + this.types.push(SafeAreaType.CUTOUT) + } + }).margin({top:10}) + + Button('KEYBOARD') + .onClick(() => { + if (!this.types.some(item => item == SafeAreaType.KEYBOARD)) { + this.types.push(SafeAreaType.KEYBOARD) + } + }).margin({top:10}) + } + } + + Column({ space: 10 }) { + Text('扩展安全区域的类型不支持:') + Column() { + Button('SYSTEM') + .onClick(() => { + this.types = this.types.filter(item => item != SafeAreaType.SYSTEM) + }).id('expandSystemNotSupport').margin({top:10}) + Button('CUTOUT') + .onClick(() => { + this.types = this.types.filter(item => item != SafeAreaType.CUTOUT,) + }).margin({top:10}) + Button('KEYBOARD') + .onClick(() => { + this.types = this.types.filter(item => item != SafeAreaType.KEYBOARD) + }).margin({top:10}) + } + } + } + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0070.ets new file mode 100755 index 000000000..a2573157b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0070.ets @@ -0,0 +1,177 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0070 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + + + Row() { + Text('上边距:') + Counter() { + Text(this.top1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.top1 +=20 + }) + .onDec(() => { + this.top1-- + }) + .id('counterTop') + }.height(50).width('50%').margin({ top: 10 }) + + + Row() { + Text('下边距:') + Counter() { + Text(this.bottom1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.bottom1 +=20 + }) + .onDec(() => { + this.bottom1-- + }) + .id('counterBottom') + + }.height(50).width('50%').margin({ top: 10 }) + + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0080.ets new file mode 100755 index 000000000..f1fdf6aca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0080.ets @@ -0,0 +1,172 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0080 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + + Row() { + Text('左边距:') + Counter() { + Text(this.left1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.left1+=10 + }) + .onDec(() => { + this.left1-- + }).id('counterLeft') + }.height(50).width('50%').margin({ top: 10 }) + + Row() { + Text('右边距:') + Counter() { + Text(this.right1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.right1+=10 + }) + .onDec(() => { + this.right1-- + }).id('counterRight') + }.height(50).width('50%').margin({ top: 10 }) + + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0090.ets new file mode 100755 index 000000000..260983f0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0090.ets @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0090 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ListItem() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }) + .id('hideToolBar') + } + + ListItem() { + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + } + + ListItem() { + Button(this.flag1 ? 'Navigation组件上方不设置文本' : 'Navigation组件上方设置文本').onClick(() => { + this.flag1 = !this.flag1 + }).id('setTopText') + } + + + ListItem() { + Button(this.flag2 ? 'Navigation组件下方不设置文本' : 'Navigation组件下方设置文本').onClick(() => { + this.flag2 = !this.flag2 + }).id('setBottomText') + } + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0100.ets new file mode 100755 index 000000000..b8925f1bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0100.ets @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0100 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Column() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + + Button(this.flag1 ? 'Navigation组件上方不设置文本' : 'Navigation组件上方设置文本').onClick(() => { + this.flag1 = !this.flag1 + }) + .id('setTopText') + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0110.ets new file mode 100755 index 000000000..f8c1a9235 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0110.ets @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0110 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ListItem() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }) + .id('hideToolBar') + } + + ListItem() { + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + } + + + ListItem() { + Button(this.flag2 ? 'Navigation组件下方不设置文本' : 'Navigation组件下方设置文本').onClick(() => { + this.flag2 = !this.flag2 + }).id('setBottomText') + } + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0120.ets new file mode 100755 index 000000000..ada2658a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0120.ets @@ -0,0 +1,217 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Component +export struct pageOneTmp { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationSafeZone0120 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Split + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + PageMap(name: string) { + pageOneTmp() + } + + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + aboutToAppear(): void { + this.pageInfos.pushPath({ name: 'PageOne' }); + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + Column() { + Button(this.hideTitleBar ? '点击显示标题栏' : '点击隐藏标题栏').onClick(() => { + this.hideTitleBar = !this.hideTitleBar + }).id('hideTitleBar') + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + + Column() { + Text('minNarBarWidth:') + Counter() { + Text(this.minNavBarWidth.toString()) + } + .margin({ top: 15 }) + .onInc(() => { + this.minNavBarWidth + 10 + }) + .onDec(() => { + this.minNavBarWidth -= 10 + }).id('counterMinWidth') + }.height(120).width('50%').margin({ top: 10 }) + + Column() { + Text('maxNarBarWidth:') + Counter() { + Text(this.maxNavBarWidth.toString()) + } + .margin({ top: 15 }) + .onInc(() => { + this.maxNavBarWidth += 10 + this.navBarWidth+=10 + }) + .onDec(() => { + this.maxNavBarWidth -= 10 + }).id('counterMaxWidth') + }.height(120).width('50%').margin({ top: 10 }) + } + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .navDestination(this.PageMap) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0140.ets new file mode 100755 index 000000000..1a43206c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0140.ets @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Component +export struct pageOneTmp { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationSafeZone0140 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + PageMap(name: string) { + pageOneTmp() + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + + Button('双栏').onClick(() => { + this.mode=NavigationMode.Split + }).id('doubleColumn') + .margin({ top: 10 }) + + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) + }) + .id('pushPath') + + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .navDestination(this.PageMap) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0150.ets new file mode 100755 index 000000000..1a6f7b940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0150.ets @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0150 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + Row() { + Button('高度 - ') + .onClick(()=>{ + this.top1+=20 + this.bottom1+=30 + }).id('heightReduce') + }.height(50).width('70%').margin({ top: 10 }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + bottom: this.bottom1, + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0160.ets new file mode 100755 index 000000000..4700a3aa6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0160.ets @@ -0,0 +1,88 @@ + +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Top }) { + Button('content', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + + }.title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + .backgroundColor("#ffe3dfdf") + .margin({top:1}) + } +} + +@Entry +@Component +struct ComponentNavNavigationSafeZone0160 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto; + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('button', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(()=>{ + this.mode=NavigationMode.Split + this.pathInfo.pushPath({ name: 'one' }); + }) + .id('button') + } + .width('100%') + .height('100%') + } + .mode(this.mode) + .title('Navigation') + .width('100%') + .height('100%') + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0170.ets new file mode 100755 index 000000000..c02bca962 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0170.ets @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Component +export struct WlanItem { + @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; + title:NavigationCommonTitle= { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Top }) { + Button('content', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '82vp' }) + .height('56vp') + } + .width('100%') + .height('100%') + + }.title(this.title, { + backgroundColor: "#801c6ad4", + barStyle: BarStyle.STACK + }) + .backgroundColor("#ffe3dfdf") + .margin({top:1}) + } +} + +@Entry +@Component +struct ComponentNavNavigationSafeZone0170 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto; + @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; + + @Builder + myRouter(name: string, param?: number | undefined) { + WlanItem() + } + + build() { + GridRow() { + GridCol({ span: { sm: 12, md: 12, lg: 12 } }) { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Button('button', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(()=>{ + this.mode=NavigationMode.Split + this.pathInfo.pushPath({ name: 'one' }); + }) + .id('button') + } + .width('100%') + .height('100%') + } + .mode(this.mode) + .title('Navigation') + .width('100%') + .height('100%') + .backgroundColor("#fff1a2a2") + .navDestination(this.myRouter) + .alignSelf(ItemAlign.Center) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180.ets new file mode 100755 index 000000000..150a6df87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0180.ets @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PageOneTmp } from './PageOne' +import { PageTwoTmp } from './PageTwo' + +@Entry +@Component +struct ComponentNavNavigationSafeZone0180 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ff21a38e', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOneTmp() + } else if (name === 'pageTwo') { + PageTwoTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBachGround') + + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) + }).id('pushPath') + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .navDestination(this.PageMap) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0190.ets new file mode 100755 index 000000000..5d36f2e58 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0190.ets @@ -0,0 +1,145 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0190 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + scroller: Scroller = new Scroller() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + Scroll(this.scroller) { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + } + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0200.ets new file mode 100755 index 000000000..930b945e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0200.ets @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentNavNavigationSafeZone0200 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ffffff', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + scroller: Scroller = new Scroller() + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + Scroll(this.scroller) { + Column() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }).id('hideToolBar') + .margin({ top: 10 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBackGround') + .margin({ top: 10 }) + } + } + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210.ets new file mode 100755 index 000000000..0383dbd0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/ComponentNavNavigationSafeZone0210.ets @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PageOneTmp } from './PageOne' +import { PageTwoTmp } from './PageTwo' + +@Entry +@Component +struct ComponentNavNavigationSafeZone0210 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = true + @State mode: NavigationMode = NavigationMode.Auto + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State flag1: boolean = false + @State flag2: boolean = false + @State top1: number = 0 + @State left1: number = 0 + @State bottom1: number = 0 + @State right1: number = 0 + @State backgroundColor1: string[] = ['#ff21a38e', '#8bd4cc'] + @State index: number = 0 + @State types: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD] + @State edges: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END] + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOneTmp() + } else if (name === 'pageTwo') { + PageTwoTmp() + } + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + text1() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + @Builder + text2() { + Text('文本').height('350').width('240').border({ width: 1 }) + } + + build() { + Column() { + if (this.flag1) { + this.text1() + } + Navigation(this.pageInfos) { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + Button('背景颜色改变').onClick(() => { + this.index++ + if (this.index > this.backgroundColor1.length - 1) { + this.index = 0 + } + }).id('changeBachGround') + + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) + }).id('pushPath') + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: $r("app.media.icon") + }, + { + value: 'app', + icon: $r("app.media.icon") + }, + { + value: 'collect', + icon: $r("app.media.icon") + } + ]) + .navDestination(this.PageMap) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .expandSafeArea(this.types, this.edges) + .margin({ + top: this.top1, + left: this.left1, + bottom: this.bottom1, + right: this.right1 + }) + .backgroundColor(this.backgroundColor1[this.index]) + .layoutWeight(1) + + if (this.flag2) { + this.text2() + } + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageOne.ets new file mode 100755 index 000000000..b1aaccd7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageOne.ets @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class TmpClass { + count: number = 10 +} + +@Builder +export function PageOneBuilder(name: string, param: Object) { + PageOneTmp() +} + +@Component +export struct PageOneTmp { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let tmp = new TmpClass() + this.pageInfos.pushPathByName('pageTwo', tmp) //将name指定的NavDestination页面信息入栈,传递的数据为param + }) + .id('pushPathByNameOne') + Button('singletonLaunchMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }, + { launchMode: LaunchMode.MOVE_TO_TOP_SINGLETON }) //从栈底向栈顶查找,如果指定的名称已经存在,则将对应的NavDestination页面移到栈顶 + }) + Button('popToname', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.popToName('pageTwo') //回退路由栈到第一个名为name的NavDestination页面 + console.log('popToName' + JSON.stringify(this.pageInfos), + '返回值' + JSON.stringify(this.pageInfos.popToName('pageTwo'))) + }) + Button('popToIndex', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.popToIndex(1) // 回退路由栈到index指定的NavDestination页面 + console.log('popToIndex' + JSON.stringify(this.pageInfos)) + }) + Button('moveToTop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.moveToTop('pageTwo') // 将第一个名为name的NavDestination页面移到栈顶 + console.log('moveToTop' + JSON.stringify(this.pageInfos), + '返回值' + JSON.stringify(this.pageInfos.moveToTop('pageTwo'))) + }) + Button('moveIndexToTop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.moveIndexToTop(1) // 将index指定的NavDestination页面移到栈顶 + console.log('moveIndexToTop' + JSON.stringify(this.pageInfos)) + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.clear() //清除栈中所有页面 + }) + Button('get', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + console.log('-------------------') + console.log('获取栈中所有NavDestination页面的名称', JSON.stringify(this.pageInfos.getAllPathName())) + console.log('获取index指定的NavDestination页面的参数信息', + JSON.stringify(this.pageInfos.getParamByIndex(1))) + console.log('获取全部名为name的NavDestination页面的参数信息', + JSON.stringify(this.pageInfos.getParamByName('pageTwo'))) + console.log('获取全部名为name的NavDestination页面的位置索引', + JSON.stringify(this.pageInfos.getIndexByName('pageOne'))) + console.log('获取栈大小', JSON.stringify(this.pageInfos.size())) + }) + }.width('100%').height('100%') + }.title('pageOne') + .backgroundColor("#ffec5b5b") + .onBackPressed(() => { + const popDestinationInfo = this.pageInfos.pop() // 弹出路由栈栈顶元素 + console.log('pop' + '返回值' + JSON.stringify(popDestinationInfo)) + return true + }).onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageTwo.ets new file mode 100755 index 000000000..988f36155 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationSafeZoneTest/PageTwo.ets @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +export function PageTwoBuilder(name: string, param: Object) { + PageTwoTmp() +} + +@Component +export struct PageTwoTmp { + pathStack: NavPathStack = new NavPathStack() + private menuItems: Array = [ + { + value: "1", + icon: 'resources/base/media/undo.svg', + }, + { + value: "2", + icon: 'resources/base/media/redo.svg', + isEnabled: false, + }, + { + value: "3", + icon: 'resources/base/media/ic_public_ok.svg', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.pushPathByName('pageOne', null) + }) + .id('pushPathByNameTwo') + }.width('100%').height('100%') + }.title('pageTwo') + .backgroundColor("#ffec5b8e") + .menus(this.menuItems) + .onBackPressed(() => { + this.pathStack.pop() + return true + }) + .onReady((context: NavDestinationContext) => { + this.pathStack = context.pathStack; + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0010.ets new file mode 100755 index 000000000..a390352c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0010.ets @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0010 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0010') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb" + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0020.ets new file mode 100755 index 000000000..161c7c9ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0020.ets @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0030 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0020') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb" + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030.ets new file mode 100755 index 000000000..e1e7bee8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0030.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0030 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.mode == NavigationMode.Split) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0030') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040.ets new file mode 100755 index 000000000..0bb320d51 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0040.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0040 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0040') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thin + }) + .id('toolbarBlur0040') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050.ets new file mode 100755 index 000000000..c02936d1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0050.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0050 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0050') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thick + }) + .id('toolbarBlur0050') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060.ets new file mode 100755 index 000000000..f94ffc85f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0060.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0060 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0060') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Regular + }) + .id('toolbarBlur0060') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070.ets new file mode 100755 index 000000000..c0bade84d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0070.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0070 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0070') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_REGULAR + }) + .id('toolbarBlur0070') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080.ets new file mode 100755 index 000000000..869a45dd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0080.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0080 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0080') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.NONE + }) + .id('toolbarBlur0080') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090.ets new file mode 100755 index 000000000..e8a9a5f7f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0090.ets @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0090 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('60%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0090') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('60%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_THIN + }) + .id('toolbarBlur0090') + + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100.ets new file mode 100755 index 000000000..2d2158e9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0100.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0100 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0100') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THIN + }) + .id('toolbarBlur0100') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110.ets new file mode 100755 index 000000000..9a970a150 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0110.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0110 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0110') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_THIN + }) + .id('toolbarBlur0110') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120.ets new file mode 100755 index 000000000..ed04136a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0120.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0120 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0120') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_REGULAR + }) + .id('toolbarBlur0120') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130.ets new file mode 100755 index 000000000..025704606 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0130.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0130 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + //this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0130') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thin + }) + .id('toolbarBlur0130') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140.ets new file mode 100755 index 000000000..fe6d25a33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0140.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0140 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0140') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thin + }) + .id('toolbarBlur0140') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150.ets new file mode 100755 index 000000000..e62c171ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0150.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0150 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0150') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Regular + }) + .id('toolbarBlur0150') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160.ets new file mode 100755 index 000000000..157e8df74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0160.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0160 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0160') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_REGULAR + }) + .id('toolbarBlur0160') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170.ets new file mode 100755 index 000000000..6713e9526 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0170.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0170 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0170') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.NONE + }) + .id('toolbarBlur0170') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180.ets new file mode 100755 index 000000000..ec24b19c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0180.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0180 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0180') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_THIN + }) + .id('toolbarBlur0180') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190.ets new file mode 100755 index 000000000..eabc3d452 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0190.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0190 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0190') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_THIN + }) + .id('toolbarBlur0190') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200.ets new file mode 100755 index 000000000..46ca3769e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0200.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0200 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0200') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_THIN + }) + .id('toolbarBlur0200') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210.ets new file mode 100755 index 000000000..594626e7c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0210.ets @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationTitleBarBlur0210 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('toolMode0210') + + Button('工具栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_REGULAR + }) + .id('toolbarBlur0210') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0220.ets new file mode 100755 index 000000000..6504e4489 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationTitleBarBlurTest/ComponentNavNavigationTitleBarBlur0220.ets @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0020 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '32vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0020') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation") + .toolbarConfiguration([ + { value: "a" }, + { value: "b" } + ], { + backgroundColor: "#802cd7bb", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0010.ets new file mode 100755 index 000000000..1954295bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0010.ets @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0010 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0010') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0020.ets new file mode 100755 index 000000000..91b6902e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0020.ets @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0020 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0020') + + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030.ets new file mode 100755 index 000000000..8f5504960 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0030.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0030 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0030') + + Button('切换stack', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + .id('blurStyle0030') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0040.ets new file mode 100755 index 000000000..90492999c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0040.ets @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0040 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0040') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thin + }) + .id('blurStyle0040') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle, + + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050.ets new file mode 100755 index 000000000..3941fb267 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0050.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0050 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0050') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thick + }) + .id('blurStyle0050') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060.ets new file mode 100755 index 000000000..7af62a523 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0060.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0060 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0060') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Regular + }) + .id('blurStyle0060') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070.ets new file mode 100755 index 000000000..4b9c5dd6d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0070.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0070 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0070') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_REGULAR + }) + .id('blurStyle0070') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080.ets new file mode 100755 index 000000000..f8c49cc59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0080.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0080 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0080') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.NONE + }) + .id('blurStyle0080') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090.ets new file mode 100755 index 000000000..a99f434a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0090.ets @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0090 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('60%') + .fontSize('16sp') + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0090') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('60%') + .fontSize('16sp') + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_THIN + }) + .id('blurStyle0090') + + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100.ets new file mode 100755 index 000000000..052d1d833 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0100.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0100 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0100') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THIN + }) + .id('blurStyle0100') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110.ets new file mode 100755 index 000000000..81e6b6019 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0110.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0110 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0110') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_THIN + }) + .id('blurStyle0110') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120.ets new file mode 100755 index 000000000..96ba0713a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0120.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0120 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0120') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_REGULAR + }) + .id('blurStyle0120') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130.ets new file mode 100755 index 000000000..48e6b00a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0130.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0130 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0130') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thin + }) + .id('blurStyle0130') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140.ets new file mode 100755 index 000000000..eed3fde8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0140.ets @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0140 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0140') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Thick + }) + .id('blurStyle0140') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150.ets new file mode 100755 index 000000000..afc12ddef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0150.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0150 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0150') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.Regular + }) + .id('blurStyle0150') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160.ets new file mode 100755 index 000000000..9a2565569 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0160.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0160 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Stack + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0160') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THIN + }) + .id('blurStyle0160') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170.ets new file mode 100755 index 000000000..972220f3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0170.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0170 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0170') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.NONE + }) + .id('blurStyle0170') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180.ets new file mode 100755 index 000000000..0a3892264 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0180.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0180 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0180') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_THIN + }) + .id('blurStyle0180') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190.ets new file mode 100755 index 000000000..74cc457a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0190.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0190 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0190') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }) + .id('blurStyle0190') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200.ets new file mode 100755 index 000000000..9fdd116aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0200.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0200 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0200') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.BACKGROUND_THIN + }) + .id('blurStyle0200') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210.ets new file mode 100755 index 000000000..851edee64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0210.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Component +export struct PageOne { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + title: NavigationCommonTitle = { + main: 'MainTitle', + sub: 'SubTitle' + } + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor('#ff6eedcc') + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + } + } + .width('100%') + .height('100%') + }.title('PageOne') + } +} + +@Entry +@Component +struct ComponentNavNavigationToolBar0210 { + @State pathInfo: NavPathStack = new NavPathStack(); + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State blurStyle: BlurStyle = BlurStyle.NONE + + @Builder + myRouter(name: string, param?: number | undefined) { + PageOne() + } + + aboutToAppear(): void { + // this.pathInfo.pushPath({ name: 'PageOne' }); + } + + build() { + Navigation(this.pathInfo) { + Stack({ alignContent: Alignment.Center }) { + Column() { + Button('NavigationMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '24vp' }) + .height('56vp') + .onClick(() => { + if (this.mode == NavigationMode.Auto) { + this.mode = NavigationMode.Split + return + } + + if (this.titleMode == NavigationTitleMode.Mini) { + this.titleMode = NavigationTitleMode.Full + } + }) + .id('mode0210') + + Button('标题栏材质模糊', { stateEffect: true, type: ButtonType.Capsule }) + .width('100%') + .fontSize('16sp') + .margin({ top: '56vp' }) + .height('56vp') + .onClick(() => { + this.blurStyle = BlurStyle.COMPONENT_REGULAR + }) + .id('blurStyle0210') + } + } + .width('100%') + .height('100%') + } + .navBarWidth(360) + .width('100%') + .titleMode(this.titleMode) + .height('100%') + .navDestination(this.myRouter) + .mode(this.mode) + .alignSelf(ItemAlign.Center) + .title("Navigation", { + backgroundColor: "#ff6ddde2", + backgroundBlurStyle: this.blurStyle + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0250.ets new file mode 100755 index 000000000..2b60a11f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/ComponentNavNavigationToolBar0250.ets @@ -0,0 +1,457 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PageOneTmp } from './PageOne' +import { PageTwoTmp } from './PageTwo' + +class A { + text: string = '' + num: number = 0 +} + +@Entry +@Component +struct NavigationExample { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State mode: NavigationMode = NavigationMode.Auto + @State titleMode: NavigationTitleMode = NavigationTitleMode.Free + @State navBarWidth: number = 240 + @State minNavBarWidth: number = 240 + @State maxNavBarWidth: number = 350 + @State NavBarPosition1: NavBarPosition = NavBarPosition.Start + @State height1: number = 100 + @State width1: number = 300 + @State backgroundColor1: Color[] = [Color.Gray, Color.Red, Color.Pink, Color.Brown] + @State index: number = 0 + @State height2: number = 50 + @State value: BlurStyle = BlurStyle.NONE + @State value2: BlurStyle = BlurStyle.NONE + @State value3: BlurStyle = BlurStyle.NONE + @State colorMode1: ThemeColorMode = ThemeColorMode.SYSTEM + @State colorMode2: ThemeColorMode = ThemeColorMode.SYSTEM + @State colorMode3: ThemeColorMode = ThemeColorMode.SYSTEM + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + PageOneTmp() + } else if (name === 'pageTwo') { + PageTwoTmp() + } + + } + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + } + .alignItems(HorizontalAlign.Start) + .backgroundImage($r('app.media.icon')) + .backgroundBlurStyle(this.value, { colorMode: this.colorMode1 }) + .height(this.height1) + .width(this.width1) + } + + @Builder + NavigationMenus() { + Row() { + Image('common/ic_public_add.svg') + .width(24) + .height(24) + Image('common/ic_public_add.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('common/ic_public_more.svg') + .width(24) + .height(24) + .margin({ left: 24 }) + }.backgroundColor('#5e86ff') + + } + + @Builder + toolbarConfiguration() { + Row() { + Column() { + Text('add') + }.width('50%') + + Column() { + Text('app') + }.width('50%') + + Column() { + } + } + .height(this.height2) + .backgroundImage($r('app.media.icon')) + .backgroundBlurStyle(this.value3, { colorMode: this.colorMode3 }) + } + + build() { + Column() { + Navigation(this.pageInfos) { + List({ space: 10, initialIndex: 0 }) { + ListItem() { + Button(this.hideTitleBar ? '点击显示标题栏' : '点击隐藏标题栏').onClick(() => { + this.hideTitleBar = !this.hideTitleBar + }) + } + + ListItem() { + Button(this.hideToolBar ? '点击显示工具栏' : '点击隐藏工具栏').onClick(() => { + this.hideToolBar = !this.hideToolBar + }) + } + + ListItem() { + Row() { + Text('显示模式:') + Text('单栏').width(50).onClick(() => { + this.mode = NavigationMode.Stack + }) + Text('双栏').width(50).onClick(() => { + this.mode = NavigationMode.Split + }) + Text('自适应').width(50).onClick(() => { + this.mode = NavigationMode.Auto + }) + } + } + + ListItem() { + Row() { + Text('标题栏显示模式:') + Text('Free').width(50).onClick(() => { + this.titleMode = NavigationTitleMode.Free + }) + Text('Mini').width(50).onClick(() => { + this.titleMode = NavigationTitleMode.Mini + }) + Text('Full').width(50).onClick(() => { + this.titleMode = NavigationTitleMode.Full + }) + } + } + + ListItem() { + Row() { + + Text('导航栏宽度') + Counter() { + Text(this.navBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.navBarWidth += 10 + }) + .onDec(() => { + this.navBarWidth -= 10 + }) + }.height(50).width('50%') + } + + ListItem() { + Row() { + Text('minNavBarWidth:') + Counter() { + Text(this.minNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.minNavBarWidth++ + }) + .onDec(() => { + this.minNavBarWidth-- + }) + }.height(50).width('50%') + } + + ListItem() { + Row() { + Text('maxNavBarWidth:') + Counter() { + Text(this.maxNavBarWidth.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.maxNavBarWidth++ + }) + .onDec(() => { + this.maxNavBarWidth-- + }) + }.height(50).width('50%') + } + + ListItem() { + Row() { + Text('标题栏材质模糊:') + Column({ space: 10 }) { + Text('Thin').onClick(() => { + this.value = BlurStyle.Thin + }) + + Text('Regular').onClick(() => { + this.value = BlurStyle.Regular + }) + Text('Thick').onClick(() => { + this.value = BlurStyle.Thick + }) + Text('BACKGROUND_THIN').onClick(() => { + this.value = BlurStyle.BACKGROUND_THIN + }) + Text('BACKGROUND_REGULAR').onClick(() => { + this.value = BlurStyle.BACKGROUND_REGULAR + }) + Text('BACKGROUND_THICK').onClick(() => { + this.value = BlurStyle.BACKGROUND_THICK + }) + Text('BACKGROUND_ULTRA_THICK').onClick(() => { + this.value = BlurStyle.BACKGROUND_ULTRA_THICK + }) + Text('NONE').onClick(() => { + this.value = BlurStyle.NONE + }) + Text('COMPONENT_ULTRA_THIN').onClick(() => { + this.value = BlurStyle.COMPONENT_ULTRA_THIN + }) + Text('COMPONENT_THIN').onClick(() => { + this.value = BlurStyle.COMPONENT_THIN + }) + Text('COMPONENT_REGULAR').onClick(() => { + this.value = BlurStyle.COMPONENT_REGULAR + }) + Text('COMPONENT_THICK').onClick(() => { + this.value = BlurStyle.COMPONENT_THICK + }) + Text('COMPONENT_ULTRA_THICK').onClick(() => { + this.value = BlurStyle.COMPONENT_ULTRA_THICK + }) + } + } + } + + ListItem() { + Row() { + Text('工具栏材质模糊:') + Column({ space: 10 }) { + Text('Thin').onClick(() => { + this.value3 = BlurStyle.Thin + }) + Text('Regular').onClick(() => { + this.value3 = BlurStyle.Regular + }) + + Text('Thick').onClick(() => { + this.value3 = BlurStyle.Thick + }) + Text('BACKGROUND_THIN').onClick(() => { + this.value3 = BlurStyle.BACKGROUND_THIN + }) + Text('BACKGROUND_REGULAR').onClick(() => { + this.value3 = BlurStyle.BACKGROUND_REGULAR + }) + Text('BACKGROUND_THICK').onClick(() => { + this.value3 = BlurStyle.BACKGROUND_THICK + }) + Text('BACKGROUND_ULTRA_THICK').onClick(() => { + this.value3 = BlurStyle.BACKGROUND_ULTRA_THICK + }) + Text('NONE').onClick(() => { + this.value3 = BlurStyle.NONE + }) + Text('COMPONENT_ULTRA_THIN').onClick(() => { + this.value3 = BlurStyle.COMPONENT_ULTRA_THIN + }) + Text('COMPONENT_THIN').onClick(() => { + this.value3 = BlurStyle.COMPONENT_THIN + }) + Text('COMPONENT_REGULAR').onClick(() => { + this.value3 = BlurStyle.COMPONENT_REGULAR + }) + Text('COMPONENT_THICK').onClick(() => { + this.value3 = BlurStyle.COMPONENT_THICK + }) + Text('COMPONENT_ULTRA_THICK').onClick(() => { + this.value3 = BlurStyle.COMPONENT_ULTRA_THICK + }) + } + } + } + + ListItem() { + Row() { + Text('标题栏高度:') + Counter() { + Text(this.height1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.height1++ + }) + .onDec(() => { + this.height1-- + }) + }.height(50) + } + + + ListItem() { + Row() { + Text('工具栏高度:') + Counter() { + Text(this.height2.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.height2++ + }) + .onDec(() => { + this.height2-- + }) + }.height(50) + } + + ListItem() { + Row() { + Text('工具栏宽度:') + Counter() { + Text(this.width1.toString()) + }.margin({ right: 20 }) + .onInc(() => { + this.width1 += 10 + }) + .onDec(() => { + this.width1 -= 10 + }) + }.height(50) + } + + ListItem() { + Button('点击切换背景色').onClick((event: ClickEvent) => { + this.index++ + if (this.index > (this.backgroundColor1.length - 1)) { + this.index = 0 + } + }) + } + + ListItem() { + Row({ space: 10 }) { + Text('导航栏位置:') + Text('Start').onClick(() => { + this.NavBarPosition1 = NavBarPosition.Start + }) + Text('End').onClick(() => { + this.NavBarPosition1 = NavBarPosition.End + }) + } + } + + ListItem() { + Row({ space: 10 }) { + Text('标题栏colorMode:') + Text('SYSTEM').onClick(() => { + this.colorMode1 = ThemeColorMode.SYSTEM + }) + Text('LIGHT').onClick(() => { + this.colorMode1 = ThemeColorMode.LIGHT + }) + Text('DARK').onClick(() => { + this.colorMode1 = ThemeColorMode.DARK + }) + } + } + + ListItem() { + Row({ space: 10 }) { + Text('navigation colorMode:') + Text('SYSTEM').onClick(() => { + this.colorMode2 = ThemeColorMode.SYSTEM + }) + Text('LIGHT').onClick(() => { + this.colorMode2 = ThemeColorMode.LIGHT + }) + Text('DARK').onClick(() => { + this.colorMode2 = ThemeColorMode.DARK + }) + } + } + + ListItem() { + Row({ space: 10 }) { + Text('工具栏 colorMode:') + Text('SYSTEM').onClick(() => { + this.colorMode3 = ThemeColorMode.SYSTEM + }) + Text('LIGHT').onClick(() => { + this.colorMode3 = ThemeColorMode.LIGHT + }) + Text('DARK').onClick(() => { + this.colorMode3 = ThemeColorMode.DARK + }) + } + } + + ListItem() { + Button('pushPath DIALOG', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) + }) + } + + ListItem() { + Button('pushPath STANDARD', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageTwo' }) + }) + } + } + .height('100%') + .width('100%') + .margin({ top: 12 }) + } + .mode(this.mode) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(this.hideToolBar) + .titleMode(this.titleMode) + .navBarWidth(this.navBarWidth) + .navBarWidthRange([this.minNavBarWidth, this.maxNavBarWidth]) + .navDestination(this.PageMap) + .toolbarConfiguration(this.toolbarConfiguration) + .navBarPosition(this.NavBarPosition1) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .width('100%') + .height('100%') + .backgroundBlurStyle(this.value2, { colorMode: this.colorMode2 }) + .backgroundColor(this.backgroundColor1[this.index]) + }.backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageOne.ets new file mode 100755 index 000000000..94e49ec07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageOne.ets @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class TmpClass { + count: number = 10 +} + +@Builder +export function PageOneBuilder(name: string, param: Object) { + PageOneTmp() +} + +@Component +export struct PageOneTmp { + pageInfos: NavPathStack = new NavPathStack() + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let tmp = new TmpClass() + this.pageInfos.pushPathByName('pageTwo', tmp) //将name指定的NavDestination页面信息入栈,传递的数据为param + }) + .id('pushPathByNameOne') + Button('singletonLaunchMode', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }, + { launchMode: LaunchMode.MOVE_TO_TOP_SINGLETON }) //从栈底向栈顶查找,如果指定的名称已经存在,则将对应的NavDestination页面移到栈顶 + }) + Button('popToname', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.popToName('pageTwo') //回退路由栈到第一个名为name的NavDestination页面 + console.log('popToName' + JSON.stringify(this.pageInfos), + '返回值' + JSON.stringify(this.pageInfos.popToName('pageTwo'))) + }) + Button('popToIndex', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.popToIndex(1) // 回退路由栈到index指定的NavDestination页面 + console.log('popToIndex' + JSON.stringify(this.pageInfos)) + }) + Button('moveToTop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.moveToTop('pageTwo') // 将第一个名为name的NavDestination页面移到栈顶 + console.log('moveToTop' + JSON.stringify(this.pageInfos), + '返回值' + JSON.stringify(this.pageInfos.moveToTop('pageTwo'))) + }) + Button('moveIndexToTop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.moveIndexToTop(1) // 将index指定的NavDestination页面移到栈顶 + console.log('moveIndexToTop' + JSON.stringify(this.pageInfos)) + }) + Button('clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.clear() //清除栈中所有页面 + }) + Button('get', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + console.log('-------------------') + console.log('获取栈中所有NavDestination页面的名称', JSON.stringify(this.pageInfos.getAllPathName())) + console.log('获取index指定的NavDestination页面的参数信息', + JSON.stringify(this.pageInfos.getParamByIndex(1))) + console.log('获取全部名为name的NavDestination页面的参数信息', + JSON.stringify(this.pageInfos.getParamByName('pageTwo'))) + console.log('获取全部名为name的NavDestination页面的位置索引', + JSON.stringify(this.pageInfos.getIndexByName('pageOne'))) + console.log('获取栈大小', JSON.stringify(this.pageInfos.size())) + }) + }.width('100%').height('100%') + }.title('pageOne') + .backgroundColor("#ffec5b5b") + .onBackPressed(() => { + const popDestinationInfo = this.pageInfos.pop() // 弹出路由栈栈顶元素 + console.log('pop' + '返回值' + JSON.stringify(popDestinationInfo)) + return true + }).onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageTwo.ets new file mode 100755 index 000000000..5ae1a5f23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavNavigationToolBarTest/PageTwo.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Builder +export function PageTwoBuilder(name: string, param: Object) { + PageTwoTmp() +} + +@Component +export struct PageTwoTmp { + pathStack: NavPathStack = new NavPathStack() + private menuItems: Array = [ + { + value: "1", + icon: 'resources/base/media/undo.svg', + }, + { + value: "2", + icon: 'resources/base/media/redo.svg', + isEnabled: false, + }, + { + value: "3", + icon: 'resources/base/media/ic_public_ok.svg', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.pushPathByName('pageOne', null) + }) + .id('pushPathByNameTwo') + }.width('100%').height('100%') + }.title('pageTwo') + .backgroundColor("#ffec5b8e") + .menus(this.menuItems) + .onBackPressed(() => { + this.pathStack.pop() + return true + }) + .onReady((context: NavDestinationContext) => { + this.pathStack = context.pathStack; + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027.ets new file mode 100755 index 000000000..8aec9f0d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase027.ets @@ -0,0 +1,176 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase027 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('useInterception') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036.ets new file mode 100755 index 000000000..4b560fa18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase036.ets @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase036 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State log: string = "" + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + if (typeof from === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + this.log = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.log += " operation :" + JSON.stringify(operation) + this.log += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + // if (typeof from === "string") { + // console.info("didShow--> current transition is from navigation home"); + // } else { + // console.info("nav-- didShow--from > " + + // JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // if (typeof to === "string") { + // console.info("didShow--> current transition to is navBar"); + // } else { + // console.info("nav-- didShow--to > " + + // JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + // console.info("nav-- didShow--animated > " + isAnimated) + // this.log += "didShow operation :" + JSON.stringify(operation) + // this.log += "didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.log).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097.ets new file mode 100755 index 000000000..61557f19f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase097.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase097 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df.ets new file mode 100755 index 000000000..b53e25c9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase0df.ets @@ -0,0 +1,149 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase0df { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State log: string = "" + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + if (typeof from === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + this.log = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.log += " operation :" + JSON.stringify(operation) + this.log += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + // if (typeof from === "string") { + // console.info("didShow--> current transition is from navigation home"); + // } else { + // console.info("nav-- didShow--from > " + + // JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // if (typeof to === "string") { + // console.info("di dShow--> current transition to is navBar"); + // } else { + // console.info("nav-- didShow--to > " + + // JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + // console.info("nav-- didShow--animated > " + isAnimated) + // this.log += "didShow operation :" + JSON.stringify(operation) + // this.log += "didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } + } + + build() { + Column() { + Text(this.log).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase27c.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase27c.ets new file mode 100755 index 000000000..9fd48a6e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase27c.ets @@ -0,0 +1,186 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCased4d { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + let info = (to as NavDestinationContext).pathInfo + if (info) { + console.info("nav-- didShow--to > " + + JSON.stringify(info).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify(info).split(",")[0].split(":")[1] + } else { + this.logDid += " didShow to :" + info + } + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + + Button('pageFive', { stateEffect: true, type: ButtonType.Capsule }) + .id('pageFive') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageFive'}) + }) + + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388.ets new file mode 100755 index 000000000..75f41dbec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase388.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase388 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421.ets new file mode 100755 index 000000000..cd2bfc502 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase421.ets @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase421 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State log: string = "" + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + if (typeof from === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + this.log = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.log += " operation :" + JSON.stringify(operation) + this.log += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + // if (typeof from === "string") { + // console.info("didShow--> current transition is from navigation home"); + // } else { + // console.info("nav-- didShow--from > " + + // JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // if (typeof to === "string") { + // console.info("didShow--> current transition to is navBar"); + // } else { + // console.info("nav-- didShow--to > " + + // JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + // console.info("nav-- didShow--animated > " + isAnimated) + // this.log += "didShow operation :" + JSON.stringify(operation) + // this.log += "didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.log).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase59a.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase59a.ets new file mode 100755 index 000000000..9919b8791 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase59a.ets @@ -0,0 +1,163 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase59a { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State log: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + if (typeof from === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + this.log = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.log += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.log += " operation :" + JSON.stringify(operation) + this.log += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + // if (typeof from === "string") { + // console.info("didShow--> current transition is from navigation home"); + // } else { + // console.info("nav-- didShow--from > " + + // JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // if (typeof to === "string") { + // console.info("didShow--> current transition to is navBar"); + // } else { + // console.info("nav-- didShow--to > " + + // JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + // this.log += "didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + // } + // console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + // console.info("nav-- didShow--animated > " + isAnimated) + // this.log += "didShow operation :" + JSON.stringify(operation) + // this.log += "didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.log).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3.ets new file mode 100755 index 000000000..d894f65bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase5b3.ets @@ -0,0 +1,176 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase5b3 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('useInterception') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase899.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase899.ets new file mode 100755 index 000000000..4d98433c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCase899.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCase899 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25.ets new file mode 100755 index 000000000..0ae3ffe7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb25.ets @@ -0,0 +1,176 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCaseb25 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('useInterception') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52.ets new file mode 100755 index 000000000..6908280de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCaseb52.ets @@ -0,0 +1,176 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCaseb52 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('useInterception') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd.ets new file mode 100755 index 000000000..b7bfc729a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasecdd.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCasecdd { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d.ets new file mode 100755 index 000000000..054cffa48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased4d.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCased4d { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased8a.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased8a.ets new file mode 100755 index 000000000..117242daf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCased8a.ets @@ -0,0 +1,177 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCased8a { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + @StorageProp('shown') shown:string='' + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid + " "+this.shown).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('useInterception') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8.ets new file mode 100755 index 000000000..f486b4c5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasedc8.ets @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCasedc8 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill ='' + if (typeof from === "string") { + this.logWill += "from :" +from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" +to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid=' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + }else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill+" "+this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45.ets new file mode 100755 index 000000000..5128cbe48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/ComponentNavigationTestCasef45.ets @@ -0,0 +1,176 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOne_testCaseTmp } from './pageOne'; +import { pageTwo_testCaseTmp } from './pageTwo'; +import { pageThree_testCaseTmp } from './pageThree'; + +export class MyParam_testCase { + operation: number = 1 + text: string = '' +} + +@Entry +@Component +struct ComponentNavigationTestCasef45 { + pageInfos: NavPathStack = new NavPathStack() + @State isUseInterception: boolean = true; + @State logWill: string = "" + @State logDid: string = "" + @State disableAnimation: boolean = false; + @StorageProp('navigationMode') mode: NavigationMode | null = NavigationMode.Stack + + aboutToAppear(): void { + this.registerInterception() + } + + registerInterception() { + this.pageInfos.setInterception({ + // 页面跳转前拦截,允许操作栈,在当前跳转中生效。 + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, animated: boolean) => { + if (!this.isUseInterception) { + return; + } + + this.logWill = '' + if (typeof from === "string") { + this.logWill += "from :" + from + console.info("willShow--> target page is navigation home"); + return; + } else { + this.logWill = "willshow " + console.info("nav-- willShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += "from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + + if (typeof to === "string") { + this.logWill += " to :" + to + console.info("willShow--> target page is navigation home"); + return; + } else { + console.info("nav-- willShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logWill += " to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- willShow--operation > " + JSON.stringify(operation)) + console.info("nav-- willShow--animated > " + animated) + this.logWill += " operation :" + JSON.stringify(operation) + this.logWill += " animated :" + animated + }, + // 页面跳转后回调,在该回调中操作栈在下一次跳转中刷新。 + didShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + + this.logDid = ' ' + + if (typeof from === "string") { + console.info("didShow--> current transition is from navigation home"); + } else { + console.info("nav-- didShow--from > " + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow from :" + + JSON.stringify((from as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + if (typeof to === "string") { + console.info(" didShow--> current transition to is navBar"); + } else { + console.info("nav-- didShow--to > " + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1]) + this.logDid += " didShow to :" + + JSON.stringify((to as NavDestinationContext).pathInfo).split(",")[0].split(":")[1] + } + console.info("nav-- didShow--operation > " + JSON.stringify(operation)) + console.info("nav-- didShow--animated > " + isAnimated) + this.logDid += " didShow operation :" + JSON.stringify(operation) + this.logDid += " didShow animated :" + isAnimated + }, + // Navigation单双栏显示状态发生变更时触发该回调。 + modeChange: (mode: NavigationMode) => { + this.logDid ='' + if (!this.isUseInterception) { + return; + } + console.info(`current navigation mode is ${mode}`); + this.logDid = " current navigation mode is:" + mode + } + }) + } + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOne_testCaseTmp() + } else if (name === 'pageTwo') { + pageTwo_testCaseTmp() + } else if (name === 'pageThree') { + pageThree_testCaseTmp() + } + } + + build() { + Column() { + Text(this.logWill + " " + this.logDid).width("100%").height("10%") + .padding({ left: 10, right: 10 }) + + Navigation(this.pageInfos) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('pushOne') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam_testCase(); + p.text = "from children navigation" + this.pageInfos.pushPath({ name: 'pageOne', param: p }) + }) + Button('use interception', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.isUseInterception = !this.isUseInterception; + if (this.isUseInterception) { + this.registerInterception(); + } else { + this.pageInfos.setInterception(undefined); + } + }) + .id('ComponentNavigationTestCase421_002') + + Button(`use animation:${this.disableAnimation}`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.disableAnimation = !this.disableAnimation; + this.pageInfos.disableAnimation(this.disableAnimation) + }) + .id('useAnimation') + } + } + .title("children") + .width('100%') + .height('90%') + .navDestination(this.PageMap) + .title("NavIndex") + .mode(this.mode) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageOne.ets new file mode 100755 index 000000000..8172401b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageOne.ets @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class TmpClass { + count: number = 10 +} + +@Entry +@Component +export struct pageOne_testCaseTmp { + pageInfos: NavPathStack = new NavPathStack(); + @State isChange: boolean = false; + + build() { + NavDestination() { + Column() { + Button('pushPageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(35) + .margin(5) + .id("pushTwo") + .onClick(() => { + let tmp = new TmpClass() + if (this.isChange) { + this.pageInfos.pushPath({ name: 'pageTwo', param: tmp }) //将name指定的NavDestination页面信息入栈,传递的数据为param + } else { + this.pageInfos.pushDestinationByName('pageTwo', null); + } + }) + NavRouter({ name: 'pageTwo' }) { + Button('pushPageTwoByNavRouter') + .id("pushPageTwoByNavRouter") + } + + Button('pageThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(35) + .margin(5) + .onClick(() => { + let tmp = new TmpClass() + this.pageInfos.pushPathByName('pageThree', tmp) //将name指定的NavDestination页面信息入栈,传递的数据为param + }) + .id('pageThree') + + Button('Auto', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(35) + .margin(5) + .onClick(() => { + AppStorage.setOrCreate('navigationMode', NavigationMode.Auto); + }) + .id('auto') + Button('Split', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(35) + .margin(5) + .onClick(() => { + AppStorage.setOrCreate('navigationMode', NavigationMode.Split); + }) + .id('split') + Button('Stack', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(5) + .onClick(() => { + AppStorage.setOrCreate('navigationMode', NavigationMode.Stack); + }) + .id('stack') + Button(`remove start page`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(5) + .onClick(() => { + this.pageInfos.setInterception({ + willShow: (from: NavDestinationContext | "navBar", to: NavDestinationContext | "navBar", + operation: NavigationOperation, isAnimated: boolean) => { + if (typeof from !== "string") { + this.pageInfos.removeByName(from.pathInfo.name); + } + } + }) + }) + .id('removeStartPage') + }.width('100%').height('100%') + }.title('pageOne') + .onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageThree.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageThree.ets new file mode 100755 index 000000000..c5e54cd63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageThree.ets @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class TmpClass{ + count:number=10 +} +@Entry +@Component +export struct pageThree_testCaseTmp { + pathStack: NavPathStack = new NavPathStack(); + + build() { + NavDestination() { + Column() { + Button('Pop', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.pop(); + }) + Button('Clear', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.pathStack.clear(); + }) + .id('clear') + }.width('100%').height('100%') + }.title('pageThree').onReady((context: NavDestinationContext)=>{ + this.pathStack = context.pathStack; + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageTwo.ets new file mode 100755 index 000000000..be4e4a54c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentNavigationTestCase/pageTwo.ets @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +export struct pageTwo_testCaseTmp { + pathStack: NavPathStack = new NavPathStack(); + @State index: string = ""; + @State text1:string='' + + build() { + NavDestination() { + Column() { + Button("push pageThree") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.pushDestinationByName('pageThree', null); + }) + .id("pushPageThree") + + Button("Pop") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.pop() + }) + .id("Pop") + + Button("PopToOneByName") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.popToName('pageOne') + }) + .id("PopToOneByName") + + Button("popToOneByIndex") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + let index = this.pathStack.getIndexByName('pageOne')[0]; + this.pathStack.popToIndex(index); + }) + .id("popToOneByIndex") + + Button("replaceToPageThree") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.replacePath({ name: 'pageThree' }); + }) + .id("replaceToPageThree") + + Button("replaceToPageThreeByName") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.replacePathByName('pageThree', null); + }) + .id("replaceToPageThreeByName") + + Button("replaceToPageTwo") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.replacePath({ name: 'pageTwo' }) + }) + .id("replaceToPageTwo") + + Button("removeByName: PageTwo") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.removeByName('pageTwo'); + }) + .id("removeByName: PageTwo") + + Button("removeByName:pageOne") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.removeByName('pageOne'); + }) + .id("removeByName:pageOne") + + Row() { + Text("removeByIndex:") + TextInput({text:this.index, placeholder: 'please enter index' }).width('30%').onSubmit(() => {}).onChange((val: string) => { + setTimeout(()=>{ + this.pathStack.removeByIndexes([Number(this.index)]); + },1000) + }) + + Button("input1") + .onClick(() => { + this.index = '1' + }).id('inputIndex1').width('40%') + } + + Button("move1ToTop") + .width('80%') + .height(35) + .margin(10) + .onClick(() => { + this.pathStack.moveToTop('pageOne'); + }) + .id("movePageOneToTop") + + Row() { + Text("moveToTop") + TextInput({text:this.text1, placeholder: 'please enter index' }).width('30%').onSubmit(() => {}).onChange((val: string) => { + setTimeout(()=>{ + this.pathStack.moveIndexToTop(Number(this.text1)); + },1000) + }).id('inputMoveIndexToTop') + + Button("0") + .onClick(() => { + this.text1 = '0' + }).id('inputIndex').width('40%') + } + }.width('100%').height('100%') + }.title('2').onReady((context: NavDestinationContext) => { + this.pathStack = context.pathStack; + }).onShown(() => { + AppStorage.setOrCreate('shown', 'pageTwo onShown'); + console.log("pageTwo onShown"); + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0010.ets new file mode 100755 index 000000000..db5878e31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0010.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface SystemBarStyle{ statusBarContentColor:string +} +@Entry +@Component +export struct UIAttributeFontInterfaceNavigation0010 { + @Consume('pageInfos') pageInfos: NavPathStack + private TopContentColor: string = '#fff60303'; + @State systemBarStyle: SystemBarStyle | undefined = undefined; + build() { + NavDestination() { + Column(){ + Scroll(){ + Column({space:5}){ + Row() { + Text('systemBarStyle是否设置').fontSize(10) + Blank() + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转全屏NavDestination').onClick(() => { + this.pageInfos.pushPath({name:'pageThree'}) + }) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转非全屏NavDestination').onClick(() => { + this.pageInfos.pushPath({name:'pageFour'}) + }) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + } + .height('100%') + } + } + .title('非全屏NavDestination') + .systemBarStyle(this.systemBarStyle) + .width('80%') + .height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011.ets new file mode 100755 index 000000000..7a8519769 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0011.ets @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import window from '@ohos.window'; +import { BusinessError } from '@kit.BasicServicesKit'; + +import { UIAttributeFontInterfaceNavigation008 } from './UIAttributeFontInterfaceNavigation008' +import { UIAttributeFontInterfaceNavigation0010 } from './UIAttributeFontInterfaceNavigation0010' +import { UIAttributeFontInterfaceNavigation009 } from './UIAttributeFontInterfaceNavigation009' +import { UIAttributeFontInterfaceNavigation007 } from './UIAttributeFontInterfaceNavigation007' +import { UIAttributeFontInterfaceNavigation006 } from './UIAttributeFontInterfaceNavigation006' +import FaultLogger from '@ohos.faultLogger'; + +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +struct UIAttributeFontInterfaceNavigation0011{ + @Provide pageInfos:NavPathStack = new NavPathStack() + @State height1:string = '100%' + @State width1:string = '100%' + @State mode:NavigationMode = NavigationMode.Stack + private TopContentColor: string = '#fff60303'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + + @State types: Array = [] + @State edges: Array = [] + @State index: number = 0 + @State backgroundColor1: string | undefined = undefined + + @Builder + PageMap(name: string){ + if (name === 'pageOne') { + UIAttributeFontInterfaceNavigation008() + } else if (name === 'pageTwo') { + UIAttributeFontInterfaceNavigation0010() + }else if (name === 'pageThree') { + UIAttributeFontInterfaceNavigation009() + }else if (name === 'pageFour') { + UIAttributeFontInterfaceNavigation007() + }else if (name === 'pageFive') { + UIAttributeFontInterfaceNavigation006() + } + } + + build() { + Navigation(this.pageInfos){ + Scroll(){ + Column({space:5}){ + Row() { + Text('SR20240428918912【基础能力】页面级状态栏样式更新').fontSize(20) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(60) + Row() { + Text('是否为全屏:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.height1 = '100%' + this.width1 = '100%' + }else{ + this.height1 = '80%' + // this.width1 = '80%' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Row() { + Text('是否设置为双栏:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.mode = NavigationMode.Split + }else{ + this.mode = NavigationMode.Stack + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Row() { + Text('systemBarStyle是否设置').fontSize(13) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转全屏NavDestination').id('1').onClick(() => { + this.pageInfos.pushPath({name:'pageOne'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转非全屏NavDestination').id('2').onClick(() => { + this.pageInfos.pushPath({name:'pageTwo'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转NavDestination dialog').id('3').onClick(() => { + this.pageInfos.pushPath({name:'pageFive'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + + Row() { + Text('扩展安全区域的类型:') + Blank() + Column({space:5}){ + Row(){ + Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.SYSTEM)) { + this.types.push(SafeAreaType.SYSTEM) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.SYSTEM) + } + }) + Text('SYSTEM') + } + Row(){ + Checkbox({ name: 'checkbox2', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.CUTOUT)) { + this.types.push(SafeAreaType.CUTOUT) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.CUTOUT) + } + }) + Text('CUTOUT') + } + Row(){ Checkbox({ name: 'checkbox3', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.KEYBOARD)) { + this.types.push(SafeAreaType.KEYBOARD) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.KEYBOARD) + } + }) + Text('KEYBOARD') + } + + }.alignItems(HorizontalAlign.Start) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(130) + Row() { + Text('扩展安全区域的方向:') + Blank() + Column({space:5}){ + Row(){ + Checkbox({ name: 'checkbox1', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.TOP)) { + this.edges.push(SafeAreaEdge.TOP) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.TOP) + } + }) + Text('TOP') + } + Row(){ + Checkbox({ name: 'checkbox2', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.BOTTOM)) { + this.edges.push(SafeAreaEdge.BOTTOM) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.BOTTOM) + } + }) + Text('BOTTOM') + } + Row(){ + Checkbox({ name: 'checkbox3', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.START)) { + this.edges.push(SafeAreaEdge.START) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.START) + } + }) + Text('START') + } + Row(){ + Checkbox({ name: 'checkbox4', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.END)) { + this.edges.push(SafeAreaEdge.END) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.END) + } + }) + Text('END') + } + + + }.alignItems(HorizontalAlign.Start) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(130) + + Column() { + Button('背景颜色改变').onClick(() => { + this.index ++ + if (this.index > 1) { + this.index = 0 + } + + if (this.index == 0) { + this.backgroundColor1 = undefined + }else if (this.index == 1){ + this.backgroundColor1 = '#8bd4cc' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50).justifyContent(FlexAlign.Center) + + Row() { + Text('是否沉浸模式:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + window.getLastWindow(getContext(this), (err, win)=>{ + win.setWindowLayoutFullScreen(true, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + }else{ + window.getLastWindow(getContext(this), (err, win)=>{ + win.setWindowLayoutFullScreen(false, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + } + .height('100%') + } + .navDestination(this.PageMap) + .systemBarStyle(this.systemBarStyle) + .mode(this.mode) + .height(this.height1) + .width(this.width1) + .border({width:1}) + .expandSafeArea(this.types,this.edges) + .backgroundColor(this.backgroundColor1) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002.ets new file mode 100755 index 000000000..826a85ce9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation002.ets @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {SymbolGlyphModifier} from '@ohos.arkui.modifier' +@Entry +@Component +export struct test3{ + @Provide('pageInfos') pageInfos:NavPathStack = new NavPathStack(); + @State titleMode:NavigationTitleMode = NavigationTitleMode.Mini + + @State fontSize:number|string|Resource|null|undefined = 30 + + @State fontColor:null|undefined|(Color|string|Resource)[] = [Color.Blue] + @State fontColorIndex1:number = 0 + @State text2:string = 'Color.Blue' + + @State fontWeight:null|undefined|number|string|FontWeight = 30 + @State fontWeightIndex1:number = 0 + @State text3:string = '100' + @State icon1:SymbolGlyphModifier[] = [ + new SymbolGlyphModifier($r('sys.symbol.ohos_folder_badge_plus')), + new SymbolGlyphModifier($r('sys.symbol.trash_circle')), + new SymbolGlyphModifier($r('sys.symbol.ohos_trash')), + new SymbolGlyphModifier($r('sys.symbol.picture')), + new SymbolGlyphModifier($r('sys.symbol.ohos_lungs')), + ] + @State iconIndex1:number = 0 + @State text1:string = 'ohos_folder_badge_plus' + + @State icon2:SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_folder_badge_plus')).fontSize('50').fontColor(['#ff03ead1']) + @State active:boolean = false + @State status:ToolbarItemStatus = ToolbarItemStatus.NORMAL + + @State effectStrategy:SymbolEffectStrategy = SymbolEffectStrategy.NONE + @State effectStrategyIndex:number = 8 + @State effectStrategyText1:string = 'SymbolEffectStrategy.NONE' + + build(){ + Column(){ + Column(){ + Navigation(this.pageInfos){ + Column(){ + + } + } + .title('NavIndex') + .height(300).border({width:1}) + .titleMode(this.titleMode) + .backButtonIcon(this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy)).id('4') + .menus([ + { + value:'1', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'2', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'3', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'4', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'5', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'6', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + }, + { + value:'7', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + } + ]).id('6').onClick(()=>{ + console.log("hello") + }) + .toolbarConfiguration([ + { + value:'1', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'2', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'3', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'4', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'5', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'6', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + { + value:'7', + symbolIcon: this.icon1[this.iconIndex1].fontSize(this.fontSize).fontColor(this.fontColor).fontWeight(this.fontWeight).effectStrategy(this.effectStrategy), + action:() => { + if(this.active){ + this.status = ToolbarItemStatus.NORMAL + }else{ + this.status = ToolbarItemStatus.ACTIVE + } + this.active = !this.active + }, + status:this.status, + activeSymbolIcon:this.icon2 + }, + ]).id('8').onClick(()=>{ + this.active = !this.active + this.status = this.status + }) + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + + + Scroll(){ + Column(){ + Column(){ + Button("mode").id('10').onClick(()=>{ + this.iconIndex1++ + if (this.iconIndex1 > 4) { + this.iconIndex1 = 0 + } + if (this.iconIndex1 == 0) { + this.text1 = 'ohos_folder_badge_plus' + } + if (this.iconIndex1 == 1) { + this.text1 = 'trash_circle' + } + if (this.iconIndex1 == 2) { + this.text1 = 'ohos_trash' + } + if (this.iconIndex1 == 3) { + this.text1 = 'picture' + } + if (this.iconIndex1 == 4) { + this.text1 = 'ohos_lungs' + } + }) + } + Column({space:5}){ + Row(){ + Radio({value: 'Radio1',group:'radioGroup1'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.titleMode = NavigationTitleMode.Free + }) + Text('NavigationTitleMode.Free') + }.height(30) + Row(){ + Radio({value: 'Radio2',group:'radioGroup1'}).id('3').checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.titleMode = NavigationTitleMode.Mini + }) + Text('NavigationTitleMode.Mini') + }.height(30) + Row(){ + Radio({value: 'Radio3',group:'radioGroup1'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.titleMode = NavigationTitleMode.Free + }) + Text('NavigationTitleMode.Free') + }.height(30) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(100) + Column(){ + Text("图标为: sys.symbol" + this.text1).fontSize(10) + Blank() + Button("切换图标").id('2') + .onClick(()=> { + this.iconIndex1++ + if (this.iconIndex1 > 4) { + this.iconIndex1 = 0 + } + if (this.iconIndex1 == 0) { + this.text1 = 'ohos_folder_badge_plus' + } + if (this.iconIndex1 == 1) { + this.text1 = 'trash_circle' + } + if (this.iconIndex1 == 2) { + this.text1 = 'ohos_trash' + } + if (this.iconIndex1 == 3) { + this.text1 = 'picture' + } + if (this.iconIndex1 == 4) { + this.text1 = 'ohos_lungs' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10,top:10,bottom:10}).borderRadius(15).height(60) + Row(){ + Text('fontsize:') + Blank() + Column({space:5}){ + Row(){ + Radio({value:'Radio',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = 30 + }) + Text('30') + } + Row(){ + Radio({value:'Radio2',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = -30 + }) + Text('-30') + } + // Row(){ + // Radio({value:'Radio3',group: 'radioGroup2'}).checked(true) + // .radioStyle({ + // checkedBackgroundColor:Color.Pink + // }) + // .height(30) + // .width(30) + // .onChange((isChecked:boolean) => { + // this.fontSize = $r('app.integer.integer_30') + // }) + // Text("$r('app.integer.integer_30')") + // } + Row(){ + Radio({value:'Radio4',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = "30px" + }) + Text('30px') + } + Row(){ + Radio({value:'Radio5',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = "30lpx" + }) + Text('30lpx') + } + Row(){ + Radio({value:'Radio6',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = "30fp" + }) + Text('30fp') + } + Row(){ + Radio({value:'Radio7',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = "30vp" + }) + Text('30vp') + } + Row(){ + Radio({value:'Radio8',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = null + }) + Text('null') + } + Row(){ + Radio({value:'Radio9',group: 'radioGroup2'}).checked(true) + .radioStyle({ + checkedBackgroundColor:Color.Pink + }) + .height(30) + .width(30) + .onChange((isChecked:boolean) => { + this.fontSize = undefined + }) + Text('undefined') + } + }.alignItems(HorizontalAlign.Start) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10,bottom:10}).borderRadius(15).height(105) + Column(){ + Text('fontColor为:' + this.text2).fontSize(10) + Blank() + Button('fontColor').onClick(() => { + this.fontColorIndex1++ + if (this.iconIndex1 > 6) { + this.iconIndex1 = 0 + } + if (this.iconIndex1 == 0) { + this.fontColor = [Color.Blue] + this.text2 = 'Color.Blue' + } + if (this.iconIndex1 == 1) { + this.fontColor = ['#fc0303'] + this.text2 = '#fc0303' + } + if (this.iconIndex1 == 2) { + this.fontColor = [0xFF0000] + this.text2 = '0xFF0000' + } + if (this.iconIndex1 == 3) { + this.fontColor = ['rgb(2,184,17'] + this.text2 = 'rgb(2,184,17' + } + if (this.iconIndex1 == 4) { + this.fontColor = [$r('app.color.Pink')] + this.text2 = "$r('app.color.Pink')" + } + if (this.iconIndex1 == 5) { + this.fontColor = ['abcd'] + this.text2 = 'abcd' + } + if (this.iconIndex1 == 6) { + this.fontColor = undefined + this.text2 = "undefined" + } + if (this.iconIndex1 == 7) { + this.fontColor = null + this.text2 = "null" + } + + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10,top:10,bottom:10}).borderRadius(15).height(60) + Column(){ + Text('fontWeight为:' + this.text3).fontSize(10) + Blank() + Button('fontWeight').onClick(() => { + this.fontWeightIndex1++ + if (this.fontWeightIndex1 > 7) { + this.fontWeightIndex1 = 0 + } + if (this.fontWeightIndex1 > 0) { + this.fontWeight = 100 + this.text3 = '100' + } + if (this.fontWeightIndex1 > 1) { + this.fontWeight = 500 + this.text3 = '500' + } + if (this.fontWeightIndex1 > 2) { + this.fontWeight = 900 + this.text3 = '900' + } + if (this.fontWeightIndex1 > 3) { + this.fontWeight = FontWeight.Lighter + this.text3 = 'FontWeight.Lighter' + } + if (this.fontWeightIndex1 > 4) { + this.fontWeight = FontWeight.Bolder + this.text3 = 'FontWeight.Bolder' + } + if (this.fontWeightIndex1 > 5) { + this.fontWeight = "100" + this.text3 = '100' + } + if (this.fontWeightIndex1 > 6) { + this.fontWeight = null + this.text3 = 'null' + } + if (this.fontWeightIndex1 > 6) { + this.fontWeight = undefined + this.text3 = 'undefined' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10,top:10,bottom:10}).borderRadius(15).height(60) + Column(){ + Text('effectStrategy为:' + this.effectStrategyText1).fontSize(10) + Blank() + Button('effectStrategy').id('1') + .onClick(() =>{ + this.effectStrategyIndex++ + if (this.effectStrategyIndex > 2) { + this.effectStrategy = SymbolEffectStrategy.NONE + this.effectStrategyText1 = 'SymbolEffectStrategy.NONE' + } + if (this.effectStrategyIndex > 2) { + this.effectStrategy = SymbolEffectStrategy.SCALE + this.effectStrategyText1 = 'SymbolEffectStrategy.SCALE' + } + if (this.effectStrategyIndex > 2) { + this.effectStrategy = SymbolEffectStrategy.HIERARCHICAL + this.effectStrategyText1 = 'SymbolEffectStrategy.HIERARCHICAL' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10,}).borderRadius(15).height(60) + }.justifyContent(FlexAlign.Center).width('100%') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003.ets new file mode 100755 index 000000000..02618a028 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation003.ets @@ -0,0 +1,627 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import observer from '@ohos.arkui.observer'; +import { common } from '@kit.AbilityKit'; + +class Derived extends NavPathStack { + pushPath(info: NavPathInfo, animated?: boolean): void + pushPath(info: NavPathInfo, options?: NavigationOptions): void + pushPath(info: NavPathInfo, secArg?: boolean | NavigationOptions): void { + if (secArg === undefined) { + console.log('[derive-test] reached DerivedNavPathStack \'s pushPath with only \'info\'') + super.pushPath(info); + return; + } + if (typeof secArg === 'boolean') { + console.log('[derive-test] reached DerivedNavPathStack \'s pushPath with \'animated\'') + super.pushPath(info, secArg); + return; + } + console.log('[derive-test] reached DerivedNavPathStack \'s pushPath with \'options\'') + super.pushPath(info, secArg); + } +} + +class NavDestinationIdHelper { + private ids: Array = []; + private static instance: NavDestinationIdHelper = new NavDestinationIdHelper() + + static getInstance() { + return NavDestinationIdHelper.instance + } + + addId(id: string): number { + this.ids.push(id) + return this.ids.length + } + + removeId(id: string): boolean { + let index: number = this.ids.findIndex(element => element === id) + if (index === -1) { + return false + } + this.ids.splice(index, 1) + return true + } + + getIdArray(): Array { + return this.ids + } +} + +@Entry +@Component +struct Index { + stack: NavPathStack = new NavPathStack() + private context = getContext(this) as common.UIAbilityContext; //新增 + + routerPageUpdateCallback(info: RouterPageInfo) { + if (info) { + console.log(`testTag routerPageUpdateCallback, index: ${info.index}, name: ${info.name}, path: ${info.path}, state: ${info.state}, pageId: ${info.pageId}`); + } + } + observerOnRouter() { + observer.on('routerPageUpdate', this.context, this.routerPageUpdateCallback); + } //新增 + + observerOffRouter() { + observer.off('routerPageUpdate', this.context, this.routerPageUpdateCallback); + } //新增 + + @Builder + pageMap(name: string) { + if (name == "dest") { + Dest() + } else if (name == "pageOne") { + pageOneTmp() + } else if (name == "pageTwo") { + pageTwo() + } + } + + aboutToAppear(): void { + this.stack.pushPath({ name: "dest" }) + } + + onPageShow(): void { + if (this.stack.size() === 0) { + this.stack.pushPath({ name: "dest" }) + } + } + + build() { + Navigation(this.stack) { + Button('push destination').margin(20) + .onClick(() => { + this.stack.pushPath({ name: "dest" }) + }) + } + .hideNavBar(true) + .navDestination(this.pageMap) + } +} +@Component +struct pageTwo { + build() { + NavDestination() { + Text("这是pageTwo页面") + }.mode(NavDestinationMode.DIALOG) + .backgroundColor('rgba(255,242,22,6)') + } +} + +@Component +struct Dest { + stack: NavPathStack = new NavPathStack() + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + @State editText: string = 'indicate ids to remove, split by space' + @State text2: string = '' + controller: TextInputController = new TextInputController() + // @Link mode: NavDestinationMode ; + updateIdArray() { + this.idArray = NavDestinationIdHelper.getInstance().getIdArray(); + } + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback, info: ${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + build() { + NavDestination() { + Text("当前页面名:dest").fontWeight(FontWeight.Bolder) + Column() { + Text('current id: ' + this.curId) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .margin(15) + Text('all id: ' + JSON.stringify(this.idArray)) + .fontSize(18) + .margin(20) + } + .backgroundColor(Color.Pink) + + Row({ space: 5 }) { + Button('push x5').margin(3).id('5') + .onClick(() => { + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + }) + Button("pop").onClick(() => this.stack.pop()) + Button('push new dest').margin(3).id('1') + .onClick(() => { + this.stack.pushPath({ name: "dest" }) + }) + } + Row({ space: 5 }) { + Button('remove by invalid id').margin(5).id('4') + .onClick(() => { + let ret = this.stack.removeByNavDestinationId("__INVALID__") + console.log('[removeById][demo] remove invalid id\'s return value: ' + ret) + AlertDialog.show({ message: 'remove invalid id\'s return value: ' + ret }) + }) + Button('remove by currentId').margin(5).id('2') + .onClick(() => { + let ret = this.stack.removeByNavDestinationId(this.curId) + console.log('[removeById][demo] remove curId\'s return value: ' + ret) + AlertDialog.show({ message: ' remove curId\'s return value: ' + ret }) + }) + } + + Row() { + Button('remove by top - 1 id').margin(5).fontSize(15) + .onClick(() => { + let ids = NavDestinationIdHelper.getInstance().getIdArray() + if (ids.length <= 1) { + return; + } + let id = ids[ids.length - 2] + let ret = this.stack.removeByNavDestinationId(id) + console.log('[removeById][demo] remove top - 1 id\'s return value: ' + ret) + + setTimeout(() => { + this.updateIdArray() + }, 200) + }) + Button("push pageOne dest").fontSize(15).id('26') + .onClick(() => { + this.stack.pushPath({ name: "pageOne" }) + }) + } + Button('removeByName currentPage dest').onClick(() => { + this.stack.removeByName("dest") + }) + Row({ space: 3 }) { + Button('removeByCurrentId+pop').id('6') + .onClick(() => { + let ret = this.stack.removeByNavDestinationId(this.curId) + // console.log('[removeById][demo] remove curId\'s return value: ' + ret) + AlertDialog.show({ message: ' remove curId\'s return value: ' + ret }) + this.stack.pop() + }) + Button('removeById:5 *5').onClick(() => { + let ret1 = this.stack.removeByNavDestinationId('5') + let ret2 = this.stack.removeByNavDestinationId('5') + let ret3 = this.stack.removeByNavDestinationId('5') + let ret4 = this.stack.removeByNavDestinationId('5') + let ret5 = this.stack.removeByNavDestinationId('5') + AlertDialog.show({ + message: ' remove curId\'s return value: ' + ret1 + ' ' + ret2 + ' ' + ret3 + ' ' + ret4 + ' ' + ret5 + }) + }) + } + + Row({ space: 3 }) { + Button('removeByCurrentId:0').onClick(() => { + this.stack.removeByNavDestinationId("0") + }) + Button('get', { stateEffect: true, type: ButtonType.Capsule }) + .id('10') + .height(40) + .margin(20) + .onClick(() => { + console.log('-------------------') + console.log('获取栈中所有NavDestination页面的名称', JSON.stringify(this.stack.getAllPathName())) + console.log('获取index指定的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByIndex(1))) + console.log('获取全部名为dest的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByName('dest'))) + console.log('获取全部名为dest的NavDestination页面的位置索引', JSON.stringify(this.stack.getIndexByName('dest'))) + console.log('获取栈大小', JSON.stringify(this.stack.size())) + }) + } + + Row({ space: 5 }) { + Button('observerOn').id('3') + .onClick(() => { + this.observerOn() + }) + + Button('observerOff') + .onClick(() => { + this.observerOff() + }) + } + Button('removeByName currentPage dest').onClick(() => { + this.stack.removeByName("dest") + }) + Row({ space: 3 }) { + Button('removeByCurrentId+pop').onClick(() => { + let ret = this.stack.removeByNavDestinationId(this.curId) + // console.log('[removeById][demo] remove curId\'s return value: ' + ret) + AlertDialog.show({ message: ' remove curId\'s return value: ' + ret }) + this.stack.pop() + }) + Button('removeById:5 *5').id("21") + .onClick(() => { + let ret1 = this.stack.removeByNavDestinationId('5') + let ret2 = this.stack.removeByNavDestinationId('5') + let ret3 = this.stack.removeByNavDestinationId('5') + let ret4 = this.stack.removeByNavDestinationId('5') + let ret5 = this.stack.removeByNavDestinationId('5') + AlertDialog.show({ + message: ' remove curId\'s return value: ' + ret1 + ' ' + ret2 + ' ' + ret3 + ' ' + ret4 + ' ' + ret5 + }) + }) + } + + Row({ space: 3 }) { + Button('removeByCurrentId:0').onClick(() => { + this.stack.removeByNavDestinationId("0") + }) + Button('get', { stateEffect: true, type: ButtonType.Capsule }) + .id('11') + .height(40) + .margin(20) + .onClick(() => { + console.log('-------------------') + console.log('获取栈中所有NavDestination页面的名称', JSON.stringify(this.stack.getAllPathName())) + console.log('获取index指定的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByIndex(1))) + console.log('获取全部名为dest的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByName('dest'))) + console.log('获取全部名为dest的NavDestination页面的位置索引', JSON.stringify(this.stack.getIndexByName('dest'))) + console.log('获取栈大小', JSON.stringify(this.stack.size())) + }) + } + + Row({ space: 5 }) { + Button('observerOn') + .onClick(() => { + this.observerOn() + }) + + Button('observerOff') + .onClick(() => { + this.observerOff() + }) + } + TextInput({ text: this.editText }) + .id('input1') + .margin(20) + .width('75%') + .backgroundColor('#ccc') + .fontWeight(200) + .onEditChange((isEditing) => { + this.editText = isEditing ? '' : 'indicate ids to remove, split by space' + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + let deletedIds = event.text.split(' '); + let removeSuccessIds: Array = [] + let removeFailedIds: Array = [] + for (let index = 0; index < deletedIds.length; ++index) { + let deletedId = deletedIds[index] + if (this.stack.removeByNavDestinationId(deletedId)) { + removeSuccessIds.push(deletedId) + } else { + removeFailedIds.push(deletedId) + } + } + console.log('[removeById][demo] result of remove indicated ids:') + console.log('[removeById][demo] --> remove success: ' + removeSuccessIds) + console.log('[removeById][demo] --> remove failed : ' + removeFailedIds) + + setTimeout(() => { + this.updateIdArray() + }, 200) + }) + // Text(this.text2).fontWeight(FontWeight.Bold).fontColor('#FFBB00') + Button(`getAllPathName`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(10) + .onClick(() => { + this.text2 = JSON.stringify(this.stack.getAllPathName()) + }) + } + .onReady((ctx) => { + // get from query + let id = this.queryNavDestinationInfo()?.navDestinationId + // get from onReady + this.stack = ctx.pathStack + this.curId = ctx.navDestinationId ? ctx.navDestinationId : "__invalid__" + NavDestinationIdHelper.getInstance().addId(this.curId) + }) + .onShown(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onShown') + this.updateIdArray() + }) + .onWillDisappear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillDisAppear') + NavDestinationIdHelper.getInstance().removeId(this.curId) + }) + // .mode(this.mode) + .onDisAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onDisAppear') + }) + .onWillAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillAppear') + }) + .onAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onAppear') + }) + .onWillShow(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillShow') + }) + .onShown(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onShown') + }) + .onWillHide(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillHide') + }) + .onHidden(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onHidden') + }) + .onWillDisappear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillDisappear') + }) + .onDisAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onDisAppear') + }) + + } +} + +@Component +struct pageOneTmp { + stack: NavPathStack = new NavPathStack() + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + @State editText: string = 'indicate ids to remove, split by space' + @State text2: string = '' + updateIdArray() { + this.idArray = NavDestinationIdHelper.getInstance().getIdArray(); + } + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback, info: ${JSON.stringify(info)}`); + } + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + build() { + NavDestination() { + Text("当前页面名:dest").fontWeight(FontWeight.Bolder) + Column() { + Text('current id: ' + this.curId) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .margin(15) + Text('all id: ' + JSON.stringify(this.idArray)) + .fontSize(18) + .margin(20) + } + .backgroundColor(Color.Pink) + + Row({ space: 5 }) { + Button('push x5').margin(3).id('8') + .onClick(() => { + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + this.stack.pushPath({ name: "dest" }) + }) + Button("pop").onClick(() => this.stack.pop()) + Button('push new dest').margin(3).id('12') + .onClick(() => { + this.stack.pushPath({ name: "dest" }) + }) + } + + Row({ space: 5 }) { + Button('remove by invalid id').margin(5).id('21') + .onClick(() => { + let ret = this.stack.removeByNavDestinationId("__INVALID__") + console.log('[removeById][demo] remove invalid id\'s return value: ' + ret) + AlertDialog.show({ message: 'remove invalid id\'s return value: ' + ret }) + }) + Button('remove by currentId').margin(5).id("7") + .onClick(() => { + let ret = this.stack.removeByNavDestinationId(this.curId) + console.log('[removeById][demo] remove curId\'s return value: ' + ret) + AlertDialog.show({ message: ' remove curId\'s return value: ' + ret }) + }) + } + Row() { + Button('remove by top - 1 id').margin(5).fontSize(15) + .onClick(() => { + let ids = NavDestinationIdHelper.getInstance().getIdArray() + if (ids.length <= 1) { + return; + } + let id = ids[ids.length - 2] + let ret = this.stack.removeByNavDestinationId(id) + console.log('[removeById][demo] remove top - 1 id\'s return value: ' + ret) + + setTimeout(() => { + this.updateIdArray() + }, 200) + }) + Button("push pageOne dest").fontSize(15) + .onClick(() => { + this.stack.pushPath({ name: "pageOne" }) + }) + } + + Button('removeByName currentPage dest').onClick(() => { + this.stack.removeByName("dest") + }) + Row({ space: 3 }) { + Button('removeByCurrentId+pop').id('9') + .onClick(() => { + let ret = this.stack.removeByNavDestinationId(this.curId) + AlertDialog.show({ message: ' remove curId\'s return value: ' + ret }) + this.stack.pop() + }) + Button('removeById:5 *5').onClick(() => { + let ret1 = this.stack.removeByNavDestinationId('5') + let ret2 = this.stack.removeByNavDestinationId('5') + let ret3 = this.stack.removeByNavDestinationId('5') + let ret4 = this.stack.removeByNavDestinationId('5') + let ret5 = this.stack.removeByNavDestinationId('5') + AlertDialog.show({ + message: ' remove curId\'s return value: ' + ret1 + ' ' + ret2 + ' ' + ret3 + ' ' + ret4 + ' ' + ret5 + }) + }) + } + + Row({ space: 3 }) { + Button('removeByCurrentId:0').onClick(() => { + this.stack.removeByNavDestinationId("0") + }) + Button('get', { stateEffect: true, type: ButtonType.Capsule }) + .id('20') + .height(40) + .margin(20) + .onClick(() => { + console.log('-------------------') + console.log('获取栈中所有NavDestination页面的名称', JSON.stringify(this.stack.getAllPathName())) + console.log('获取index指定的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByIndex(1))) + console.log('获取全部名为dest的NavDestination页面的参数信息', JSON.stringify(this.stack.getParamByName('dest'))) + console.log('获取全部名为dest的NavDestination页面的位置索引', JSON.stringify(this.stack.getIndexByName('dest'))) + console.log('获取栈大小', JSON.stringify(this.stack.size())) + }) + } + + Row({ space: 5 }) { + Button('observerOn').id('15') + .onClick(() => { + this.observerOn() + }) + + Button('observerOff') + .onClick(() => { + this.observerOff() + }) + } + + TextInput({ text: this.editText }) + .margin(20) + .width('75%') + .backgroundColor('#ccc') + .fontWeight(200) + .onEditChange((isEditing) => { + this.editText = isEditing ? '' : 'indicate ids to remove, split by space' + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + let deletedIds = event.text.split(' '); + let removeSuccessIds: Array = [] + let removeFailedIds: Array = [] + for (let index = 0; index < deletedIds.length; ++index) { + let deletedId = deletedIds[index] + if (this.stack.removeByNavDestinationId(deletedId)) { + removeSuccessIds.push(deletedId) + } else { + removeFailedIds.push(deletedId) + } + } + console.log('[removeById][demo] result of remove indicated ids:') + console.log('[removeById][demo] --> remove success: ' + removeSuccessIds) + console.log('[removeById][demo] --> remove failed : ' + removeFailedIds) + + setTimeout(() => { + this.updateIdArray() + }, 200) + }) + Text(this.text2).fontWeight(FontWeight.Bold).fontColor('#FFBB00') + Button(`getAllPathName`, { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(10) + .onClick(() => { + this.text2 = JSON.stringify(this.stack.getAllPathName()) + }) + } + .backgroundColor('rgba(255,255,120,0.5)') + .onReady((ctx) => { + // get from query + let id = this.queryNavDestinationInfo()?.navDestinationId + // get from onReady + this.stack = ctx.pathStack + this.curId = ctx.navDestinationId ? ctx.navDestinationId : "__invalid__" + NavDestinationIdHelper.getInstance().addId(this.curId) + }) + .onShown(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onShown') + this.updateIdArray() + }) + .onWillDisappear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillDisAppear') + NavDestinationIdHelper.getInstance().removeId(this.curId) + }) + .mode(NavDestinationMode.DIALOG).id("25") + .onDisAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onDisAppear') + }) + .onWillAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillAppear') + }) + .onAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onAppear') + }) + .onWillShow(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillShow') + }) + .onShown(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onShown') + }) + .onWillHide(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillHide') + }) + .onHidden(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onHidden') + }) + .onWillDisappear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onWillDisappear') + }) + .onDisAppear(() => { + console.log('[removeById][demo][life] id ' + this.curId + ' onDisAppear') + }) + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation005.ets new file mode 100755 index 000000000..301e72f0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation005.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; + +interface ListCategories { + title:string, + url:string +} + +@Entry +@Component +struct UIAttributeFontInterfaceNavigation005 { //原名叫menuIndex + @State message: string = 'SR20240428918912【基础能力】页面级状态栏样式更新' + private items : ListCategories[] = [ + {title:'navigation',url:'pages/35-SR20240428918912/test1'}, + ] + + build() { + Column() { + Text(this.message).fontSize(22).fontColor(0xFFFFFF).fontWeight(FontWeight.Bold).textAlign(TextAlign.Center).width('100%').height(50).backgroundColor("#FF08528A") + List({space:'20vp'}) { + ForEach(this.items,(item : ListCategories) => { + ListItem() { + Button(){ + Row() { + LoadingProgress().width(40).height(40).color(0xFFFFFF) + Text(item.title).fontSize(16).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center) + + } + .type(ButtonType.Normal) + .backgroundColor(0x317aff) + .width('100%') + .fontSize(15) + .fontColor(0x000000) + .labelStyle({maxLines:1, overflow: TextOverflow.MARQUEE}) + .onClick(() => { + router.pushUrl({url:item.url}) + }) + } + }) + }.expandSafeArea() + .alignListItem(ListItemAlign.Center) + // .margin({top:'10vp'}) + .width('95%').height('90%') + }.width('100%').height('100%') + .expandSafeArea() + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation006.ets new file mode 100755 index 000000000..368448a25 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation006.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +export struct UIAttributeFontInterfaceNavigation006 { + @Consume('pageInfos') pageInfos: NavPathStack + private TopContentColor: string = '#fff60327'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + + build() { + NavDestination() { + Column(){ + Scroll(){ + Column({space:5}){ + Row() { + Text('systemBarStyle是否设置').fontSize(10) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + + } + .height('100%') + } + } + .backgroundColor(Color.Grey) + .title('dialog') + .systemBarStyle(this.systemBarStyle) + .mode(NavDestinationMode.DIALOG) + .border({width:1}) + .width('100%') + .height('100%') + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation007.ets new file mode 100755 index 000000000..2d0d27e38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation007.ets @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +export struct UIAttributeFontInterfaceNavigation007 { + @Consume('pageInfos') pageInfos: NavPathStack + private TopContentColor: string = '#ffeef603'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + + build() { + NavDestination() { + Column(){ + Scroll(){ + Column({space:5}){ + Row() { + Text('systemBarStyle是否设置').fontSize(10) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + + } + .height('100%') + } + } + .title('非全屏NavDestination') + .systemBarStyle(this.systemBarStyle) + .width('80%') + .height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation008.ets new file mode 100755 index 000000000..4d247d320 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation008.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +export struct UIAttributeFontInterfaceNavigation008 { + @Consume('pageInfos') pageInfos: NavPathStack + private TopContentColor: string = '#fff60303'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + build() { + NavDestination() { + Column(){ + Scroll(){ + Column({space:5}){ + Row() { + Text('systemBarStyle是否设置').fontSize(10) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + console.log('11111',this.systemBarStyle) + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转全屏NavDestination').id("4").onClick(() => { + this.pageInfos.pushPath({name:'pageThree'}) + }) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转非全屏NavDestination').id('5').onClick(() => { + this.pageInfos.pushPath({name:'pageFour'}) + }) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + } + .height('100%') + } + } + .title('全屏NavDestination') + .systemBarStyle(this.systemBarStyle) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation009.ets new file mode 100755 index 000000000..b88cabbc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation009.ets @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +export struct UIAttributeFontInterfaceNavigation009 { + @Consume('pageInfos') pageInfos: NavPathStack + private TopContentColor: string = '#ffeef603'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + + build() { + NavDestination() { + Column(){ + Scroll(){ + Column({space:5}){ + Row() { + Text('systemBarStyle是否设置').fontSize(10) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + + } + .height('100%') + } + } + .title('全屏NavDestination') + .systemBarStyle(this.systemBarStyle) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0280.ets new file mode 100755 index 000000000..ffc33cab8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterfaceNavigation/UIAttributeFontInterfaceNavigation0280.ets @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import window from '@ohos.window'; +import { BusinessError } from '@kit.BasicServicesKit'; + +import { UIAttributeFontInterfaceNavigation008 } from './UIAttributeFontInterfaceNavigation008' +import { UIAttributeFontInterfaceNavigation0010 } from './UIAttributeFontInterfaceNavigation0010' +import { UIAttributeFontInterfaceNavigation009 } from './UIAttributeFontInterfaceNavigation009' +import { UIAttributeFontInterfaceNavigation007 } from './UIAttributeFontInterfaceNavigation007' +import { UIAttributeFontInterfaceNavigation006 } from './UIAttributeFontInterfaceNavigation006' +import FaultLogger from '@ohos.faultLogger'; + +interface SystemBarStyle{ + statusBarContentColor:string +} +@Entry +@Component +struct UIAttributeFontInterfaceNavigation0011{ + @Provide pageInfos:NavPathStack = new NavPathStack() + @State height1:string = '100%' + @State width1:string = '100%' + @State mode:NavigationMode = NavigationMode.Stack + private TopContentColor: string = '#fff60303'; + @State systemBarStyle: SystemBarStyle | undefined = {statusBarContentColor: this.TopContentColor}; + + @State types: Array = [] + @State edges: Array = [] + @State index: number = 0 + @State backgroundColor1: string | undefined = undefined + + @Builder + PageMap(name: string){ + if (name === 'pageOne') { + UIAttributeFontInterfaceNavigation008() + } else if (name === 'pageTwo') { + UIAttributeFontInterfaceNavigation0010() + }else if (name === 'pageThree') { + UIAttributeFontInterfaceNavigation009() + }else if (name === 'pageFour') { + UIAttributeFontInterfaceNavigation007() + }else if (name === 'pageFive') { + UIAttributeFontInterfaceNavigation006() + } + } + + build() { + Navigation(this.pageInfos){ + Scroll(){ + Column({space:5}){ + Row() { + Text('SR20240428918912【基础能力】页面级状态栏样式更新').fontSize(20) + Blank() + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(60) + Row() { + Text('是否为全屏:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.height1 = '100%' + this.width1 = '100%' + }else{ + this.height1 = '80%' + // this.width1 = '80%' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Row() { + Text('是否设置为双栏:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.mode = NavigationMode.Split + }else{ + this.mode = NavigationMode.Stack + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Row() { + Text('systemBarStyle是否设置').fontSize(13) + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + this.systemBarStyle = {statusBarContentColor: this.TopContentColor} + }else{ + this.systemBarStyle = undefined + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转全屏NavDestination').id('1').onClick(() => { + this.pageInfos.pushPath({name:'pageOne'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转非全屏NavDestination').id('2').onClick(() => { + this.pageInfos.pushPath({name:'pageTwo'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + Column() { + Button('跳转NavDestination dialog').id('3').onClick(() => { + this.pageInfos.pushPath({name:'pageFive'}) + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + + Row() { + Text('扩展安全区域的类型:') + Blank() + Column({space:5}){ + Row(){ + Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.SYSTEM)) { + this.types.push(SafeAreaType.SYSTEM) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.SYSTEM) + } + }) + Text('SYSTEM') + } + Row(){ + Checkbox({ name: 'checkbox2', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.CUTOUT)) { + this.types.push(SafeAreaType.CUTOUT) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.CUTOUT) + } + }) + Text('CUTOUT') + } + Row(){ Checkbox({ name: 'checkbox3', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.types.some(item => item == SafeAreaType.KEYBOARD)) { + this.types.push(SafeAreaType.KEYBOARD) + } + }else{ + this.types = this.types.filter(item => item != SafeAreaType.KEYBOARD) + } + }) + Text('KEYBOARD') + } + + }.alignItems(HorizontalAlign.Start) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(130) + Row() { + Text('扩展安全区域的方向:') + Blank() + Column({space:5}){ + Row(){ + Checkbox({ name: 'checkbox1', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.TOP)) { + this.edges.push(SafeAreaEdge.TOP) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.TOP) + } + }) + Text('TOP') + } + Row(){ + Checkbox({ name: 'checkbox2', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.BOTTOM)) { + this.edges.push(SafeAreaEdge.BOTTOM) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.BOTTOM) + } + }) + Text('BOTTOM') + } + Row(){ + Checkbox({ name: 'checkbox3', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.START)) { + this.edges.push(SafeAreaEdge.START) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.START) + } + }) + Text('START') + } + Row(){ + Checkbox({ name: 'checkbox4', group: 'checkboxGroup2' }) + .select(false) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + if (value == true) { + if (!this.edges.some(item => item == SafeAreaEdge.END)) { + this.edges.push(SafeAreaEdge.END) + } + }else{ + this.edges = this.edges.filter(item => item != SafeAreaEdge.END) + } + }) + Text('END') + } + + + }.alignItems(HorizontalAlign.Start) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(130) + + Column() { + Button('背景颜色改变').onClick(() => { + this.index ++ + if (this.index > 1) { + this.index = 0 + } + + if (this.index == 0) { + this.backgroundColor1 = undefined + }else if (this.index == 1){ + this.backgroundColor1 = '#8bd4cc' + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50).justifyContent(FlexAlign.Center) + + Row() { + Text('是否沉浸模式:') + Blank() + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + if (isOn) { + window.getLastWindow(getContext(this), (err, win)=>{ + win.setWindowLayoutFullScreen(true, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + }else{ + window.getLastWindow(getContext(this), (err, win)=>{ + win.setWindowLayoutFullScreen(false, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + + } + }) + }.backgroundColor(0xFFFFFF).width('100%').padding({left:10,right:10}).borderRadius(15).height(50) + + + }.width('100%').backgroundColor(0xEFEFEF).padding(10) + } + .height('100%') + } + .navDestination(this.PageMap) + .systemBarStyle(this.systemBarStyle) + .mode(this.mode) + .height(this.height1) + .width(this.width1) + .border({width:1}) + .expandSafeArea(this.types,this.edges) + .backgroundColor(this.backgroundColor1) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/MyParam.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/MyParam.ets new file mode 100755 index 000000000..aae039d89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/MyParam.ets @@ -0,0 +1,4 @@ +export class MyParam { + operation: number = 1 + text: string = '' +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageOne.ets new file mode 100755 index 000000000..6cfec6b55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageOne.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./MyParam"; + +export class pages { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageOneTmp { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text: string = '' + @State text2: string = '' + @State opacity1: number = 1 + + build() { + NavDestination() { + Column() { + Button('pushPathByname->PageTwo', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageOne" + this.pathStack?.pushPathByName('pageTwo', p) + }) + .id('start_pageTwo') + } + .width('100%') + .height('100%') + } + .title('pageOne') + + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree.ets new file mode 100755 index 000000000..8a4714b85 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./MyParam"; + +export class pagesThree { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageThreeTmp { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text: string = ''; + @State text2: string = ''; + @State opacity1: number = 1; + @State hideTitleBar: boolean = false; + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageTwo" + this.pathStack?.pushPath({ name: 'pageOne', param: p }) + }) + } + .width('100%') + .height('100%') + } + .hideTitleBar(this.hideTitleBar) + .title({ main: '主标题', sub: '副标题' }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree_Long.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree_Long.ets new file mode 100755 index 000000000..73f78b5c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageThree_Long.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./MyParam"; + +export class pagesThree_long { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageThreeTmp_long { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text: string = ''; + @State text2: string = ''; + @State opacity1: number = 1; + @State hideTitleBar: boolean = false; + + build() { + NavDestination() { + Column() { + Button('pushPath', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageTwo" + this.pathStack?.pushPath({ name: 'pageOne', param: p }) + }) + Button('hideTitleBar=true', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + this.hideTitleBar = true; + }) + .id('hide_titleBar') + } + .width('100%') + .height('100%') + } + .hideTitleBar(this.hideTitleBar) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageTwo.ets new file mode 100755 index 000000000..9d72a3a1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/PageTwo.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MyParam } from "./MyParam"; + +export class pagesTwo { + names: string = "" + values: NavPathStack | null = null +} + +@Component +export struct pageTwoTmp { + private pathStack: NavPathStack | null = null; + @State lifeCycle: string = ""; + @State text: string = '' + @State text2: string = '' + @State opacity1: number = 1 + + @Builder + NavigationTitle() { + Column() { + Text('我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题') + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + build() { + NavDestination() { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageTwo" + this.pathStack?.pushPathByName('pageOne', p) + }).id('start_pageOne') + Button('pushPathByname->PageThree', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageThree" + this.pathStack?.pushPathByName('pageThree', p) + }).id('start_pageThree') + Button('pushPathByname->PageThree_longTitle', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from pageThree" + this.pathStack?.pushPathByName('pageThree_long', p) + }).id('start_pageThree_long') + } + .width('100%') + .height('100%') + } + .title(this.NavigationTitle()) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .onReady((ctx: NavDestinationContext) => { + this.lifeCycle += ""; + try { + this.text = (ctx.pathInfo.param as MyParam).text; + this.text2 = JSON.stringify(ctx.pathInfo) + this.pathStack = ctx.pathStack; + console.log(`testTag onReady: info: ${JSON.stringify(ctx.pathInfo)} stack: ${JSON.stringify(ctx.pathStack)}`) + } catch (e) { + console.log(`testTag onReady catch exception: ${JSON.stringify(e)}`) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001.ets new file mode 100755 index 000000000..8e956b65f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface001.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface001 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(24) + .height(24) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ + main: 'mainTitle', + sub: 'subtitle' + }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .mode(NavigationMode.Stack) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface001_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface001_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface001_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002.ets new file mode 100755 index 000000000..953c55993 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface002.ets @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface002 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈'; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(24) + .height(24) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ + main: this.titleStr, + sub: 'subtitle' + }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .mode(NavigationMode.Stack) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface002_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface002_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface002_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003.ets new file mode 100755 index 000000000..3e0f3b719 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface003.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface003 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('这是 customBuilder') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(24) + .height(24) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface003_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface003_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface003_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004.ets new file mode 100755 index 000000000..cf565e176 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface004.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface004 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('这是 customBuilder') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface004_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface004_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface004_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005.ets new file mode 100755 index 000000000..7513e6d73 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface005.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface005 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('我是副标题') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface005_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface005_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface005_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006.ets new file mode 100755 index 000000000..9652c5361 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface006.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface006 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface006_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface006_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface006_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007.ets new file mode 100755 index 000000000..db96effa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface007.ets @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface007 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title({ main: '主标题', sub: '副标题' }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface007_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface007_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface007_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008.ets new file mode 100755 index 000000000..95959bb8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface008.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface008 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface008_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface008_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface008_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009.ets new file mode 100755 index 000000000..31dd8c127 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface009.ets @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface009 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start).height(20) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface009_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface009_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface009_003') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010.ets new file mode 100755 index 000000000..a4425fca4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface010.ets @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface010 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface010_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface010_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface010_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface010_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface010_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011.ets new file mode 100755 index 000000000..e4b3e8106 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface011.ets @@ -0,0 +1,148 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface011 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface011_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface011_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface011_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface011_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface011_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012.ets new file mode 100755 index 000000000..2ae0011db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface012.ets @@ -0,0 +1,146 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface012 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle()) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface012_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface012_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface012_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface012_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface012_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013.ets new file mode 100755 index 000000000..a2ef77e69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface013.ets @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface013 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface013_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface013_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface013_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface013_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface013_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014.ets new file mode 100755 index 000000000..4b7ba17d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface014.ets @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface014 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State hideTitleBar: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(this.hideTitleBar) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface014_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface014_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface014_003') + + Button('hideTitleBar=true') + .onClick(() => { + this.hideTitleBar = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface014_004') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015.ets new file mode 100755 index 000000000..4e9c52660 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface015.ets @@ -0,0 +1,151 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface015 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: '' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_005') + + Button('mode=Navigation.Split') + .onClick(() => { + this.mode = NavigationMode.Split; + }) + .margin({ top: 450, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface015_006') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017.ets new file mode 100755 index 000000000..61f60eac5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface017.ets @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface017 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: number = 200; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarWidth(this.navBarWidth) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_005') + + Button('mode=Navigation.Split') + .onClick(() => { + this.mode = NavigationMode.Split; + }) + .margin({ top: 450, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_006') + Button('navBarWidth++') + .onClick(() => { + this.navBarWidth = this.navBarWidth + 70; + }) + .margin({ top: 500, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface017_007') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018.ets new file mode 100755 index 000000000..c8afa697b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface018.ets @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface018 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_005') + + Button('mode=Navigation.Split') + .onClick(() => { + this.mode = NavigationMode.Split; + }) + .margin({ top: 450, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_006') + Button('navBarPosition=End') + .onClick(() => { + this.navBarPos = NavBarPosition.End; + }) + .margin({ top: 500, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface018_007') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020.ets new file mode 100755 index 000000000..9f9103dd9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface020.ets @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface020 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface020_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface020_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface020_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface020_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface020_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021.ets new file mode 100755 index 000000000..930784173 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface021.ets @@ -0,0 +1,155 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface021 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .navBarWidth(this.navBarWidth) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_005') + Button('设置title,宽度40%') + .onClick(() => { + this.navBarWidth = '40%'; + }) + .margin({ top: 450, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface021_006') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface022.ets new file mode 100755 index 000000000..de9239eaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface022.ets @@ -0,0 +1,136 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +let COLOR1: string = "#80004AAF"; +let COLOR2: string = "#802787D9"; +let BLUR_STYLE_1: BlurStyle = BlurStyle.BACKGROUND_THIN; +let BLUR_STYLE_2: BlurStyle = BlurStyle.BACKGROUND_THICK; + +@Component +struct BackComponent { + build() { + Row() { + Column() { + } + .height('100%') + .backgroundColor("#3D9DB4") + .layoutWeight(9) + + Column() { + } + .height('100%') + .backgroundColor("#17A98D") + .layoutWeight(9) + + Column() { + } + .height('100%') + .backgroundColor("#FFC000") + .layoutWeight(9) + } + .height('100%') + .width('100%') + } +} + +@Component +struct ColorAndBlur { + @State useColor1: boolean = true; + @State useBlur1: boolean = true; + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + BackComponent() + .width('100%') + .height('100%') + Column() { + Stack({ alignContent: Alignment.Center }) { + Text("NavDestination content") + } + .width('100%') + .layoutWeight(1) + } + .width('100%') + .height('100%') + }.width('100%') + .height('100%') + } + .width('100%') + .height('100%') + // 开发者可以设置标题栏的背景颜色和背景模糊效果 + .title({ main: '主标题', sub: '' }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + } +} + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface022 { + private stack: NavPathStack = new NavPathStack(); + @State useColor1: boolean = true; + @State useBlur1: boolean = true; + + @Builder + PageBuilder(name: string) { + ColorAndBlur() + } + + build() { + Navigation(this.stack) { + Stack({ alignContent: Alignment.Center }) { + BackComponent() + .width('100%') + .height('100%') + Column() { + Stack({ alignContent: Alignment.Center }) { + Button("push page") + .onClick(() => { + this.stack.pushPath({ name: "page" }) + }).id('UIComponentNavigationMenubarAvoidInterface022_001') + } + .width('100%') + .layoutWeight(1) + } + .width('100%') + .height('80%') + }.width('100%') + .height('100%') + } + .width('100%') + .height('100%') + .navDestination(this.PageBuilder) + // 开发者可以设置标题栏的背景颜色和背景模糊效果 + .title("NavTitle", { + backgroundColor: this.useColor1 ? COLOR1 : COLOR2, + backgroundBlurStyle: this.useBlur1 ? BLUR_STYLE_1 : BLUR_STYLE_2, + barStyle: BarStyle.STACK + }) + // 开发者可以设置工具栏的背景颜色和背景模糊效果 + .toolbarConfiguration([ + { value: "a" }, + { value: "b" }, + { value: "c" } + ], { + backgroundColor: this.useColor1 ? COLOR1 : COLOR2, + backgroundBlurStyle: this.useBlur1 ? BLUR_STYLE_1 : BLUR_STYLE_2 + }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface023.ets new file mode 100755 index 000000000..6f98329de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface023.ets @@ -0,0 +1,136 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +let COLOR23: string = "#80004AAF"; +let COLOR23_01: string = "#802787D9"; +let BLUR_STYLE_1_23: BlurStyle = BlurStyle.BACKGROUND_THIN; +let BLUR_STYLE_2_23: BlurStyle = BlurStyle.BACKGROUND_THICK; + +@Component +struct BackComponent023 { + build() { + Row() { + Column() { + } + .height('100%') + .backgroundColor("#3D9DB4") + .layoutWeight(9) + + Column() { + } + .height('100%') + .backgroundColor("#17A98D") + .layoutWeight(9) + + Column() { + } + .height('100%') + .backgroundColor("#FFC000") + .layoutWeight(9) + } + .height('100%') + .width('100%') + } +} + +@Component +struct ColorAndBlur023 { + @State useColor1: boolean = true; + @State useBlur1: boolean = true; + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Center }) { + BackComponent023() + .width('100%') + .height('100%') + Column() { + Stack({ alignContent: Alignment.Center }) { + Text("NavDestination content") + } + .width('100%') + .layoutWeight(1) + } + .width('100%') + .height('100%') + }.width('100%') + .height('100%') + } + .width('100%') + .height('100%') + // 开发者可以设置标题栏的背景颜色和背景模糊效果 + .title({ main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', sub: '' }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + } +} + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface023 { + private stack: NavPathStack = new NavPathStack(); + @State useColor1: boolean = true; + @State useBlur1: boolean = true; + + @Builder + PageBuilder(name: string) { + ColorAndBlur023() + } + + build() { + Navigation(this.stack) { + Stack({ alignContent: Alignment.Center }) { + BackComponent023() + .width('100%') + .height('100%') + Column() { + Stack({ alignContent: Alignment.Center }) { + Button("push page") + .onClick(() => { + this.stack.pushPath({ name: "page" }) + }).id('UIComponentNavigationMenubarAvoidInterface023_001') + } + .width('100%') + .layoutWeight(1) + } + .width('100%') + .height('80%') + }.width('100%') + .height('100%') + } + .width('100%') + .height('100%') + .navDestination(this.PageBuilder) + // 开发者可以设置标题栏的背景颜色和背景模糊效果 + .title("NavTitle", { + backgroundColor: this.useColor1 ? COLOR23 : COLOR23_01, + backgroundBlurStyle: this.useBlur1 ? BLUR_STYLE_1_23 : BLUR_STYLE_2_23, + barStyle: BarStyle.STACK + }) + // 开发者可以设置工具栏的背景颜色和背景模糊效果 + .toolbarConfiguration([ + { value: "a" }, + { value: "b" }, + { value: "c" } + ], { + backgroundColor: this.useColor1 ? COLOR23 : COLOR23_01, + backgroundBlurStyle: this.useBlur1 ? BLUR_STYLE_1_23 : BLUR_STYLE_2_23 + }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface024.ets new file mode 100755 index 000000000..81e1d65ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface024.ets @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './PageOne' +import { pageTwoTmp } from './PageTwo' +import { MyParam } from "./MyParam"; + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface024 { + private stack: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } + } + + build() { + Column() { + Navigation(this.stack) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('UIComponentNavigationMenubarAvoidInterface024_001') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from children navigation" + this.stack.pushPath({ name: 'pageOne', param: p }) + }) + } + } + .title("children") + .width('100%') + .height('100%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025.ets new file mode 100755 index 000000000..e57a18fe5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface025.ets @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pageOneTmp } from './PageOne' +import { pageTwoTmp } from './PageTwo' +import { pageThreeTmp } from './PageThree' +import { pageThreeTmp_long } from './PageThree_Long' +import { MyParam } from "./MyParam"; + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface025 { + private stack: NavPathStack = new NavPathStack(); + @State text1: string = '' + @State text: string = '' + @State text2: string = '' + @State lifeCycle: string = ""; + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp() + } else if (name === 'pageTwo') { + pageTwoTmp() + } else if (name === 'pageThree') { + pageThreeTmp() + } else if (name === 'pageThree_long') { + pageThreeTmp_long() + } + } + + build() { + Column() { + Navigation(this.stack) { + Column() { + Button('pushPathByname->PageOne', { stateEffect: true, type: ButtonType.Capsule }) + .id('UIComponentNavigationMenubarAvoidInterface025_001') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + let p = new MyParam(); + p.text = "from children navigation" + this.stack.pushPath({ name: 'pageOne', param: p }) + }) + } + } + .title("children") + .width('100%') + .height('100%') + .navDestination(this.PageMap) + .title("NavIndex") + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface028.ets new file mode 100755 index 000000000..4558c38df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface028.ets @@ -0,0 +1,130 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface028 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + @State hideBackButton: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题主标题', + sub: '' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideTitleBar(false) + .hideToolBar(false) + .hideBackButton(this.hideBackButton) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface028_001') + Button('hideBackButton') + .onClick(() => { + this.hideBackButton = true; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface028_002') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface029.ets new file mode 100755 index 000000000..2da9c0ae0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface029.ets @@ -0,0 +1,156 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface029 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(50) + .height(50) + Image('resources/base/media/edit.png') + .width(50) + .height(50) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ + main: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈', + sub: '哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' + }) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .navBarWidth(500) + .navBarWidthRange([400, 602]) + .minContentWidth(550) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_005') + Button('mode=Navigation.Split') + .onClick(() => { + this.mode = NavigationMode.Split; + }) + .margin({ top: 450, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface029_006') + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030.ets new file mode 100755 index 000000000..6c87338a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface030.ets @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface030 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + } + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + } + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + } + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle()) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .navBarWidth(500) + .navBarWidthRange([400, 602]) + .minContentWidth(550) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface030_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface030_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface030_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface030_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface030_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031.ets new file mode 100755 index 000000000..dfad39dfa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface031.ets @@ -0,0 +1,151 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface031 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationTitle() { + Column() { + Text(this.titleStr) + .fontColor('#ff1d1831') + .lineHeight(41) + .height(20) + .fontWeight(700) + Text('我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题我是副标题') + .fontColor('#182431') + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + Image('resources/base/media/edit.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title(this.NavigationTitle()) + .menus(this.isCustomMenu ? this.NavigationMenus() : + [{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideBackButton(true) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface031_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface031_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface031_003') + + Button('自定义menu') + .onClick(() => { + this.isCustomMenu = true; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface031_004') + Button('非自定义menu') + .onClick(() => { + this.isCustomMenu = false; + }) + .margin({ top: 400, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface031_005') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032.ets new file mode 100755 index 000000000..05c0287ca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface032.ets @@ -0,0 +1,129 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface032 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + @State bgColor: ResourceColor = Color.Brown; + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + Image('resources/base/media/edit.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title('Navigation Title') + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .backgroundColor(this.bgColor) + .navBarPosition(this.navBarPos) + .hideBackButton(true) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface032_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface032_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface032_003') + Button('backgroundColor = yellow') + .onClick(() => { + this.bgColor = Color.Yellow; + }) + .margin({ top: 350, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface032_004') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033.ets new file mode 100755 index 000000000..253e8e049 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface033.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface033 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + Image('resources/base/media/edit.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title('Navigation Title,Navigation') + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideBackButton(true) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface033_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface033_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface033_003') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034.ets new file mode 100755 index 000000000..9a3015391 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface034.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface034 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State titleStr: string = '我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题我是主标题'; + @State isCustomMenu: boolean = false; + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + Image('resources/base/media/edit.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ main: getContext().resourceManager.getStringSync($r("app.string.navigation_main_title")), sub: '' }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .navBarPosition(this.navBarPos) + .hideBackButton(true) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface034_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface034_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface034_003') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035.ets new file mode 100755 index 000000000..6cf964789 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationMenubarAvoidInterface/UIComponentNavigationMenubarAvoidInterface035.ets @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavigationMenubarAvoidInterface035 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State titleMode: number = NavigationTitleMode.Mini; + @State mode: number = NavigationMode.Stack; + @State navBarWidth: Length = '100%'; + @State navBarPos: number = NavBarPosition.Start; + @State isCustomMenu: boolean = false; + + @Builder + NavigationMenus() { + Row() { + Image('resources/base/media/add.png') + .width(32) + .height(32) + Image('resources/base/media/edit.png') + .width(32) + .height(32) + } + } + + build() { + Stack() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.mode) + .title({ main: getContext().resourceManager.getStringSync($r("app.string.navigation_main_title")), sub: '' }) + .menus([{ value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }, + { value: 'edit', icon: 'resources/base/media/edit.png' }, + { value: 'add', icon: 'resources/base/media/add.png' }]) + .titleMode(this.titleMode) + .toolbarConfiguration([ + { + value: 'options01', + icon: 'resources/base/media/star_gray.png' + }, + { + value: 'options02', + icon: 'resources/base/media/star_gray.png' + } + ]) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + .navBarPosition(this.navBarPos) + .hideBackButton(true) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + + Button('titleMode=Mini') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }) + .margin({ top: 200, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface035_001') + Button('titleMode=Full') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full; + }) + .margin({ top: 250, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface035_002') + Button('titleMode=Free') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + .margin({ top: 300, left: 20 }) + .id('UIComponentNavigationMenubarAvoidInterface035_003') + + } + .alignContent(Alignment.TopStart) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json index ce65c09bf..50c320f69 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json @@ -52,6 +52,34 @@ "name": "abc", "value": "abc" }, + { + "name": "scrollby_negative_10", + "value": "-10" + }, + { + "name": "scrollby_negative_9", + "value": "-9" + }, + { + "name": "scrollby_10", + "value": "10" + }, + { + "name": "scrollby_abc", + "value": "abc" + }, + { + "name": "navigation_test", + "value": "test" + }, + { + "name": "navigation_main_title", + "value": "这是主标题,超长文本。这是主标题,超长文本 。这是主标题,超长文本 这是主标题,超长文本 这是主标题,超长文本 。 " + }, + { + "name": "navigation_sub_title", + "value": "这是副标题,超长文本。这是副标题,超长文本。这是副标题,超长文本。这是副标题,超长文本。这是副标题,超长文本。 " + }, { "name": "font_20", "value": "20" diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/add.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/add.png new file mode 100755 index 0000000000000000000000000000000000000000..b3dafd25327a3fbf48d6173f25a0522f3a37419c GIT binary patch literal 334 zcmV-U0kQsxP)Px$2uVaiRCr$Pnn4PKKnz9W%_`(xrS}Tdqm{O9v|W5K%ne)#QcYgHNTeT z&u<7o1~gZI5@?3(24NJ&3t)zDgV^EG<_tTmD!yZ^yBaUV{mcQvJ!;59#cOf~ z>;k+^OoeMj01>c~0ct)|0$-Njw+X75qQn73fucZBpeRrjC<+t>iULKC3P6RS!cbwT zFjQD^lbJCx5z5>YJB%I14)^|5HnX2xU294cyn5)&`w<{h&5CQ00Ttg`=9$TWOf@U6 gMFv!SYnf+$0r7*}L17TjdH?_b07*qoM6N<$f_!|0u>b%7 literal 0 HcmV?d00001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/eidt.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/eidt.png new file mode 100755 index 0000000000000000000000000000000000000000..4f0a59adce4985932e46044b581e625740e2c0c3 GIT binary patch literal 845 zcmV-T1G4;yP)Px&2T4RhRCr$Po4;?zrVY0h~7pQebl$$MH+w_fPBkE)bu(*(IX=B7Y(P zp8-6|8as}&>ALP=-2i3Y-&A}WlL){s0M|0Xm(r9evdDKE@udKQAXsCJ{me}Korvx& zL!>P6r2s~w(N?e5`;?iy_3Noicx_jH9!udPpfiB3#2c9bU5YmjK-c1p0w6=YF#u$V zHv)i6@!A8BEnaH?D#U9GK$Unc0jLzO9RSthwF1z!_%ICLCrNT2z&j#xYu5u*o&~xV z9|XY*#@O?@=s1pV7Zq8Sei-Und@7oAo}Oa2G61%H-#^I9f~5kGA>J4Ovcww!K&E)@ z0mv4wH2@XjwFRI`yp{mMFnpXO$%mZRkd!jJcCW$NudwpxeFP*CuzP^r1MD7P zMom!C7SK&m)PyFfB7mIpw7F|-e%*1Lb=P%&)T#>44lvrc$t{YCqG)3}ou=Kb{|001 zkLP*WR=-OoqCP<*8YSn7@~TdZu`izIU268s5)c7U-74E=TeuEjJ;%Wg5#?2*{%442 z#w9dMi$bb%eV>SS%M647=EV%f?ecX*7TtSzvGSWDN0k7~AgKDogec~+>%Ref1MrrJ z-c)f^89>&VtiQ}u3ApGU$8pYw!(rOSUu!f1P-_OwZ?*t5Um)q>*$j}5Sn~;1J_G&& XBNvum5`;OT00000NkvXXu0mjfhiQV~ literal 0 HcmV?d00001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/star_gray.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/star_gray.png new file mode 100755 index 0000000000000000000000000000000000000000..2255f40ccd42add83bb77c0752e0248354c45049 GIT binary patch literal 1887 zcmV-l2cYPx+8A(JzRCr$PTWO3`MG&s)S%1JPYfKccV2shIi5D0Zqlsud009wi@IKZniko@$ zCW|JMC@@`bL@}anyzl@o1W^P$KogA`;}JD6#+Vq58t=Hog&z*DoZjr&;fYki7|ABN$Ek>W980`&Fu?bP4jKbUw|SJx@s-Q9nU zga{)hKomt85eZGwh^T`gNbN8JXsxFs;_BjrMPx=8hA*~SgqF{MD2h7cIDRWHz)`~l z_*f}*Vh{uatrVf<0x54yu+MB7QkAFfcKlPXFEt5n3hyGd~IdmsuvYl!z|3#MT9Ci2%%e2>?9i z$n;Vodfd^*8QydOn0ZeC_z(d0c4YSh08AjFA06$S;7u1mYyBJ|p5w%72rMEi!Z1A7 z$JW-SsRA(bRRHjyEtv|qtBL5LI(<|$Z<+v^OlF)?>N5ZsQz!XNaU36(N~ON7(@$CR zrU}5zW~)2BL8MFL>0PdqOH zqA1#5M9wq`BjO|x*|i=LzP5dRVyD2gV=aXiB$3;@Tt25J%h zeItlcYIP6<@7lzyDuCAdEJU0M0H$}hkB!4N!h8<^8$@JP7=|xY;0L zIEtb*A~LmsLE6?8BEB31fhpqu>;uy2bjPSsqrOALv2Dw|0mMY)r!8By?3+%fb0r%g zQ|U$Iod(2dTNj9UeDNEiq{wNlZ$iYyZJR+I#6;xgFbwZ0c2TyIGn+2X_;$?1gVRSuG@+bbMFAEpSa5JhN5=;M(CHDdolFLDx!lpcy}e&J z31Glc6wMJ4vmE}l0}(F{g5XK3onSc-Ge-cBbW~s(5v?h0M- zUk)6-+l@8yy|002yLqoS`O zqX&rSIty;wAkG4qL(}NdqhB5B|J91MmWb*)VKVc_0B~fjK&CCWdGqGe3WppE{2;_x z0Ar-JHod@&mO-WxkyY&&?$2Sifry+OhN0DKwm6QL0NHHz^f->!TMA%cOLMs#_4fAu zVq-H@C(H)yBpbZJD5cIwCX=t&;tM!00m^;kWD$5kL`X!|RJ-P4W>Xv&S@_!y;`@=6 zmjKyp_MAA5pK~Qyg#SoH-cw4wE+VG5jTeza5b+SpVpkGcDRpi#nY4OS)V&0>*0T|@ z;{Li0VZ2R6WKI}{%Um6J%>ZV;0stO%4c27*l|=N2YYZ;|wAR<=dxvH}&^9B#Q@kz= z!v|amc?rPGHv@q6Zp)RFCw?vwIk)nB1t7B>@FdzSvyh0`)w!<#u18Z>UOxD;NAOyX zd<8J)aw9@JjXQ|wHdjKv0+{JeE{He z>?}tN5m%bui^$oo#LM9CC!*_J{rC!CHbG`H?GGWkt4lG$u_zpY!ho(BMCyM2U1 zLS=7$YT0`U5Jk~5B4S8Z8{Z=0GDLhnnM|5nCg+jOW+#ZqED@Ov0OP7TK*VQ*AUNMO zh?fA&Y(6Px+xJg7oRCr$PTYZciWgUKgvwNDmnYn7|&TbE^F-Ezag{mA;&q&gv(ON!Qu6(F% z@dMO=5Zf9p{?R5R@P`FIzyKvt5$%Tx^^Rg~{VGR-k;YJn#htAUiLpYtnQaknX77aC zou8TQU3=Z#yM5oeo7u)X$^EnY{GR7|pMB?@_hXK5j$hQu_ItzT(m-F!So>S$qh$f` zb3JXPMPt>5t4G_H(xnH-TM8)X9~ZFD}>m3z#IR{%}>0Yp9S##CXG8%d6RnQy(|A(93jLOfajP$ z0q_OEMm?$-))xh_vx3DEfM;hv2cn-!Ic5I5mM;8EswMxNx>rzz_rcCiEy2is|heOcIj#B`Y^SkHIW8TD(1e#%s&)0(+EdIUshB3AI*ki zrrO8?7<1 z5lH~9le>+;56q=u2Hmb3`3L8cGvJ!@0NxnRel(#de*!o$w`QqQ@%@j_%M=dGCGV^Q zVD4=nJK-*`R4SJfs1F2lE)CXkF)RiTB@&6J+RxMX5j{IL8@*5gj16D-p0bj-N&)pT zaUU4(n2m|hwS?D+X~+i;CH=~t_RQb^Al>MamgX)696GD$c&%P+l@cW6lAD~Y} zF-W#3BL?^n%rr<)2DS9x>`5Qh9^l&ModoU&(c%^vj8~TV5Q7Hwv~}mHTflR2djP&N zUMHYf6wV}6Z*`&;5JVo?Ux>4x=#sWJ^8gPv_}17U5%e&VHPY}eA(jkTiF&I3Hh z40drYiPvRhYR_wi)zgT5+5kq5UEHlCE6)W-cahnOhq&aI6PI>&y?9tEfB@_rH`l_) zws?F-q@v(PZGp92XeQVQhn821m=7@Q^JYC$xVskb+2#ol<_qvFtlbTEo$Mw8-6c>v z3Hh~VSWS1NgaUAf7aLH@&rtJIovJtiyHuloH`gng_kx@BCc<~MlvUT`JjeVkfMp^9 zFmMEZ@-jVh$Z3Wb3LqdUIp%T(_BJD&2;e2vu-?}QTPm6dnDLS6cr?SR^E7dy94ugj z24n)RPz`IJpjQ#tNsL#_t_RciMJjxszS5b=*KLW9o>+W=UmpKDh&G(b!%u5Qp|26Q zYv-;d;$0%TAl{&*3ikBH%Wf5xiKx*WF0de*3;Il0^UwRgl~bQMUDV|a=a3Sp2oSa=K3hXPl;3#_)66%2#p=Jd=kA4T%pVLg?XXJ z>{K1;9#9<%?A$UC2cxp+^(a@~+NdvlsVGuV9VaT|+W=Z3g0EtjKBcAezZ1q!07C^Z zGMrnXC}+Op)J&Lw5|}r>S)o1iyQV+p@`||)VE$e+zS{47pH_Bemk=QfRR5X|c8zou(DfZgUhGLRg&>N##S_t1 zHI@IWEKjHaJjVt}?n>NziJr&@#J`^dp*K z-7M=VTmVIL8(8Y(=&xYjFRw!Azyo6^C22rAPkwDalX>q%ZW)((6$q;d&}y;F*sZ6nYhnqY Date: Mon, 6 Jan 2025 15:08:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ohosTest/ets/testability/TestAbility.ets | 32 +++++++++++++++---- .../uicompare/entry/src/ohosTest/module.json5 | 18 +++++++++-- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets index 5b2992dcb..0a875826a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -59,13 +59,33 @@ export default class TestAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); GlobalThis.getInstance().setContext("context", this.context) - windowStage.loadContent('testability/pages/Index', (err) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; + // windowStage.loadContent('testability/pages/Index', (err) => { + // if (err.code) { + // hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + // return; + // } + // hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + // }); + let atManager = abilityAccessCtrl.createAtManager(); + let appFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; + let permissionFlags = 0; + bundleManager.getBundleInfoForSelf(appFlags, (err, data) => { + if (err) { + Logger.error(TAG, 'getAllApplicationInfo failed: %{public}s', err.message); + console.error("") } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); - }); + let tokenID = data.appInfo.accessTokenId; //系统应用可以通过bundleManager.getApplicationInfo获取,普通应用可以通过bundleManager.getBundleInfoForSelf获取 + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.READ_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.WRITE_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + }) } onWindowStageDestroy() { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f..f50d7d248 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,6 +12,18 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities":[ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, @@ -19,13 +31,13 @@ "name": "ohos.permission.READ_MEDIA" }, { - "name":"ohos.permission.UPDATE_CONFIGURATION" + "name":"ohos.permission.CAPTURE_SCREEN" }, { - "name":"ohos.permission.RUNNING_LOCK" + "name":"ohos.permission.ACCESS_SCREEN_LOCK" }, { - "name":"ohos.permission.INTERNET" + "name":"ohos.permission.ACCESS_SCREEN_LOCK_INNER" } ], "abilities": [ -- Gitee