From e0bf8f868454380c96a0ddb252810585d1dbf055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9D=E8=BF=AA?= Date: Mon, 23 Dec 2024 19:45:24 +0800 Subject: [PATCH 1/3] add tabs+waterflow+refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ArkUIAnimatedResponse.test.ets | 521 +++++++++++++++ .../ArkUITabScrollable.test.ets | 25 +- .../ArkUITabsIconStyleSelectedColor.test.ets | 38 +- ...ArkUITabsIconStyleUnselectedColor.test.ets | 37 +- .../ArkUITabsLabelStyleSelectedColor.test.ets | 69 +- ...rkUITabsLabelStyleUnselectedColor.test.ets | 50 +- .../ArkUITabsLabelStylefont.test.ets | 71 +- .../ArkUITabsSingleSelectedcolor.test.ets | 23 +- .../ArkUITabsSingleUnselectedcolor.test.ets | 17 +- .../ArkUITabsVertical.test.ets | 23 +- .../FunctionJichuWaterFlow.test.ets | 130 +++- .../entry/src/ohosTest/ets/test/List.test.ets | 50 ++ ...IComponentListAndGridWaterFlowAdd.test.ets | 52 +- ...ComponentListAndGridWaterSections.test.ets | 315 ++++++++- ...idWaterflowGetItemMainSizeByIndex.test.ets | 110 ++++ ...onentListAndGridWaterflowSections.test.ets | 83 +++ ...mponentListAndGridWaterflowSpring.test.ets | 134 ++++ ...omponentListAndGridXommonOnscroll.test.ets | 176 +++++ ...tandgridWaterflowEventenhancement.test.ets | 271 ++++++++ .../UIComponentNavModifier.test.ets | 67 +- .../UIComponentNavTabsAction.test.ets | 101 ++- .../UIComponentNavTabsAnimated.test.ets | 219 +++++++ .../UIComponentNavTabsBlurStyle.test.ets | 269 +++++--- .../UIComponentNavTabsCachedCount.test.ets | 614 +++++++++++++++++- ...onentNavTabsCapabilityEnhancement.test.ets | 421 ++++++++++++ .../UIComponentNavTabsContentAdapt.test.ets | 164 ++++- .../UIComponentNavTabsEdgeeffect.test.ets | 210 +++++- .../UIComponentNavTabsExpandsafearea.test.ets | 99 ++- .../UIComponentNavTabsHeight.test.ets | 22 +- .../UIComponentNavTabsImproTrace.test.ets | 84 ++- .../UIComponentNavTabsInterception.test.ets | 141 +++- .../UIComponentNavTabsInterface.test.ets | 61 +- .../UIComponentNavTabsLayout.test.ets | 64 ++ .../UIComponentNavTabsMirror.test.ets | 233 ++++++- .../UIComponentNavTabsNest.test.ets | 106 +++ .../UIComponentNavTabsObserver.test.ets | 434 +++++++++++++ .../UIComponentNavTabsOnChange.test.ets | 68 ++ .../UIComponentNavTabsOnWillHide.test.ets | 395 +++++++++++ .../UIComponentNavTabsOnWillShow.test.ets | 381 ++++++++++- .../UIComponentNavTabsSubTabbarStyle.test.ets | 22 +- .../UIComponentNavTabs.test.ets | 79 +++ .../UIComponentNavTabsUx.test.ets | 437 +++++++++++++ .../UIComponentNavTabsWidth.test.ets | 22 +- .../UIComponentOtherRefreshAbility.test.ets | 165 ++++- .../UIComponentOtherRefreshAnimation.test.ets | 300 +++++++++ ...IComponentOtherRefreshInterAction.test.ets | 537 ++++++++++++++- ...ponentOtherRefreshInterConnection.test.ets | 264 ++++++++ .../UIComponentOtherRefreshInterface.test.ets | 173 ++++- ...mponentOtherRefreshOnOffsetChange.test.ets | 66 ++ ...UIComponentOtherRefreshPromptText.test.ets | 338 +++++++++- .../UIComponentRefreshPulldownradio.test.ets | 253 ++++++++ .../UIComponentScrollSwiperTeace.test.ets | 31 + .../UIComponentTabTabBarSymbol.test.ets | 130 +++- .../UIComponentTabsClip.test.ets | 71 ++ .../UIComponentUISupportColor.test.ets | 112 +++- .../UIComponentWaterFlowFooter.test.ets | 69 ++ .../UIComponentWaterFlowSliding.test.ets | 142 ++++ .../UIRefreshComponentContent.test.ets | 63 ++ .../ArkUIAnimatedResponse0040.ets | 117 ++++ .../ArkUIAnimatedResponse0050.ets | 117 ++++ .../ArkUIAnimatedResponse0060.ets | 117 ++++ .../ArkUIAnimatedResponse0070.ets | 117 ++++ .../ArkUIAnimatedResponse0080.ets | 117 ++++ .../ArkUIAnimatedResponse0090.ets | 117 ++++ .../ArkUIAnimatedResponse0100.ets | 117 ++++ .../ArkUIAnimatedResponse0110.ets | 117 ++++ .../FunctionJichuWaterFlow0350737.ets | 165 +++++ .../FunctionJichuWaterFlow0350737142.ets | 165 +++++ .../FunctionJichuWaterFlow0380.ets | 96 +++ .../WaterFlowDataSource.ets | 142 ++++ ...IComponentListAndGridWaterSections0060.ets | 182 ++++++ ...IComponentListAndGridWaterSections0430.ets | 166 +++++ ...IComponentListAndGridWaterSections0440.ets | 167 +++++ ...IComponentListAndGridWaterSections0450.ets | 170 +++++ ...IComponentListAndGridWaterSections0460.ets | 170 +++++ ...IComponentListAndGridWaterSections0470.ets | 166 +++++ ...IComponentListAndGridWaterSections0480.ets | 135 ++++ ...IComponentListAndGridWaterSections0490.ets | 166 +++++ ...IComponentListAndGridWaterSections0550.ets | 110 ++++ ...IComponentListAndGridWaterSections0580.ets | 193 ++++++ .../WaterFlowDataSource.ets | 142 ++++ .../WaterFlowDataSource1.ets | 142 ++++ ...WaterflowGetItemMainSizeByIndex0010141.ets | 96 +++ ...erflowGetItemMainSizeByIndex0010141624.ets | 84 +++ ...lowGetItemMainSizeByIndex0010141656824.ets | 84 +++ .../WaterFlowDataSource.ets | 141 ++++ ...entListAndGridWaterflowSections0460211.ets | 116 ++++ .../WaterFlowDataSource.ets | 141 ++++ ...onentListAndGridWaterflowSpring0150660.ets | 153 +++++ ...onentListAndGridWaterflowSpring0180721.ets | 142 ++++ ...onentListAndGridWaterflowSpring0250290.ets | 154 +++++ .../WaterFlowDataSource.ets | 141 ++++ .../WaterFlowDataSource2.ets | 141 ++++ ...ponentListAndGridXommonOnscroll0510711.ets | 130 ++++ ...ponentListAndGridXommonOnscroll0530136.ets | 129 ++++ ...ponentListAndGridXommonOnscroll0540791.ets | 127 ++++ ...ponentListAndGridXommonOnscroll0550659.ets | 127 ++++ ...ponentListAndGridXommonOnscroll0560601.ets | 129 ++++ ...ponentListAndGridXommonOnscroll0570768.ets | 128 ++++ ...ponentListAndGridXommonOnscroll0680459.ets | 118 ++++ .../WaterFlowDataSource.ets | 142 ++++ ...ndgridWaterflowEventenhancement0080380.ets | 97 +++ ...ndgridWaterflowEventenhancement0090043.ets | 97 +++ ...ndgridWaterflowEventenhancement0180890.ets | 102 +++ ...ndgridWaterflowEventenhancement0200448.ets | 95 +++ ...ndgridWaterflowEventenhancement0230655.ets | 95 +++ ...ndgridWaterflowEventenhancement0240733.ets | 100 +++ ...ndgridWaterflowEventenhancement0250294.ets | 95 +++ ...ndgridWaterflowEventenhancement0280114.ets | 95 +++ ...ndgridWaterflowEventenhancement0290143.ets | 100 +++ ...ndgridWaterflowEventenhancement0300527.ets | 95 +++ .../WaterFlowDataSource.ets | 141 ++++ .../UIComponentNavTabs0010.ets | 64 ++ .../UIComponentNavTabsAction0090.ets | 95 +++ .../UIComponentNavTabsAction0130.ets | 84 +++ .../UIComponentNavTabsAction0140.ets | 82 +++ .../UIComponentNavTabsAction0180.ets | 106 +++ .../UIComponentNavTabsAnimated003.ets | 154 +++++ .../UIComponentNavTabsAnimated005.ets | 154 +++++ .../UIComponentNavTabsAnimated007.ets | 141 ++++ .../UIComponentNavTabsAnimated012.ets | 132 ++++ .../UIComponentNavTabsAnimated015.ets | 142 ++++ .../UIComponentNavTabsBlurStyle0037.ets | 237 +++++++ .../UIComponentNavTabsCachedCount0010.ets | 141 ++++ .../UIComponentNavTabsCachedCount0020.ets | 141 ++++ .../UIComponentNavTabsCachedCount0030.ets | 141 ++++ .../UIComponentNavTabsCachedCount0040.ets | 142 ++++ .../UIComponentNavTabsCachedCount0050.ets | 175 +++++ .../UIComponentNavTabsCachedCount0060.ets | 175 +++++ .../UIComponentNavTabsCachedCount0070.ets | 175 +++++ .../UIComponentNavTabsCachedCount0080.ets | 175 +++++ .../UIComponentNavTabsCachedCount0090.ets | 175 +++++ .../UIComponentNavTabsCachedCount0100.ets | 175 +++++ .../UIComponentNavTabsCachedCount0110.ets | 169 +++++ .../UIComponentNavTabsCachedCount0120.ets | 175 +++++ .../UIComponentNavTabsCachedCount0130.ets | 185 ++++++ .../UIComponentNavTabsCachedCount0140.ets | 175 +++++ .../UIComponentNavTabsCachedCount0150.ets | 175 +++++ .../UIComponentNavTabsCachedCount0160.ets | 184 ++++++ .../UIComponentNavTabsCachedCount0170.ets | 175 +++++ .../UIComponentNavTabsCachedCount0180.ets | 176 +++++ .../UIComponentNavTabsCachedCount0190.ets | 176 +++++ .../UIComponentNavTabsCachedCount0200.ets | 185 ++++++ .../UIComponentNavTabsCachedCount0210.ets | 193 ++++++ .../UIComponentNavTabsCachedCount0220.ets | 101 +++ .../UIComponentNavTabsCachedCount0230.ets | 100 +++ .../UIComponentNavTabsCachedCount0240.ets | 103 +++ .../UIComponentNavTabsCachedCount0250.ets | 102 +++ .../UIComponentNavTabsCachedCount0260.ets | 104 +++ .../UIComponentNavTabsCachedCount0270.ets | 106 +++ .../UIComponentNavTabsCachedCount0280.ets | 143 ++++ .../UIComponentNavTabsCachedCount0290.ets | 139 ++++ ... => UIComponentNavTabsCachedCount0300.ets} | 27 +- ...ponentNavTabsCapabilityEnhancement0010.ets | 171 +++++ ...ponentNavTabsCapabilityEnhancement0019.ets | 176 +++++ ...ponentNavTabsCapabilityEnhancement0020.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0030.ets | 170 +++++ ...ponentNavTabsCapabilityEnhancement0040.ets | 171 +++++ ...ponentNavTabsCapabilityEnhancement0050.ets | 102 +++ ...ponentNavTabsCapabilityEnhancement0060.ets | 176 +++++ ...ponentNavTabsCapabilityEnhancement0070.ets | 175 +++++ ...ponentNavTabsCapabilityEnhancement0080.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0090.ets | 80 +++ ...ponentNavTabsCapabilityEnhancement0100.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0110.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0120.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0130.ets | 100 +++ ...ponentNavTabsCapabilityEnhancement0140.ets | 102 +++ ...ponentNavTabsCapabilityEnhancement0150.ets | 98 +++ ...ponentNavTabsCapabilityEnhancement0160.ets | 100 +++ .../UIComponentNavTabsContentAdapt0360.ets | 84 +++ .../UIComponentNavTabsContentAdapt0370.ets | 57 ++ .../UIComponentNavTabsContentAdapt0380.ets | 85 +++ .../UIComponentNavTabsEdgeeffect0100.ets | 80 +++ .../UIComponentNavTabsEdgeeffect0170.ets | 170 +++++ .../UIComponentNavTabsEdgeeffect0180.ets | 171 +++++ .../UIComponentNavTabsEdgeeffect0190.ets | 169 +++++ .../UIComponentNavTabsEdgeeffect0200.ets | 168 +++++ .../UIComponentNavTabsEdgeeffect0210.ets | 174 +++++ .../UIComponentNavTabsEdgeeffect0220.ets | 173 +++++ .../UIComponentNavTabsExpandsafearea0130.ets | 49 ++ .../UIComponentNavTabsExpandsafearea0140.ets | 49 ++ .../UIComponentNavTabsExpandsafearea0150.ets | 50 ++ .../UIComponentNavTabsExpandsafearea0160.ets | 55 ++ .../UIComponentNavTabsImproTrace0110.ets | 76 +++ .../UIComponentNavTabsImproTrace0170.ets | 75 +++ .../UIComponentNavTabsInterception0020.ets | 83 +++ .../UIComponentNavTabsInterception0140.ets | 86 +++ .../UIComponentNavTabsInterception0160.ets | 140 ++++ .../UIComponentNavTabsInterface0150.ets | 78 +++ .../UIComponentNavTabsInterface0170.ets | 100 +++ .../UIComponentNavTabsLayout0070.ets | 65 ++ .../UIComponentNavTabsMirror0190.ets | 83 +++ .../UIComponentNavTabsMirror0200.ets | 82 +++ .../UIComponentNavTabsMirror0210.ets | 89 +++ .../UIComponentNavTabsMirror0220.ets | 92 +++ .../UIComponentNavTabsMirror0230.ets | 84 +++ .../UIComponentNavTabsMirror0240.ets | 84 +++ .../UIComponentNavTabsMirror0250.ets | 8 +- .../UIComponentNavTabsMirror0320.ets | 77 +++ .../UIComponentNavTabsNest0010.ets | 92 +++ .../UIComponentNavTabsNest0020.ets | 92 +++ .../UIComponentNavTabsObserver0010.ets | 73 +++ .../UIComponentNavTabsObserver0020.ets | 73 +++ .../UIComponentNavTabsObserver0030.ets | 73 +++ .../UIComponentNavTabsObserver0040.ets | 97 +++ .../UIComponentNavTabsObserver0050.ets | 97 +++ .../UIComponentNavTabsObserver0060.ets | 97 +++ .../UIComponentNavTabsObserver0070.ets | 81 +++ .../UIComponentNavTabsObserver0080.ets | 81 +++ .../UIComponentNavTabsObserver0090.ets} | 96 ++- .../UIComponentNavTabsObserver0100.ets | 93 +++ .../UIComponentNavTabsObserver0110.ets | 87 +++ .../UIComponentNavTabsObserver0120.ets | 82 +++ .../UIComponentNavTabsObserver0130.ets | 82 +++ .../UIComponentNavTabsObserver0150.ets | 87 +++ .../UIComponentNavTabsObserver0160.ets | 73 +++ .../UIComponentNavTabsObserver0170.ets | 73 +++ .../UIComponentNavTabsObserver0200.ets | 113 ++++ .../UIComponentNavTabsObserver0210.ets | 73 +++ .../UIComponentNavTabsObserver/tabcontent.ets | 30 + .../UIComponentNavTabsOnChange0010.ets | 93 +++ .../UIComponentNavTabsOnWillHide0010.ets | 80 +++ .../UIComponentNavTabsOnWillHide0020.ets | 91 +++ .../UIComponentNavTabsOnWillHide0030.ets | 91 +++ .../UIComponentNavTabsOnWillHide0040.ets | 90 +++ .../UIComponentNavTabsOnWillHide0050.ets | 114 ++++ .../UIComponentNavTabsOnWillHide0060.ets | 84 +++ .../UIComponentNavTabsOnWillHide0070.ets | 89 +++ .../UIComponentNavTabsOnWillHide0080.ets | 94 +++ .../UIComponentNavTabsOnWillHide0100.ets | 130 ++++ .../UIComponentNavTabsOnWillHide0110.ets | 88 +++ .../UIComponentNavTabsOnWillHide0120.ets | 90 +++ .../UIComponentNavTabsOnWillHide0130.ets | 115 ++++ .../UIComponentNavTabsOnWillHide0140.ets | 93 +++ .../UIComponentNavTabsOnWillHide0150.ets | 91 +++ .../UIComponentNavTabsOnWillHide0160.ets | 91 +++ .../UIComponentNavTabsOnWillHide0170.ets | 118 ++++ .../UIComponentNavTabsOnWillHide0190.ets | 89 +++ .../UIComponentNavTabsOnWillShow0010.ets | 108 +++ .../UIComponentNavTabsOnWillShow0020.ets | 115 ++++ .../UIComponentNavTabsOnWillShow0030.ets | 108 +++ .../UIComponentNavTabsOnWillShow0040.ets | 84 +++ .../UIComponentNavTabsOnWillShow0050.ets | 89 +++ .../UIComponentNavTabsOnWillShow0060.ets | 84 +++ .../UIComponentNavTabsOnWillShow0070.ets | 84 +++ .../UIComponentNavTabsOnWillShow0080.ets | 84 +++ .../UIComponentNavTabsOnWillShow0100.ets | 127 ++++ .../UIComponentNavTabsOnWillShow0110.ets | 88 +++ .../UIComponentNavTabsOnWillShow0120.ets | 112 ++++ .../UIComponentNavTabsOnWillShow0130.ets | 114 ++++ .../UIComponentNavTabsOnWillShow0140.ets | 113 ++++ .../UIComponentNavTabsOnWillShow0150.ets | 88 +++ .../UIComponentNavTabsOnWillShow0160.ets | 91 +++ .../UIComponentNavTabsOnWillShow0170.ets | 115 ++++ .../UIComponentNavTabsUx003.ets | 66 ++ .../UIComponentNavTabsUx004.ets | 74 +++ .../UIComponentNavTabsUx005.ets | 74 +++ .../UIComponentNavTabsUx007.ets | 75 +++ .../UIComponentNavTabsUx008.ets | 74 +++ .../UIComponentNavTabsUx009.ets | 70 ++ .../UIComponentNavTabsUx010.ets | 72 ++ .../UIComponentNavTabsUx011.ets | 72 ++ .../UIComponentNavTabsUx012.ets | 73 +++ .../UIComponentNavTabsUx013.ets | 71 ++ .../UIComponentNavTabsUx014.ets | 89 +++ .../UIComponentNavTabsUx015.ets | 89 +++ .../UIComponentNavTabsUx016.ets | 89 +++ .../UIComponentNavTabsUx017.ets | 89 +++ .../UIComponentNavTabsUx018.ets | 89 +++ .../UIComponentNavTabsUx019.ets | 137 ++++ .../UIComponentNavTabsUx022.ets | 78 +++ .../UIComponentOtherRefreshAbility0130.ets | 70 ++ .../UIComponentOtherRefreshAbility0140.ets | 74 +++ .../UIComponentOtherRefreshAbility0150.ets | 97 +++ .../UIComponentOtherRefreshAbility0160.ets | 65 ++ .../UIComponentOtherRefreshAbility0170.ets | 81 +++ .../UIComponentOtherRefreshAbility0180.ets | 61 ++ .../UIComponentOtherRefreshAnimation0010.ets | 64 ++ .../UIComponentOtherRefreshAnimation0020.ets | 64 ++ .../UIComponentOtherRefreshAnimation0030.ets | 71 ++ .../UIComponentOtherRefreshAnimation0040.ets | 66 ++ .../UIComponentOtherRefreshAnimation0050.ets | 68 ++ .../UIComponentOtherRefreshAnimation0060.ets | 65 ++ .../UIComponentOtherRefreshAnimation0070.ets | 71 ++ .../UIComponentOtherRefreshAnimation0080.ets | 81 +++ .../UIComponentOtherRefreshAnimation0090.ets | 108 +++ .../UIComponentOtherRefreshAnimation0100.ets | 63 ++ .../UIComponentOtherRefreshAnimation0110.ets | 81 +++ .../UIComponentOtherRefreshAnimation0130.ets | 71 ++ .../UIComponentOtherRefreshAnimation0140.ets | 65 ++ .../WaterFlowDataSource.ets | 141 ++++ ...UIComponentOtherRefreshInterAction0010.ets | 79 +++ ...UIComponentOtherRefreshInterAction0020.ets | 90 +++ ...UIComponentOtherRefreshInterAction0030.ets | 103 +++ ...UIComponentOtherRefreshInterAction0040.ets | 101 +++ ...UIComponentOtherRefreshInterAction0050.ets | 98 +++ ...UIComponentOtherRefreshInterAction0060.ets | 79 +++ ...UIComponentOtherRefreshInterAction0070.ets | 95 +++ ...UIComponentOtherRefreshInterAction0080.ets | 79 +++ ...UIComponentOtherRefreshInterAction0090.ets | 79 +++ ...UIComponentOtherRefreshInterAction0100.ets | 68 ++ ...UIComponentOtherRefreshInterAction0130.ets | 79 +++ ...UIComponentOtherRefreshInterAction0170.ets | 81 +++ ...UIComponentOtherRefreshInterAction0180.ets | 90 +++ ...UIComponentOtherRefreshInterAction0190.ets | 90 +++ ...UIComponentOtherRefreshInterAction0200.ets | 90 +++ ...UIComponentOtherRefreshInterAction0210.ets | 90 +++ ...UIComponentOtherRefreshInterAction0220.ets | 88 +++ ...UIComponentOtherRefreshInterAction0240.ets | 80 +++ ...UIComponentOtherRefreshInterAction0250.ets | 86 +++ ...UIComponentOtherRefreshInterAction0260.ets | 122 ++++ ...UIComponentOtherRefreshInterAction0270.ets | 80 +++ ...UIComponentOtherRefreshInterAction0430.ets | 90 +++ ...mponentOtherRefreshInterConnection0010.ets | 96 +++ ...mponentOtherRefreshInterConnection0030.ets | 97 +++ ...mponentOtherRefreshInterConnection0040.ets | 96 +++ ...mponentOtherRefreshInterConnection0050.ets | 99 +++ ...mponentOtherRefreshInterConnection0060.ets | 97 +++ ...mponentOtherRefreshInterConnection0070.ets | 98 +++ ...mponentOtherRefreshInterConnection0080.ets | 97 +++ ...mponentOtherRefreshInterConnection0110.ets | 47 ++ ...mponentOtherRefreshInterConnection0120.ets | 52 ++ ...mponentOtherRefreshInterConnection0130.ets | 52 ++ .../UIComponentOtherRefreshInterface0010.ets | 60 ++ .../UIComponentOtherRefreshInterface0020.ets | 60 ++ .../UIComponentOtherRefreshInterface0030.ets | 60 ++ .../UIComponentOtherRefreshInterface0040.ets | 60 ++ .../UIComponentOtherRefreshInterface0130.ets | 61 ++ .../UIComponentOtherRefreshInterface0160.ets | 65 ++ .../UIComponentOtherRefreshInterface0170.ets | 2 +- .../UIComponentOtherRefreshInterface0180.ets | 2 +- .../UIComponentOtherRefreshInterface0200.ets | 65 ++ ...omponentOtherRefreshOnOffsetChange0100.ets | 66 ++ .../UIComponentOtherRefreshPromptText0010.ets | 75 +++ .../UIComponentOtherRefreshPromptText0030.ets | 76 +++ .../UIComponentOtherRefreshPromptText0160.ets | 72 ++ .../UIComponentOtherRefreshPromptText0170.ets | 61 ++ .../UIComponentOtherRefreshPromptText0180.ets | 61 ++ .../UIComponentOtherRefreshPromptText0220.ets | 76 +++ .../UIComponentOtherRefreshPromptText0230.ets | 65 ++ .../UIComponentOtherRefreshPromptText0240.ets | 65 ++ .../UIComponentOtherRefreshPromptText0250.ets | 59 ++ .../UIComponentRefreshPulldownradio0060.ets | 75 +++ .../UIComponentRefreshPulldownradio0120.ets | 76 +++ .../UIComponentRefreshPulldownradio0130.ets | 76 +++ .../UIComponentRefreshPulldownradio0140.ets | 88 +++ .../UIComponentRefreshPulldownradio0160.ets | 86 +++ .../UIComponentScrollSwiperTeace0370.ets | 76 +++ .../UIComponentTabTabbarTabbarsymbol0200.ets | 57 ++ .../UIComponentTabTabbarTabbarsymbol0210.ets | 57 ++ .../UIComponentTabTabbarTabbarsymbol0220.ets | 64 ++ .../UIComponentTabsClip0010.ets | 65 ++ .../UIComponentTabsClip0020.ets | 65 ++ .../UIComponentUISupportColor1060.ets | 67 ++ .../UIComponentUISupportColor1070.ets | 67 ++ .../UIComponentUISupportColor1080.ets | 67 ++ .../UIComponentUISupportColor1090.ets | 67 ++ .../UIComponentUISupportColor1100.ets | 62 ++ .../UIComponentUISupportColor1110.ets | 62 ++ .../UIComponentWaterFlowFooter0010.ets | 183 ++++++ .../WaterFlowDataSource.ets | 134 ++++ .../UIComponentWaterFlowSliding0270.ets | 108 +++ .../UIComponentWaterFlowSliding0320.ets | 182 ++++++ .../UIComponentWaterFlowSliding0470.ets | 128 ++++ .../UIComponentWaterFlowSliding0480.ets | 126 ++++ .../WaterFlowDataSource.ets | 142 ++++ .../WaterFlowDataSource1.ets | 142 ++++ .../UIRefreshComponentContent0030.ets | 90 +++ .../ohosTest/resources/base/media/flower1.jpg | Bin 0 -> 21001 bytes .../ohosTest/resources/base/media/flower2.jpg | Bin 0 -> 58438 bytes .../ohosTest/resources/base/media/flower3.jpg | Bin 0 -> 40661 bytes .../resources/base/profile/test_pages.json | 296 ++++++++- .../src/ohosTest/resources/rawfile/index.html | 11 + 374 files changed, 41456 insertions(+), 546 deletions(-) create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource1.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource2.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabs/UIComponentNavTabs0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290.ets rename function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/{UIComponentNavTabsCachedCount014.ets => UIComponentNavTabsCachedCount0300.ets} (74%) create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080.ets rename function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/{UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets => UIComponentNavTabsObserver/UIComponentNavTabsObserver0090.ets} (36%) create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/tabcontent.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource1.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower1.jpg create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower2.jpg create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower3.jpg create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/index.html diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets new file mode 100644 index 000000000..f82e9bcc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets @@ -0,0 +1,521 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function ArkUIAnimatedResponse() { + + describe('ArkUIAnimatedResponse', () => { + 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_ARKUI_ANIMATED_RESPONSE_0050 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0050 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0050 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0080 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0080 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0080 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0110 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0110 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0110 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(500) + await tab7.click() + await Utils.sleep(1000) + + let tab9:Component = await driver.findComponent(ON.id('tab9')); + await Utils.sleep(500) + await tab9.click() + await Utils.sleep(1000) + + let tab8:Component = await driver.findComponent(ON.id('tab8')); + await Utils.sleep(500) + await tab8.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0100 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0100 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0100 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0070 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0070 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0070 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0060 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0060 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0060 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0090 + * @tc.name SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0090 + * @tc.desc nav width + */ + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0090 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0090 finish.`); + done() + }) + + + it('SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0040 start.`); + Settings.createWindow("testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040") + await Utils.sleep(300) + + let driver : Driver = Driver.create(); + await driver.delayMs(300) + + let tab3:Component = await driver.findComponent(ON.id('tab3')); + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + let tab4:Component = await driver.findComponent(ON.id('tab4')); + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + let tab5:Component = await driver.findComponent(ON.id('tab5')); + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + let tab6:Component = await driver.findComponent(ON.id('tab6')); + await Utils.sleep(300) + await tab6.click() + await Utils.sleep(300) + let tab7:Component = await driver.findComponent(ON.id('tab7')); + await Utils.sleep(300) + await tab7.click() + await Utils.sleep(300) + + await tab6.click() + await Utils.sleep(300) + await tab5.click() + await Utils.sleep(300) + await tab4.click() + await Utils.sleep(300) + await tab3.click() + await Utils.sleep(300) + + let tab2:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(300) + await tab2.click() + await Utils.sleep(300) + + let tab1:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(300) + await tab1.click() + await Utils.sleep(300) + + let tab0:Component = await driver.findComponent(ON.id('tab0')); + await Utils.sleep(300) + await tab0.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_ANIMATED_RESPONSE_0040 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets index 11de16ebb..92546b19a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabScrollable() { describe('ArkUITabScrollable', () => { + 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() + }) /* @@ -43,7 +58,7 @@ export default function ArkUITabScrollable() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_scrollable_001 finish.`); done() @@ -68,7 +83,7 @@ export default function ArkUITabScrollable() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_scrollable_002 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets index 8c54c62e5..f14cafdd0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsIconStyleSelectedColor() { describe('ArkUITabsIconStyleSelectedColor', () => { + 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 ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 @@ -32,7 +46,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 finish.`); done() @@ -46,7 +60,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 finish.`); done() @@ -60,7 +74,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 finish.`); done() @@ -74,7 +88,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 finish.`); done() @@ -88,7 +102,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 finish.`); done() @@ -102,7 +116,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 finish.`); done() @@ -116,7 +130,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 finish.`); done() @@ -130,7 +144,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 finish.`); done() @@ -144,7 +158,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 finish.`); done() @@ -158,7 +172,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 finish.`); done() @@ -172,7 +186,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 finish.`); done() @@ -186,7 +200,7 @@ export default function ArkUITabsIconStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022$ finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets index 5df21352c..59ae60edc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -23,6 +23,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsIconStyleUnselectedColor() { describe('ArkUITabsIconStyleUnselectedColor', () => { + 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 ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 @@ -32,7 +47,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 finish.`); done() @@ -46,7 +61,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 finish.`); done() @@ -60,7 +75,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 finish.`); done() @@ -74,7 +89,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 finish.`); done() @@ -88,7 +103,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 finish.`); done() @@ -102,7 +117,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 finish.`); done() @@ -116,7 +131,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 finish.`); done() @@ -130,7 +145,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 finish.`); done() @@ -144,7 +159,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 finish.`); done() @@ -158,7 +173,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 finish.`); done() @@ -172,7 +187,7 @@ export default function ArkUITabsIconStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 start.`); Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets index 39aa13701..20bc4b030 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsLabelStyleSelectedColor() { describe('ArkUITabsLabelStyleSelectedColor', () => { + 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() + }) /* @@ -43,7 +58,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_027 finish.`); done() @@ -68,7 +83,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_029 finish.`); done() @@ -93,7 +108,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_013 finish.`); done() @@ -118,7 +133,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_017 finish.`); done() @@ -142,7 +157,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_019 finish.`); done() @@ -167,7 +182,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_001 finish.`); done() @@ -192,7 +207,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_003 finish.`); done() @@ -216,7 +231,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_005 finish.`); done() @@ -240,7 +255,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_007 finish.`); done() @@ -265,7 +280,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_011 finish.`); done() @@ -290,7 +305,7 @@ export default function ArkUITabsLabelStyleSelectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_009 finish.`); done() @@ -304,14 +319,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor028_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 finish.`); done() @@ -325,14 +340,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor021_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 finish.`); done() @@ -346,14 +361,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor023_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 finish.`); done() @@ -367,14 +382,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor024_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 finish.`); done() @@ -388,14 +403,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor026_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 finish.`); done() @@ -409,14 +424,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor025_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 finish.`); done() @@ -430,14 +445,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor012_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 finish.`); done() @@ -451,14 +466,14 @@ export default function ArkUITabsLabelStyleSelectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor015_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets index d7dd03775..2c34e10be 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,22 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsLabelStyleUnselectedColor() { describe('ArkUITabsLabelStyleUnselectedColor', () => { + 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 ArkUI_Tabs_LabelStyle_unselectedColor_026 @@ -42,7 +58,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_026 finish.`); done() @@ -67,7 +83,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_028 finish.`); done() @@ -92,7 +108,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_027 finish.`); done() @@ -117,7 +133,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_021 finish.`); done() @@ -142,7 +158,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_022 finish.`); done() @@ -167,7 +183,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_025 finish.`); done() @@ -192,7 +208,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_011 finish.`); done() @@ -217,7 +233,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_012 finish.`); done() @@ -242,7 +258,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_017 finish.`); done() @@ -267,7 +283,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_001 finish.`); done() @@ -292,7 +308,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 finish.`); done() @@ -317,7 +333,7 @@ export default function ArkUITabsLabelStyleUnselectedColor() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_008 finish.`); done() @@ -331,14 +347,14 @@ export default function ArkUITabsLabelStyleUnselectedColor() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleUnselectedcolor024_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets index 1279dfa79..1b981023c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsLabelStylefont() { describe('ArkUITabsLabelStylefont', () => { + 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() + }) /* @@ -42,7 +57,7 @@ export default function ArkUITabsLabelStylefont() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_005 finish.`); done() @@ -67,7 +82,7 @@ export default function ArkUITabsLabelStylefont() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_016 finish.`); done() @@ -92,7 +107,7 @@ export default function ArkUITabsLabelStylefont() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_015 finish.`); done() @@ -109,7 +124,7 @@ export default function ArkUITabsLabelStylefont() { Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 finish.`); done() @@ -126,7 +141,7 @@ export default function ArkUITabsLabelStylefont() { Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 finish.`); done() @@ -143,7 +158,7 @@ export default function ArkUITabsLabelStylefont() { Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 finish.`); done() @@ -160,7 +175,7 @@ export default function ArkUITabsLabelStylefont() { Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 finish.`); done() @@ -177,7 +192,7 @@ export default function ArkUITabsLabelStylefont() { Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 finish.`); done() @@ -202,7 +217,7 @@ export default function ArkUITabsLabelStylefont() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_020 finish.`); done() @@ -216,7 +231,7 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 finish.`); done() @@ -230,7 +245,7 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 finish.`); done() @@ -244,14 +259,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont001_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 finish.`); done() @@ -265,14 +280,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont003_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 finish.`); done() @@ -286,14 +301,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont004_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 finish.`); done() @@ -307,14 +322,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont018_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 finish.`); done() @@ -328,14 +343,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont017_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 finish.`); done() @@ -349,14 +364,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont013_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 finish.`); done() @@ -370,14 +385,14 @@ export default function ArkUITabsLabelStylefont() { Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 start.`); Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) let driver: Driver = Driver.create() let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont012_001')) await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets index 50df4505f..aaf0374fa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -23,6 +23,21 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function ArkUITabsSingleSelectedcolor() { describe('ArkUITabsSingleSelectedcolor', () => { + 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 ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 @@ -33,7 +48,7 @@ export default function ArkUITabsSingleSelectedcolor() { Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011") await Utils.sleep(2000) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 finish.`); done() @@ -48,7 +63,7 @@ export default function ArkUITabsSingleSelectedcolor() { Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002") await Utils.sleep(2000) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 finish.`); done() @@ -63,7 +78,7 @@ export default function ArkUITabsSingleSelectedcolor() { Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005") await Utils.sleep(2000) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 finish.`); done() @@ -77,7 +92,7 @@ export default function ArkUITabsSingleSelectedcolor() { Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008") await Utils.sleep(2000) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets index cb90a868a..c340ddbb0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -23,6 +23,21 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function ArkUITabsSingleUnselectedcolor() { describe('ArkUITabsSingleUnselectedcolor', () => { + 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 ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 * @tc.name ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 @@ -33,7 +48,7 @@ export default function ArkUITabsSingleUnselectedcolor() { Settings.createWindow("testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003") await Utils.sleep(2000) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets index 60afbf12b..d206dfca0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function ArkUITabsVertical() { describe('ArkUITabsVertical', () => { + 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 ArkUI_Tabs_vertical_001 @@ -42,7 +57,7 @@ export default function ArkUITabsVertical() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `ArkUI_Tabs_vertical_001 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets index e2b67bdc1..ed40d544f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -17,11 +17,26 @@ import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' -import { Component, Driver ,ON } from '@ohos.UiTest' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' export default function FunctionJichuWaterFlow() { describe('FunctionJichuWaterFlow', () => { + 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() + }) /* @@ -34,7 +49,7 @@ export default function FunctionJichuWaterFlow() { Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 start.`); Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 finish.`); done() @@ -50,21 +65,116 @@ export default function FunctionJichuWaterFlow() { Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 start.`); Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + let driver: Driver = Driver.create(); await driver.delayMs(100) - let refreshListItem0 :Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow001806_001')) + let refreshListItem0: Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow001806_001')) await Utils.sleep(200) let pos = await refreshListItem0.getBoundsCenter() await Utils.sleep(100) - await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 400) await Utils.sleep(1000) - await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 400) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 finish.`); done() }) + /* +* @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737 +* @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的参数:设置参数footer +*/ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737142 +* @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737142 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的参数:设置参数footer +*/ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737142', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737142 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350737142 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_1 + * @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_1 + * @tc.desc + */ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_1 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')) + await Utils.sleep(1000) + let center = await water.getBoundsCenter(); + await driver.fling({ + x: center.x, y: center.y + 400 + }, { + x: center.x, y: center.y + }, 5, 40000); + await Utils.sleep(3000) + let button: Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow0380_002')) + await button.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_2 + * @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_2 + * @tc.desc + */ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_2 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow0380_001')) + await button.click(); + await Utils.sleep(1000); + let water = await driver.findComponent(ON.type('WaterFlow')) + await Utils.sleep(1000); + let center = await water.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + 50 + }); + pointers.setPoint(0, 1, { + x: center.x, y: center.y + 20 + }); + pointers.setPoint(0, 2, { + x: center.x, y: center.y + }); + await Utils.sleep(3000) + await driver.injectMultiPointerAction(pointers); + let button2: Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow0380_002')) + await button2.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0380_2 finish.`); + 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..8a3caee6c 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,30 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; + +import UIComponentNavTabsOnWillHide from './UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test'; +import UIComponentWaterFlowSliding from './UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test'; +import ArkUIAnimatedResponse from './ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test'; +import UIComponentNavTabsCapabilityEnhancement from './UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test'; +import UIComponentNavTabsAnimated from './UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test'; +import UIComponentNavTabsNest from './UIComponentNavTabsNestTest/UIComponentNavTabsNest.test'; +import UIComponentNavTabsUx from './UIComponentNavTabsUxTest/UIComponentNavTabsUx.test'; +import UIComponentNavTabsLayout from './UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test'; +import UIComponentOtherRefreshAnimation from './UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test'; +import UIComponentOtherRefreshInterConnection from './UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test'; +import UIComponentOtherRefreshOnOffsetChange from './UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test'; +import UIComponentNavTabsObserver from './UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test'; +import UIComponentWaterFlowFooter from './UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test'; +import UIComponentTabsClip from './UIComponentTabsClipTest/UIComponentTabsClip.test'; +import UIComponentRefreshPulldownradio from './UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test'; +import UIComponentListAndGridXommonOnscroll from './UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test'; +import UIComponentNavTabs from './UIComponentNavTabsTest/UIComponentNavTabs.test'; +import UIRefreshComponentContent from './UIRefreshComponentContentTest/UIRefreshComponentContent.test'; +import UIComponentNavTabsOnChange from './UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test'; +import UIComponentListandgridWaterflowEventenhancement from './UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test'; +import UIComponentListAndGridWaterflowSections from './UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test'; +import UIComponentListAndGridWaterflowGetItemMainSizeByIndex from './UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test'; +import UIComponentListAndGridWaterflowSpring from './UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -166,6 +190,7 @@ export default function testsuite() { ComponentTextRicheditorShortKcutKeysTests(); UIComponentNavTabsOnWillShow(); + UIComponentNavTabsContentAdapt(); ArkUITabScrollable(); ArkUITabsLabelStylefont(); @@ -239,6 +264,31 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + + UIComponentNavTabsOnWillHide(); + UIComponentWaterFlowSliding(); + ArkUIAnimatedResponse(); + UIComponentNavTabsCapabilityEnhancement(); + UIComponentNavTabsAnimated(); + UIComponentNavTabsNest(); + UIComponentNavTabsUx(); + UIComponentNavTabsLayout(); + UIComponentOtherRefreshAnimation(); + UIComponentOtherRefreshInterConnection(); + UIComponentOtherRefreshOnOffsetChange(); + UIComponentNavTabsObserver(); + UIComponentWaterFlowFooter(); + UIComponentTabsClip(); + UIComponentRefreshPulldownradio(); + UIComponentListAndGridXommonOnscroll(); + UIComponentNavTabs(); + UIRefreshComponentContent(); + UIComponentNavTabsOnChange(); + UIComponentListandgridWaterflowEventenhancement(); + UIComponentListAndGridWaterflowSections(); + UIComponentListAndGridWaterflowGetItemMainSizeByIndex(); + UIComponentListAndGridWaterflowSpring(); + } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets index 60f88eae7..39fd93b6c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentListAndGridWaterFlowAdd() { describe('UIComponentListAndGridWaterFlowAdd', () => { + 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() + }) /* @@ -40,7 +54,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { await Utils.sleep(1000) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 finish.`); done() @@ -56,7 +70,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 finish.`); done() @@ -72,7 +86,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 finish.`); done() @@ -88,7 +102,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 finish.`); done() @@ -105,7 +119,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 finish.`); done() @@ -121,7 +135,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 finish.`); done() @@ -137,7 +151,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 finish.`); done() @@ -153,7 +167,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 finish.`); done() @@ -171,7 +185,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 finish.`); done() @@ -187,7 +201,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 finish.`); done() @@ -203,7 +217,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 finish.`); done() @@ -222,7 +236,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 finish.`); done() @@ -241,7 +255,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 finish.`); done() @@ -260,7 +274,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 finish.`); done() @@ -279,7 +293,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 finish.`); done() @@ -298,7 +312,7 @@ export default function UIComponentListAndGridWaterFlowAdd() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets index 0bd9f7c77..b42c2ac64 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentListAndGridWaterSections() { describe('UIComponentListAndGridWaterSections', () => { + 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() + }) /* @@ -41,7 +55,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 finish.`); done() @@ -68,7 +82,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 finish.`); done() @@ -95,7 +109,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 finish.`); done() @@ -122,7 +136,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 finish.`); done() @@ -149,7 +163,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 finish.`); done() @@ -176,7 +190,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 finish.`); done() @@ -203,7 +217,7 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 finish.`); done() @@ -218,7 +232,7 @@ export default function UIComponentListAndGridWaterSections() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 finish.`); done() @@ -232,7 +246,7 @@ export default function UIComponentListAndGridWaterSections() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 finish.`); done() @@ -247,7 +261,7 @@ export default function UIComponentListAndGridWaterSections() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 finish.`); done() @@ -262,7 +276,7 @@ export default function UIComponentListAndGridWaterSections() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 start.`); Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 finish.`); done() @@ -286,10 +300,281 @@ export default function UIComponentListAndGridWaterSections() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 finish.`); done() }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0550 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0550 + * @tc.desc 1、创建分组瀑布流 + 2、设置offset属性 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0550', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0550 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0550 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460 +* @tc.desc 1、创建分组瀑布流,分组中不设置返回高度 +2、scrollEdge跳转测试 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0460_001')) + await Utils.sleep(1000) + await button1.click() + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0460_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0440 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0440 +* @tc.desc 1、创建分组瀑布流,分组中不设置返回高度 +2、scrollPage跳转测试 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0440', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0440 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0440_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0440_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0440 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0430 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0430 +* @tc.desc 1、创建分组瀑布流,分组中不设置返回高度 +2、scrollToIndex到分组中的索引 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0430', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0430 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0430_001')) + await Utils.sleep(1000) + await button1.click() + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0430_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0430 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0450 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0450 +* @tc.desc 1、创建分组瀑布流,分组中不设置返回高度 +2、scrollTo跳转测试 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0450', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0450 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0450_001')) + await Utils.sleep(1000) + await button1.click() + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0450_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0450 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0490 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0490 +* @tc.desc 1、创建移动窗口布局的分组瀑布流,分组中不设置返回高度 + 2、scrollEdge跳转测试 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0490', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0490 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0490_001')) + await Utils.sleep(1000) + await button1.click() + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0490_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0490 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0480 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0480 +* @tc.desc 1、创建移动窗口布局的分组瀑布流,分组中不设置返回高度 + 2、scrollPage跳转测试 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0480', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0480 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0480_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0480_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0480 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0470 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0470 +* @tc.desc 1、创建移动窗口布局的分组瀑布流,分组中不设置返回高度 + 2、scrollToIndex到分组中的索引 +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0470', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0470_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0470_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0470 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0060_002')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0580', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0580 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let waterFlowCenter:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0580')); + await Utils.sleep(1000) + let pos = await waterFlowCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(2000) + + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0580_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(2000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0580_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0580 finish.`); + done() + }) + + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets new file mode 100644 index 000000000..ab2b0dcf8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.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. + */ + +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, ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterflowGetItemMainSizeByIndex() { + + describe('UIComponentListAndGridWaterflowGetItemMainSizeByIndex', () => { + 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_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_656_824 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_656_824 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_656_824', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_656_824 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824"); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_656_824 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_1 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_1 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141_002')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141_001')); + await Utils.sleep(1000); + await button1.click(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141_002')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_624 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_624 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_624', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_2 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624"); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_GETITEMMAINSIZEBTINDEX_0010_141_624 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets new file mode 100644 index 000000000..b755c3a0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.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 { 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, ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterflowSections() { + + describe('UIComponentListAndGridWaterflowSections', () => { + 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_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_1 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_1 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowSections0460211_002')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_2 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_2 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowSections0460211_002')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id('UIComponentListAndGridWaterflowSections0460211_001')); + await Utils.sleep(1000); + await button2.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0460_211_2 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets new file mode 100644 index 000000000..84f16aca4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.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. + */ + +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, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterflowSpring() { + + describe('UIComponentListAndGridWaterflowSpring', () => { + 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_LISTANDGRID_WATERFLOW_SPRING_0180_721 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0180_721 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0180_721', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0180_721 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721"); + await Utils.sleep(1000); + let driver = Driver.create(); + let WaterFlow = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let center = await WaterFlow.getBoundsCenter(); + await Utils.sleep(1000); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + 50 + }); + pointers.setPoint(0, 1, { + x: center.x, y: center.y + 20 + }); + pointers.setPoint(0, 2, { + x: center.x, y: center.y + }); + await driver.injectMultiPointerAction(pointers,1200); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0180_721 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0150_660 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0150_660 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0150_660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0150_660 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660"); + await Utils.sleep(1000); + let driver = Driver.create(); + let WaterFlow = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let center = await WaterFlow.getBoundsCenter(); + await Utils.sleep(1000); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + 80 + }); + pointers.setPoint(0, 1, { + x: center.x, y: center.y + 50 + }); + pointers.setPoint(0, 2, { + x: center.x, y: center.y + }); + await driver.injectMultiPointerAction(pointers,1200); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0150_660 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0250_290 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0250_290 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0250_290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0250_290 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290"); + await Utils.sleep(1000); + let driver = Driver.create(); + let WaterFlow = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let center = await WaterFlow.getBoundsCenter(); + await Utils.sleep(1000); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + 80 + }); + pointers.setPoint(0, 1, { + x: center.x, y: center.y + 50 + }); + pointers.setPoint(0, 2, { + x: center.x, y: center.y + }); + await driver.injectMultiPointerAction(pointers,1200); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SPRING_0250_290 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets new file mode 100644 index 000000000..da988f20f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.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 { 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, ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridXommonOnscroll() { + + describe('UIComponentListAndGridXommonOnscroll', () => { + 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 UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0540_791 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0540_791 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0540_791', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0540_791 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0540791_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0540_791 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0530_136 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0530_136 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0530_136', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0530_136 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0530136_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0530_136 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0510_711 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0510_711 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0510_711', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0510_711 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0510711_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0510_711 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0550_659 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0550_659 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0550_659', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0550_659 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0550659_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0550_659 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0570_768 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0570_768 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0570_768', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0570_768 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0570768_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0570_768 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0560_601 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0560_601 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0560_601', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0560_601 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentListAndGridXommonOnscroll0560601_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0560_601 finish.`); + done() + }) + /* + * @tc.number UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0680_459 + * @tc.name UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0680_459 + * @tc.desc + */ + it('UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0680_459', 0, async (done: Function) => { + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0680_459 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459"); + await Utils.sleep(2000); + let driver = Driver.create(); + let WaterFlow = await driver.findComponent(ON.type('WaterFlow')); + let point = await WaterFlow.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x, point.y + 100); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0680_459 finish.`); + done() + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets new file mode 100644 index 000000000..52f6de3f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets @@ -0,0 +1,271 @@ +/* + * 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 + * 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, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridWaterflowEventenhancement() { + + describe('UIComponentListandgridWaterflowEventenhancement', () => { + 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_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0080_380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0080_380 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0080_380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0080_380 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(3000); + await driver.mouseScroll(point, false, 10); + await Utils.sleep(3000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0080_380 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0200_448 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0200_448 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0200_448', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0200_448 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.swipe(point.x, point.y + 100, point.x, point.y - 100); + await Utils.sleep(3000); + await driver.swipe(point.x, point.y - 100, point.x, point.y + 100); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0200_448 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0240_733 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0240_733 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0240_733', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0240_733 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.id('UIComponentListandgridWaterflowEventenhancement0240733_001')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0240_733 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0230_655 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0230_655 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0230_655', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0230_655 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(3000); + await driver.mouseScroll(point, false, 10); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0230_655 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling(point, { + x: point.x, y: point.y - 100 + }, 5, 600); + await Utils.sleep(3000); + await driver.fling({ + x: point.x, y: point.y - 100 + },point, 5, 600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0250_294 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0250_294 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0250_294', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0250_294 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.swipe(point.x, point.y, point.x, point.y - 100); + await Utils.sleep(3000); + await driver.swipe(point.x, point.y - 100, point.x, point.y); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0250_294 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0290_143 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0290_143 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0290_143', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0290_143 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.id('UIComponentListandgridWaterflowEventenhancement0290143_001')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0290_143 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0280_114 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0280_114 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0280_114', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0280_114 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(3000); + await driver.mouseScroll(point, false, 10); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0280_114 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0180_890 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0180_890 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0180_890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0180_890 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.id('UIComponentListandgridWaterflowEventenhancement0180890_001')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0180_890 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0090_043 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0090_043 + * + * */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0090_043', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0090_043 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043"); + await Utils.sleep(1000); + let driver = Driver.create(); + let water = await driver.findComponent(ON.type('WaterFlow')); + await Utils.sleep(1000); + let point = await water.getBoundsCenter(); + await Utils.sleep(1000); + await driver.swipe(point.x, point.y + 100, point.x, point.y - 100); + await Utils.sleep(3000); + await driver.swipe(point.x, point.y - 100, point.x, point.y + 100); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0090_043 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets index 12e9b46a2..6521f74b7 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function UIComponentNavModifier() { describe('UIComponentNavModifier', () => { + 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_MODIFIER_0460 * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 @@ -32,7 +47,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier046") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 finish.`); done() @@ -55,7 +70,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 finish.`); done() @@ -77,7 +92,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 finish.`); done() @@ -99,7 +114,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 finish.`); done() @@ -121,7 +136,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 finish.`); done() @@ -138,7 +153,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier048") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 finish.`); done() @@ -154,7 +169,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier045") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 finish.`); done() @@ -176,7 +191,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 finish.`); done() @@ -198,7 +213,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 finish.`); done() @@ -220,7 +235,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 finish.`); done() @@ -237,7 +252,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier060") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 finish.`); done() @@ -260,7 +275,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 finish.`); done() @@ -282,7 +297,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 finish.`); done() @@ -304,7 +319,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 finish.`); done() @@ -320,7 +335,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0810") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 finish.`); done() @@ -336,7 +351,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0770") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 finish.`); done() @@ -352,7 +367,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0860") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 finish.`); done() @@ -368,7 +383,7 @@ export default function UIComponentNavModifier() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0840") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 finish.`); done() @@ -395,7 +410,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 finish.`); done() @@ -421,7 +436,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 finish.`); done() @@ -447,7 +462,7 @@ export default function UIComponentNavModifier() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 finish.`); done() @@ -461,7 +476,7 @@ export default function UIComponentNavModifier() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0380") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 finish.`); done() @@ -475,7 +490,7 @@ export default function UIComponentNavModifier() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 start.`); Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0400") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets index 9c7a17f44..7daa0bd7b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsAction() { describe('UIComponentNavTabsAction', () => { + 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_TABS_ACTION_0011 @@ -50,7 +65,7 @@ export default function UIComponentNavTabsAction() { let pos1 = await tabsCenter.getBoundsCenter() await driver.swipe(pos1.x-100,pos1.y,pos1.x+300,pos1.y) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 finish.`); done() @@ -79,7 +94,7 @@ export default function UIComponentNavTabsAction() { await Utils.sleep(100) await tabBar1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 finish.`); done() @@ -110,10 +125,84 @@ export default function UIComponentNavTabsAction() { await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0090 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0180')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsAction0130_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsAction0140_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0140 finish.`); + done() + }) + + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets new file mode 100644 index 000000000..d50bd93cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets @@ -0,0 +1,219 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsAnimated() { + + describe('UIComponentNavTabsAnimated', () => { + 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_TABS_ANIMATED_012 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_007 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_007 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_007', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_007 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated007_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(500) + + let buttonYellow:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await buttonYellow.click() + await Utils.sleep(2000) + + let buttonPink:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await buttonPink.click() + await Utils.sleep(2000) + + let clearbutton:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated007_002')); + await Utils.sleep(1000) + await clearbutton.click() + await Utils.sleep(1000) + + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_007 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_005 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_005 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_005', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_005 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(1000) + + + let clearbutton:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated005_002')); + await Utils.sleep(1000) + await clearbutton.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_005 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_003 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_003 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_003', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_003 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated003_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(500) + + await button1.click() + await Utils.sleep(1000) + + + let clearbutton:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated003_002')); + await Utils.sleep(1000) + await clearbutton.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_003 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_015 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_015 +* @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_015', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_015 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsAnimated015_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_015 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets index e5dabdb45..703244ca8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function UIComponentNavTabsBlurStyle() { describe('UIComponentNavTabsBlurStyle', () => { + 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() + }) /* @@ -93,7 +108,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 finish.`); done() @@ -168,7 +183,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 finish.`); done() @@ -243,7 +258,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 finish.`); done() @@ -318,7 +333,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 finish.`); done() @@ -392,7 +407,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 finish.`); done() @@ -467,7 +482,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(100) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 finish.`); done() @@ -542,7 +557,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(100) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 finish.`); done() @@ -617,7 +632,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button13.click() await Utils.sleep(100) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 finish.`); done() @@ -638,7 +653,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(1000) let driver: Driver = Driver.create(); await driver.delayMs(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 finish.`); done() @@ -659,7 +674,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(1000) let driver: Driver = Driver.create(); await driver.delayMs(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 finish.`); done() @@ -689,7 +704,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button2.click() await Utils.sleep(100) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 finish.`); done() @@ -707,7 +722,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 finish.`); done() @@ -725,7 +740,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 finish.`); done() @@ -743,7 +758,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 finish.`); done() @@ -760,7 +775,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 finish.`); done() @@ -778,7 +793,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 finish.`); done() @@ -795,7 +810,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 finish.`); done() @@ -814,7 +829,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 finish.`); done() @@ -833,7 +848,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 finish.`); done() @@ -864,7 +879,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(100) await button2.click() await Utils.sleep(100) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 finish.`); done() @@ -882,7 +897,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 finish.`); done() @@ -900,7 +915,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 finish.`); done() @@ -918,7 +933,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 finish.`); done() @@ -936,7 +951,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 finish.`); done() @@ -953,7 +968,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 finish.`); done() @@ -972,7 +987,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 finish.`); done() @@ -991,7 +1006,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 finish.`); done() @@ -1022,7 +1037,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 finish.`); done() @@ -1041,7 +1056,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 finish.`); done() @@ -1060,7 +1075,7 @@ export default function UIComponentNavTabsBlurStyle() { await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 finish.`); done() @@ -1074,7 +1089,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 finish.`); done() @@ -1088,7 +1103,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 finish.`); done() @@ -1102,7 +1117,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 finish.`); done() @@ -1116,7 +1131,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 finish.`); done() @@ -1130,7 +1145,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 finish.`); done() @@ -1144,7 +1159,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 finish.`); done() @@ -1158,7 +1173,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 finish.`); done() @@ -1172,7 +1187,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 finish.`); done() @@ -1186,7 +1201,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 finish.`); done() @@ -1200,7 +1215,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 finish.`); done() @@ -1214,7 +1229,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 finish.`); done() @@ -1228,7 +1243,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 finish.`); done() @@ -1242,7 +1257,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 finish.`); done() @@ -1256,7 +1271,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 finish.`); done() @@ -1270,7 +1285,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 finish.`); done() @@ -1284,7 +1299,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 finish.`); done() @@ -1298,7 +1313,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 finish.`); done() @@ -1312,7 +1327,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 finish.`); done() @@ -1326,7 +1341,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 finish.`); done() @@ -1340,7 +1355,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 finish.`); done() @@ -1354,7 +1369,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 finish.`); done() @@ -1368,7 +1383,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 finish.`); done() @@ -1382,7 +1397,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 finish.`); done() @@ -1396,7 +1411,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 finish.`); done() @@ -1410,7 +1425,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 finish.`); done() @@ -1424,7 +1439,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 finish.`); done() @@ -1438,7 +1453,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 finish.`); done() @@ -1452,7 +1467,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 finish.`); done() @@ -1466,7 +1481,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 finish.`); done() @@ -1480,7 +1495,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 finish.`); done() @@ -1494,7 +1509,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 finish.`); done() @@ -1508,7 +1523,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 finish.`); done() @@ -1522,7 +1537,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 finish.`); done() @@ -1536,7 +1551,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 finish.`); done() @@ -1550,7 +1565,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 finish.`); done() @@ -1564,7 +1579,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 finish.`); done() @@ -1578,7 +1593,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 finish.`); done() @@ -1592,7 +1607,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 finish.`); done() @@ -1606,7 +1621,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 finish.`); done() @@ -1620,7 +1635,7 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 finish.`); done() @@ -1634,12 +1649,118 @@ export default function UIComponentNavTabsBlurStyle() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400") await Utils.sleep(1000) - await windowSnap.snapShot() + await await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 finish.`); done() }) + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_1 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0037_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + await button1.click() + await Utils.sleep(3000) + + await await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_1 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_2 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0037_002')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + await button1.click() + await Utils.sleep(3000) + + await await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_2 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_3 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0037_003')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + await button1.click() + await Utils.sleep(3000) + + await await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_3 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_4 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0037_004')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + await button1.click() + await Utils.sleep(3000) + + await await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_4 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_5', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_5 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0037_005')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + await button1.click() + await Utils.sleep(3000) + + await await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0037_5 finish.`); + done() + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets index 764434b8c..7e575844a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,72 +22,620 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsCachedCount() { describe('UIComponentNavTabsCachedCount', () => { + 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_TABS_CACHEDCOUNT_0140 - * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 - * @tc.desc 1、创建tabs,设置BarPosition.Start 2、设置preloadItens[1,3] - */ - it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140', 0, async (done: Function) => { - Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 start.`); - Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014") + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_016 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_016 + * @tc.desc 1、创建tabs,设置BarPosition动态改变 + 2、设置preloadItens[1,3] + 3、动态切换BarPosition + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_016', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_016 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabs016_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_016 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0290 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0290 +* @tc.desc 1、创建tabs,设置BarPosition动态改变 + 2、设置preloadItens[1,3] + 3、动态切换BarPosition +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0290', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0290 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0290_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0290 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0280 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0280 +* @tc.desc 1、创建tabs,设置BarPosition动态改变 + 2、设置preloadItens[1,3] + 3、动态切换BarPosition +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0280', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0280_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0280 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0010_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0020_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0030_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0040_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0050_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0060_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0070_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0070 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0080_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0090_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0090 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0100_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0110_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120") await Utils.sleep(1000) let driver : Driver = Driver.create(); await driver.delayMs(1000) - let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs014_001')); + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0120_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0130_001')); + await Utils.sleep(1000) + await button1.click() await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0130_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0140_001')); await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 finish.`); done() }) - /* - * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 - * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 - * @tc.desc 1、创建tabs,设置BarPosition.End 2、设置preloadItens[1,3] - */ it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150', 0, async (done: Function) => { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 start.`); - Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015") + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150") await Utils.sleep(1000) let driver : Driver = Driver.create(); await driver.delayMs(1000) - let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs015_001')); - await Utils.sleep(1000) - await button1.click() + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0150_001')); await Utils.sleep(1000) - windowSnap.snapShot() + await button.click() await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 finish.`); done() }) - /* - * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 - * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 - * @tc.desc 1、创建tabs,设置BarPosition动态改变 - 2、设置preloadItens[1,3] - 3、动态切换BarPosition - */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160', 0, async (done: Function) => { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 start.`); - Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016") + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160") await Utils.sleep(1000) let driver : Driver = Driver.create(); await driver.delayMs(1000) - let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabs016_002')); + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0160_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0160_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0170_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0170 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0180_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0190_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0190 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0200', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0200_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0200_002')); await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0210', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0210_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0210_002')); + await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0220', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsCachedCount0220_001')); await Utils.sleep(1000) - Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 finish.`); + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0220 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0230', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0230_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0230 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0240_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('发现')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0240 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0250_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('发现')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0250 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0260_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('发现')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0260 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0270', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0270_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('tabsCachedCount0270_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0270 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0300', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0300") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('tabsCachedCount0300_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0300 finish.`); done() }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets new file mode 100644 index 000000000..21df0cae8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets @@ -0,0 +1,421 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsCapabilityEnhancement() { + + describe('UIComponentNavTabsCapabilityEnhancement', () => { + 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_TABS_CAPABILITY_ENHANCEMENT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0030 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0030')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(1000) + + let tabBar5:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0030_001')); + await Utils.sleep(500) + await tabBar5.click() + await Utils.sleep(500) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0010 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0010')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(1000) + + let tabBar5:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0010_001')); + await Utils.sleep(500) + await tabBar5.click() + await Utils.sleep(500) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0010 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0040')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(500) + + await tabsCenter.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0090')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0090 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0080')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y-200) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabBar5:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tabBar5.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0100 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y-200) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + + let tabBarYellow:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tabBarYellow.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0150')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.fling({x: pos.x, y: pos.y+200},{x: pos.x, y: pos.y-200},5,4000); + await Utils.sleep(2000) + + await driver.fling({x: pos.x, y: pos.y+200},{x: pos.x, y: pos.y-200},5,4000); + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0150 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0020')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y+200, pos.x, pos.y-200); + await Utils.sleep(2000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0020 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0160')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y+200, pos.x, pos.y-200); + await Utils.sleep(2000) + await driver.swipe(pos.x, pos.y-200, pos.x, pos.y+200); + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsCapabilityEnhancement0130')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y+50, pos.x, pos.y-50); + await Utils.sleep(2000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsYellow:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tabsYellow.click() + await Utils.sleep(3000) + + let tabsBlue:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tabsBlue.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0140 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsYellow:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tabsYellow.click() + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0019', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0019 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsblue:Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await tabsblue.click() + await Utils.sleep(2000) + + let tabsgreen:Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await tabsgreen.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0019 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsblue:Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await tabsblue.click() + await Utils.sleep(2000) + + let tabsgreen:Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await tabsgreen.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0060 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsblue:Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await tabsblue.click() + await Utils.sleep(2000) + + let tabsgreen:Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await tabsgreen.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CAPABILITY_ENHANCEMENT_0070 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets index 2cf0a0742..c93a6cef0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsContentAdapt() { describe('UIComponentNavTabsContentAdapt', () => { + 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() + }) /* @@ -43,7 +57,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await tabBar1.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 finish.`); done() @@ -59,7 +73,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 finish.`); done() @@ -74,7 +88,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 finish.`); done() @@ -89,7 +103,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 finish.`); done() @@ -104,7 +118,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 finish.`); done() @@ -120,7 +134,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 finish.`); done() @@ -135,7 +149,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 finish.`); done() @@ -150,7 +164,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 finish.`); done() @@ -166,7 +180,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 finish.`); done() @@ -189,7 +203,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 finish.`); done() @@ -223,7 +237,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button4.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 finish.`); done() @@ -256,7 +270,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 finish.`); done() @@ -290,7 +304,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button4.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 finish.`); done() @@ -311,7 +325,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 finish.`); done() @@ -327,7 +341,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 finish.`); done() @@ -353,7 +367,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 finish.`); done() @@ -391,7 +405,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button5.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 finish.`); done() @@ -407,7 +421,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 finish.`); done() @@ -433,7 +447,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 finish.`); done() @@ -449,7 +463,7 @@ export default function UIComponentNavTabsContentAdapt() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 finish.`); done() @@ -473,7 +487,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 finish.`); done() @@ -497,7 +511,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 finish.`); done() @@ -521,7 +535,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 finish.`); done() @@ -545,7 +559,7 @@ export default function UIComponentNavTabsContentAdapt() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 finish.`); done() @@ -563,7 +577,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0220_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 finish.`); done() @@ -581,7 +595,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0160_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 finish.`); done() @@ -599,7 +613,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0250_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 finish.`); done() @@ -617,7 +631,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0190_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 finish.`); done() @@ -635,7 +649,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0170_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 finish.`); done() @@ -653,7 +667,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0200_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 finish.`); done() @@ -671,7 +685,7 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0230_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 finish.`); done() @@ -689,11 +703,91 @@ export default function UIComponentNavTabsContentAdapt() { let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0260_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0380 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0380 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await driver.delayMs(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0380')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y-200) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y-200,pos.x,pos.y+200) + await Utils.sleep(1000) + + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0380_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0360 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0360 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0360 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await driver.delayMs(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0360')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y-200) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y-200,pos.x,pos.y+200) + await Utils.sleep(1000) + + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0360_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0360 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0370 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await driver.delayMs(500) + + let button: Component = await driver.findComponent(ON.id('2')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0370 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets index c40fb8c18..09415a275 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsEdgeeffect() { describe('UIComponentNavTabsEdgeeffect', () => { + 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_TABS_EDGEEFFECT_0230 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 @@ -32,7 +46,7 @@ export default function UIComponentNavTabsEdgeeffect() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 finish.`); done() @@ -46,10 +60,202 @@ export default function UIComponentNavTabsEdgeeffect() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 finish.`); done() }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0200 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0200')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0200_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0200 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0190 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0190')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0190_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0170 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0170')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0170_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0220 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0220')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0220_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0210 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0210')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0210_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0180 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0180')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-100,pos.y,pos.x+200,pos.y) + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0180_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsEdgeeffect0100')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-200,pos.y,pos.x+200,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0100 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets index 48b15dd26..755b58cf2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsExpandsafearea() { describe('UIComponentNavTabsExpandsafearea', () => { + 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_TABS_EXPANDSAFEAREA_0090 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 @@ -35,7 +49,7 @@ export default function UIComponentNavTabsExpandsafearea() { // let driver: Driver = Driver.create() // let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) // await button.click() - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); done() @@ -49,7 +63,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); done() @@ -63,7 +77,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 finish.`); done() @@ -77,7 +91,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 finish.`); done() @@ -91,7 +105,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 finish.`); done() @@ -105,7 +119,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 finish.`); done() @@ -119,7 +133,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 finish.`); done() @@ -133,7 +147,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 finish.`); done() @@ -147,7 +161,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 finish.`); done() @@ -161,7 +175,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 finish.`); done() @@ -175,7 +189,7 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 finish.`); done() @@ -189,10 +203,71 @@ export default function UIComponentNavTabsExpandsafearea() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110") await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(3000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0140 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0150 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160"); + await Utils.sleep(2000); + let driver = Driver.create(); + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsExpandsafearea0160_001')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0160 finish.`); + done(); + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets index aad3189a1..3e8ebdf16 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsHeight() { describe('UIComponentNavTabsHeight', () => { + 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_TABS_HEIGHT_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 @@ -33,7 +47,7 @@ export default function UIComponentNavTabsHeight() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets index ebabf71df..6029c6f08 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsImproTrace() { describe('UIComponentNavTabsImproTrace', () => { + 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_TABS_IMPROTRACE_0150 @@ -44,7 +58,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 finish.`); done() @@ -70,7 +84,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 finish.`); done() @@ -96,7 +110,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 finish.`); done() @@ -124,7 +138,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 finish.`); done() @@ -152,7 +166,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await driver.swipe(pos.x,pos.y+250,pos.x+350,pos.y+250) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 finish.`); done() @@ -178,7 +192,7 @@ export default function UIComponentNavTabsImproTrace() { let pos = await tabsCenter.getBoundsCenter() await driver.swipe(pos.x,pos.y+250,pos.x+200,pos.y+250) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 finish.`); done() @@ -204,7 +218,7 @@ export default function UIComponentNavTabsImproTrace() { let pos = await tabsCenter.getBoundsCenter() await driver.swipe(pos.x+300,pos.y,pos.x-300,pos.y) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 finish.`); done() @@ -230,7 +244,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(1000) await tabBar.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 finish.`); done() @@ -246,7 +260,7 @@ export default function UIComponentNavTabsImproTrace() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 finish.`); done() @@ -301,7 +315,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(500) await button9.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 finish.`); done() @@ -327,7 +341,7 @@ export default function UIComponentNavTabsImproTrace() { await Utils.sleep(500) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 finish.`); done() @@ -343,12 +357,52 @@ export default function UIComponentNavTabsImproTrace() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 finish.`); done() }) + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0110_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0170_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(3000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0170')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+250,pos.y,pos.x-250,pos.y) + await Utils.sleep(2000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0170 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets index e30fe0a5a..fc4f1fe7f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsInterception() { describe('UIComponentNavTabsInterception', () => { + 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() + }) /* @@ -42,7 +57,7 @@ export default function UIComponentNavTabsInterception() { let pos = await tabsCenter.getBoundsCenter() await driver.swipe(pos.x,pos.y,pos.x-56,pos.y) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 finish.`); done() @@ -66,7 +81,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 finish.`); done() @@ -90,7 +105,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 finish.`); done() @@ -114,7 +129,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await tabBar.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 finish.`); done() @@ -138,7 +153,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 finish.`); done() @@ -161,7 +176,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 finish.`); done() @@ -191,7 +206,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 finish.`); done() @@ -232,7 +247,7 @@ export default function UIComponentNavTabsInterception() { await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 finish.`); done() @@ -260,7 +275,7 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 finish.`); done() @@ -283,12 +298,112 @@ export default function UIComponentNavTabsInterception() { await Utils.sleep(1000) await tabBar.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0020 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabBar3:Component = await driver.findComponent(ON.id('three')); + await Utils.sleep(500) + await tabBar3.click() + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0020')); + await Utils.sleep(1000) + let pos3 = await tabsCenter.getBoundsCenter() + await driver.swipe(pos3.x+100,pos3.y,pos3.x-100,pos3.y) + await Utils.sleep(1000) + + let tabBar5:Component = await driver.findComponent(ON.id('five')); + await Utils.sleep(500) + await tabBar5.click() + await Utils.sleep(500) + + let pos5 = await tabsCenter.getBoundsCenter() + await driver.swipe(pos5.x-100,pos5.y,pos5.x+100,pos5.y) + await Utils.sleep(1000) + + let tabBar1:Component = await driver.findComponent(ON.id('one')); + await Utils.sleep(500) + await tabBar1.click() + await Utils.sleep(500) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0020 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0160 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabBar3:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(500) + await tabBar3.click() + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0160')); + await Utils.sleep(1000) + let pos3 = await tabsCenter.getBoundsCenter() + await driver.swipe(pos3.x+100,pos3.y,pos3.x-100,pos3.y) + await Utils.sleep(1000) + + let tabBar0:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(500) + await tabBar0.click() + await Utils.sleep(500) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0160 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabBar3:Component = await driver.findComponent(ON.id('Green')); + await Utils.sleep(1000) + await tabBar3.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0140 finish.`); + done() + }) }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets index 826714182..f8547087e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsInterface() { describe('UIComponentNavTabsInterface', () => { + 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_TABS_INTERFACE_0120 @@ -38,7 +52,7 @@ export default function UIComponentNavTabsInterface() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 finish.`); done() @@ -68,7 +82,7 @@ export default function UIComponentNavTabsInterface() { await Utils.sleep(100) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 finish.`); done() @@ -93,11 +107,46 @@ export default function UIComponentNavTabsInterface() { let pos = await tabsCenter.getBoundsCenter() await driver.swipe(pos.x,pos.y,pos.x-100,pos.y) await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 finish.`); done() }) + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface0150_001')); + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0150 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface0170_001')); + await Utils.sleep(1000) + + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0170 finish.`); + done() + }) + + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets new file mode 100644 index 000000000..697766a31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsLayout() { + + describe('UIComponentNavTabsLayout', () => { + 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() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_LAYOUT_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_LAYOUT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsLayout0070')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-150,pos.y,pos.x+150,pos.y) + await Utils.sleep(4000) + + await driver.swipe(pos.x,pos.y,pos.x,pos.y+100) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_LAYOUT_0070 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets index 66e339f31..2d1177a13 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsMirror() { describe('UIComponentNavTabsMirror', () => { + 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() + }) /* @@ -41,7 +56,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 finish.`); done() @@ -69,7 +84,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070 finish.`); done() @@ -94,7 +109,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 finish.`); done() @@ -119,7 +134,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 finish.`); done() @@ -142,7 +157,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(500) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 finish.`); done() @@ -164,7 +179,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(500) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 finish.`); done() @@ -189,7 +204,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 finish.`); done() @@ -215,7 +230,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 finish.`); done() @@ -239,7 +254,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 finish.`); done() @@ -269,7 +284,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(100) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 finish.`); done() @@ -304,7 +319,7 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(200) await button.click() await Utils.sleep(200) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 finish.`); done() @@ -327,9 +342,9 @@ export default function UIComponentNavTabsMirror() { let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0250_001')); await Utils.sleep(1000) await button.click() - await Utils.sleep(1000) - windowSnap.snapShot() await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 finish.`); done() }) @@ -367,12 +382,196 @@ export default function UIComponentNavTabsMirror() { await Utils.sleep(1000) await button5.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0320', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0320 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0320_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0320 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('tabsMirror0190_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0190 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0200', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('tabsMirror0200_001')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0200 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0210', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('tabsMirror0210_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0220', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('tabsMirror0220_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + let tabsCenter:Component = await driver.findComponent(ON.id('tabsMirror0220')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0220 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0230', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('tabsMirror0230_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0230 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0240_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0240 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets new file mode 100644 index 000000000..90bf024df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsNest() { + + describe('UIComponentNavTabsNest', () => { + 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_COIIPONENT_NAV_TABS_NEST_0010 + * @tc.name SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0010 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsNest0010')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsNest0020')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(1000) + + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COIIPONENT_NAV_TABS_NEST_0020 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets new file mode 100644 index 000000000..f9939cdcf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets @@ -0,0 +1,434 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsObserver() { + + describe('UIComponentNavTabsObserver', () => { + 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() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0020 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button2:Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+120,pos.y,pos.x-120,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + tarBarCenter.click() + await Utils.sleep(500) + tarBarCenter.click() + await Utils.sleep(500) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0060_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0060_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0100_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+120,pos.y,pos.x-120,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0170 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0150 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+200,pos.y,pos.x-200,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0210 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0080_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0090") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0090_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0090 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0040_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0070_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0070 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0120_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0130_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBarCenter :Component = await driver.findComponent(ON.id('testId')) + await Utils.sleep(1000) + let pos = await tarBarCenter.getBoundsCenter() + await driver.swipe(pos.x+150,pos.y,pos.x-150,pos.y) + await Utils.sleep(2000) + + tarBarCenter.click() + await Utils.sleep(1000) + tarBarCenter.click() + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0050_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsObserver0050_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_OBSERVER_0050 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets new file mode 100644 index 000000000..7425d19e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets @@ -0,0 +1,68 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsOnChange() { + + describe('UIComponentNavTabsOnChange', () => { + 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() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ONCHANGE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ONCHANGE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let tarBar1 :Component = await driver.findComponent(ON.id('Blue')) + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('tabsOnChange0010')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-90,pos.x,pos.y+90) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ONCHANGE_0010 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets new file mode 100644 index 000000000..13cc5ed3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsOnWillHide() { + + describe('UIComponentNavTabsOnWillHide', () => { + 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_TABS_ONWillHide_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWillHide_0110 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWillHide_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWillHide_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWillHide_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0060 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0060')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y-50) + await Utils.sleep(1000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0060 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0160 +* @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0160 +* @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0160')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0160_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0010')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0100_002')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0190')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0190 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0070')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0070 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0080')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0080_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0040')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0020')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0150')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0150 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillHide0120')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsYellow :Component = await driver.findComponent(ON.id('Yellow')) + await Utils.sleep(1000) + await tabsYellow.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0140 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsYellow :Component = await driver.findComponent(ON.id('Yellow')) + await Utils.sleep(1000) + await tabsYellow.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('tabsOnWillhide0130_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('two')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0170 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('three')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('tabsOnWillhide0050')); + await Utils.sleep(1000) + + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-30,pos.y,pos.x+30,pos.y) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLHIDE_0050 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets index acfc595c3..d64393ea9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsOnWillShow() { describe('UIComponentNavTabsOnWillShow', () => { + 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_TABS_ONWILLSHOW_0190 @@ -44,12 +58,371 @@ export default function UIComponentNavTabsOnWillShow() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0070 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0070')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0070_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0080 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0110 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0040 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0040')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0060 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 + */ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0060')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y-50) + await Utils.sleep(1000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0060 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0150 +* @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0150 +* @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0150')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0150_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0150 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0160 +* @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0160 +* @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0160')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-356) + await Utils.sleep(1000) + + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+356) + await Utils.sleep(1000) + + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0160_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tarBar1 :Component = await driver.findComponent(ON.id('Blue')) + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tarBar1 :Component = await driver.findComponent(ON.id('two')) + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('tabsOnWillshow0050')); + await Utils.sleep(1000) + + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x-30,pos.y,pos.x+30,pos.y) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let tarBar1 :Component = await driver.findComponent(ON.id('two')) + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('tabsOnWillshow0130_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('two')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0140 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('two')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0170 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100") + await Utils.sleep(1000) + + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0100_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentNavTabsOnWillShow0100_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0100 finish.`); + done() + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets index 577359a2b..5520f61e1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsSubTabbarStyle() { describe('UIComponentNavTabsSubTabbarStyle', () => { + 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_TABS_SUBTABBARSTYLE_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 @@ -44,7 +58,7 @@ export default function UIComponentNavTabsSubTabbarStyle() { await Utils.sleep(100) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets new file mode 100644 index 000000000..f4a5ac116 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.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. + */ +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, ON } from '@ohos.UiTest' + +export default function UIComponentNavTabs() { + + describe('UIComponentNavTabs', () => { + 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_TABS_0010_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_0010_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_0010_1 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabs/UIComponentNavTabs0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let tabs: Component = await driver.findComponent(ON.id('UIComponentNavTabs0010_001')); + await Utils.sleep(1000); + let point = await tabs.getBoundsCenter(); + await driver.swipe(point.x + 200, point.y, point.x - 200, point.y); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_0010_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_0010_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_0010_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_0010_2 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabs/UIComponentNavTabs0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let tabbar: Component = await driver.findComponent(ON.text('Green')); + await tabbar.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_0010_1 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets new file mode 100644 index 000000000..14b4bfe65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets @@ -0,0 +1,437 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsUx() { + + describe('UIComponentNavTabsUx', () => { + 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_TABS_UX_022 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_UX_022 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_022', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_022 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsUx022')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(1000) + + await driver.swipe(pos.x-356,pos.y,pos.x+100,pos.y) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_022 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_019', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_019 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_019 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_003', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_003 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_003 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_004', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_004 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_004 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_005', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_005 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_005 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_007', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_007 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_007 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_008', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_008 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_008 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_009', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_009 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Red')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_009 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Red')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_011 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Red')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_011 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Red')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_012 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_013', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_013 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Red')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_013 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_014', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_014 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Tab3')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Tab2')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_014 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_015', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_015 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Tab3')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Tab2')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_015 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_016', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_016 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Tab3')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Tab2')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_016 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_017', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_017 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Tab3')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Tab2')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_017 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_NAV_TABS_UX_018', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_018 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tarBar1:Component = await driver.findComponent(ON.id('Tab3')); + await Utils.sleep(1000) + await tarBar1.click() + await Utils.sleep(3000) + + let tarBar2:Component = await driver.findComponent(ON.id('Tab2')); + await Utils.sleep(1000) + await tarBar2.click() + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_UX_018 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets index 54b79ec31..18ddd5a88 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentNavTabsWidth() { describe('UIComponentNavTabsWidth', () => { + 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() + }) /* @@ -35,7 +49,7 @@ export default function UIComponentNavTabsWidth() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 finish.`); done() diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets index a86014eb0..4919af5ec 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentOtherRefreshAbility() { describe('UIComponentOtherRefreshAbility', () => { + 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() + }) /* @@ -42,7 +56,7 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 finish.`); done() @@ -64,7 +78,7 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 finish.`); done() @@ -87,7 +101,7 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 finish.`); done() @@ -110,7 +124,7 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 finish.`); done() @@ -132,7 +146,7 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 finish.`); done() @@ -159,11 +173,144 @@ export default function UIComponentOtherRefreshAbility() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0160')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0160 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_1 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0:Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0170_002')); + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_2 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0170_001')); + await Utils.sleep(1000) + await button.click() + let refreshListItem0:Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0170_002')); + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0170_2 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0180 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0180_001')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0130 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + let button1 :Component = await driver.findComponent(ON.id('refreshAbility0130_001')) + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0140 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + let button1 :Component = await driver.findComponent(ON.id('refreshAbility0140_001')) + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0140 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0150 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + let button1 :Component = await driver.findComponent(ON.id('refreshAbility0150_001')) + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0150 finish.`); + done() + }) + + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets new file mode 100644 index 000000000..b5d51adaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets @@ -0,0 +1,300 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshAnimation() { + + describe('UIComponentOtherRefreshAnimation', () => { + 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() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0070')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0070 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0080')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0110 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0110')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0110 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0100')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0090')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0090 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0140')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(2000) + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0140 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0050')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.fling({x: pos.x, y: pos.y+400},{x: pos.x, y: pos.y},5,40000); + await Utils.sleep(2000) + await driver.fling({x: pos.x, y: pos.y+400},{x: pos.x, y: pos.y},5,40000); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0020')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y, pos.x, pos.y+300, 40000) + await driver.swipe(pos.x, pos.y+300, pos.x, pos.y+600, 200) + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0010')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y, pos.x, pos.y+300, 40000) + await driver.swipe(pos.x, pos.y+300, pos.x, pos.y+600, 200) + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0040')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y+200, pos.x, pos.y) + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0060')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y, pos.x, pos.y+200) + await Utils.sleep(4000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y+200) + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0060 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let refreshCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAnimation0030')) + await Utils.sleep(1000) + let pos = await refreshCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y, pos.x, pos.y+200) + await Utils.sleep(4000) + + Settings.createWindow("testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030") + await Utils.sleep(1000) + + let driver1 : Driver = Driver.create(); + await driver1.delayMs(1000) + + let refreshCenter1 :Component = await driver1.findComponent(ON.id('UIComponentOtherRefreshAnimation0030')) + await Utils.sleep(1000) + let pos1 = await refreshCenter.getBoundsCenter() + await driver.swipe(pos1.x, pos1.y, pos1.x, pos1.y+200) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_0THER_REFRESH_ANIMATION_0030 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets index 5982175f3..93a10ad7a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -17,13 +17,26 @@ import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' -import { Component, Driver ,ON } from '@ohos.UiTest' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' export default function UIComponentOtherRefreshInterAction() { describe('UIComponentOtherRefreshInterAction', () => { + 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() + }) /* @@ -36,15 +49,15 @@ export default function UIComponentOtherRefreshInterAction() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 start.`); Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + let driver: Driver = Driver.create(); await driver.delayMs(1000) - let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + let refreshListItem0: Component = await driver.findComponent(ON.id('0')) await Utils.sleep(200) let pos = await refreshListItem0.getBoundsCenter() await Utils.sleep(100) - await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 finish.`); done() @@ -60,15 +73,15 @@ export default function UIComponentOtherRefreshInterAction() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 start.`); Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + let driver: Driver = Driver.create(); await driver.delayMs(1000) - let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + let refreshListItem0: Component = await driver.findComponent(ON.id('0')) await Utils.sleep(200) let pos = await refreshListItem0.getBoundsCenter() await Utils.sleep(100) - await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 400) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 finish.`); done() @@ -84,15 +97,15 @@ export default function UIComponentOtherRefreshInterAction() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 start.`); Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + let driver: Driver = Driver.create(); await driver.delayMs(1000) - let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + let refreshListItem0: Component = await driver.findComponent(ON.id('0')) await Utils.sleep(200) let pos = await refreshListItem0.getBoundsCenter() await Utils.sleep(100) - await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 400) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 finish.`); done() @@ -108,18 +121,500 @@ export default function UIComponentOtherRefreshInterAction() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 start.`); Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + let driver: Driver = Driver.create(); await driver.delayMs(1000) - let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + let refreshListItem0: Component = await driver.findComponent(ON.id('0')) await Utils.sleep(200) let pos = await refreshListItem0.getBoundsCenter() await Utils.sleep(100) - await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 400) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0100')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 400) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0130')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y + 100, pos.x, pos.y); + await Utils.sleep(1000) + await driver.fling(pos, { + x: pos.x, y: pos.y + 200 + }, 5, 600) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0430 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0430 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0430', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0430 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0430')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0430 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0170 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0170')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0250 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0250 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0250 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0250')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0240 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0240 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0240')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0260 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0260 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0260')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0260 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0270 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0270 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0270', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0270')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000) + let textinput: Component = await driver.findComponent(ON.id('0')); + await textinput.inputText('abc'); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0270 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0010')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + let pointers: PointerMatrix = PointerMatrix.create(1, 10); + pointers.setPoint(0, 0, { + x: pos.x, y: pos.y + }); + pointers.setPoint(0, 1, { + x: pos.x, y: pos.y + }); + pointers.setPoint(0, 2, { + x: pos.x, y: pos.y + }); + pointers.setPoint(0, 3, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 4, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 5, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 6, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 7, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 8, { + x: pos.x, y: pos.y + 200 + }); + pointers.setPoint(0, 9, { + x: pos.x, y: pos.y + 200 + }); + await driver.injectMultiPointerAction(pointers); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0010 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0060')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 20); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0080 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0080')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0090 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterAction0090')) + await Utils.sleep(500) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0090 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0020_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0020 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0030_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-50,pos.x,pos.y+50) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0040_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0070 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0180 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0180_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-30,pos.x,pos.y+30) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0190 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0190_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-50,pos.x,pos.y+50) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0190 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0200', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0200 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0200_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0210', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0210 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0210_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0220', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0220 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshInteraction0220_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0220 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets new file mode 100644 index 000000000..c5f465451 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets @@ -0,0 +1,264 @@ +/* + * 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, ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshInterConnection() { + + describe('UIComponentOtherRefreshInterConnection', () => { + 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() + }) + + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0040 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0110 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0110 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0110_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0130_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0120 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0120 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0120 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0120_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0010_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x + 100, pos.y, pos.x - 100, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0030_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060") + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0060_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0050 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050") + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0050_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0080 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080") + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0080_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070") + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterConnection0070_001')); + await Utils.sleep(200); + let pos = await refreshListItem0.getBoundsCenter(); + await Utils.sleep(100); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERCONNECTION_0070 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets index 5243db1f0..66bd2e257 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,7 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentOtherRefreshInterface() { describe('UIComponentOtherRefreshInterface', () => { + 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() + }) @@ -44,7 +58,7 @@ export default function UIComponentOtherRefreshInterface() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 finish.`); done() @@ -67,7 +81,7 @@ export default function UIComponentOtherRefreshInterface() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 finish.`); done() @@ -91,12 +105,159 @@ export default function UIComponentOtherRefreshInterface() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 finish.`); done() }) + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterface0160')) + await Utils.sleep(1000) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0160 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0200', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshInterface0200')) + await Utils.sleep(1000) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(4000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0130 + * @tc.desc 1、Refresh的offset参数:string :'0'设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0010 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0030 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0040 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0040 finish.`); + done() + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets new file mode 100644 index 000000000..4273a8a42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshOnOffsetChange() { + + describe('UIComponentOtherRefreshOnOffsetChange', () => { + 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() + }) + + + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ONOFFSETCHANGE_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ONOFFSETCHANGE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await Utils.sleep(1000) + + let refreshCenter :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshOnOffsetChange0100')) + await Utils.sleep(1000) + let pos = await refreshCenter.getBoundsCenter() + await driver.swipe(pos.x, pos.y, pos.x, pos.y+200) + await Utils.sleep(3000) + + await driver.swipe(pos.x, pos.y+300, pos.x, pos.y, 40000) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ONOFFSETCHANGE_0100 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets index f1c73b54f..dfb5c459d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentOtherRefreshPromptText() { describe('UIComponentOtherRefreshPromptText', () => { + 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() + }) @@ -43,7 +58,7 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 finish.`); done() @@ -67,7 +82,7 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 finish.`); done() @@ -91,7 +106,7 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 finish.`); done() @@ -115,7 +130,7 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 finish.`); done() @@ -139,7 +154,7 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 finish.`); done() @@ -162,12 +177,317 @@ export default function UIComponentOtherRefreshPromptText() { await Utils.sleep(100) await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) await Utils.sleep(3000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0250 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_1 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_1 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0230_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_2 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_2 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0230_001')); + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0230_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0230_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_1 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_1 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_2 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_2 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0220_001')); + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0220_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0220_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0180 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_1 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_1 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0160_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_2 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_2 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0160_001')); + await button.click(); + await Utils.sleep(200) + let refreshListItem0: Component = await driver.findComponent(ON.id('UIComponentOtherRefreshPromptText0160_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y + 200, pos.x, pos.y) + await Utils.sleep(3000) + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0160_2 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let list1:Component = await driver.findComponent(ON.id('refreshPrompttext0010_001')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030") + await Utils.sleep(500) + let driver: Driver = Driver.create(); + await Utils.sleep(500) + + let list1:Component = await driver.findComponent(ON.id('refreshPrompttext0030_001')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y-30,pos.x,pos.y+30) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PROMPTTEXT_0030 finish.`); + done() + }) }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets new file mode 100644 index 000000000..0b406af2b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets @@ -0,0 +1,253 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentRefreshPulldownradio() { + + describe('UIComponentRefreshPulldownradio', () => { + 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_REFRESH_PULLDOWNRADIO_0130_1 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_1 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_1 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0130_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_2 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_2 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_2 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0130_001')) + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0130_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0130_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_1 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_1 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_1 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0120_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_2 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_2 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_2 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0120_001')) + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0120_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0120_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_1 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_1 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_1 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0060_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_2 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_2 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_2 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0060_001')) + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0060_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0060_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_1 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_1 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_1', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_1 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0160_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_2 + * @tc.name SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_2 + * @tc.desc +*/ + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_2', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_2 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0160_001')) + await button.click(); + await Utils.sleep(200) + let refreshListItem0 :Component = await driver.findComponent(ON.id('UIComponentRefreshPulldownradio0160_002')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADIO_0160_2 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADI0_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADI0_0140 start.`); + Settings.createWindow("testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + + let tabsCenter:Component = await driver.findComponent(ON.id('refreshPullDownradio0140_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y-100,pos.x,pos.y+100) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_REFRESH_PULLDOWNRADI0_0140 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets index 45774daa0..8a157d7fb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets @@ -55,5 +55,36 @@ export default function UIComponentScrollSwiperTeace() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_Teace_0080 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentScrollSwiperTeace0370')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+356,pos.y,pos.x-100,pos.y) + await Utils.sleep(2000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentScrollSwiperTeace0370_001')) + await Utils.sleep(1000) + button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentScrollSwiperTeace0370_002')) + await Utils.sleep(1000) + button2.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370 finish.`); + done() + }) + + }) } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets index 17371bd33..c9e99a8b5 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -22,6 +22,21 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UIComponentTabTabBarSymbol() { describe('UIComponentTabTabBarSymbol', () => { + 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() + }) /* @@ -44,7 +59,7 @@ export default function UIComponentTabTabBarSymbol() { await Utils.sleep(1000) await button2.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 finish.`); done() @@ -60,7 +75,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 finish.`); done() @@ -76,7 +91,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 finish.`); done() @@ -92,7 +107,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 finish.`); done() @@ -108,7 +123,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 finish.`); done() @@ -124,7 +139,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 finish.`); done() @@ -140,7 +155,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 finish.`); done() @@ -162,7 +177,7 @@ export default function UIComponentTabTabBarSymbol() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 finish.`); done() @@ -187,7 +202,7 @@ export default function UIComponentTabTabBarSymbol() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 finish.`); done() @@ -211,7 +226,7 @@ export default function UIComponentTabTabBarSymbol() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 finish.`); done() @@ -235,7 +250,7 @@ export default function UIComponentTabTabBarSymbol() { await Utils.sleep(1000) await button1.click() await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 finish.`); done() @@ -251,7 +266,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 finish.`); done() @@ -267,7 +282,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 finish.`); done() @@ -283,7 +298,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 finish.`); done() @@ -299,7 +314,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 finish.`); done() @@ -315,7 +330,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 finish.`); done() @@ -331,7 +346,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 finish.`); done() @@ -346,7 +361,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 finish.`); done() @@ -362,7 +377,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(2000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 finish.`); done() @@ -380,7 +395,7 @@ export default function UIComponentTabTabBarSymbol() { let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) await button.click() await Utils.sleep(2000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 finish.`); done() @@ -394,7 +409,7 @@ export default function UIComponentTabTabBarSymbol() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 finish.`); done() @@ -408,10 +423,75 @@ export default function UIComponentTabTabBarSymbol() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 start.`); Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250") await Utils.sleep(1000) - windowSnap.snapShot() + await windowSnap.snapShot() await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 finish.`); done() }) + + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0200')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+356,pos.y,pos.x-100,pos.y) + await Utils.sleep(2000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let buttonPink :Component = await driver.findComponent(ON.id('Pink')) + await Utils.sleep(1000) + await buttonPink.click() + await Utils.sleep(1000) + + let buttonBlack :Component = await driver.findComponent(ON.id('Black')) + await Utils.sleep(1000) + await buttonBlack.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button :Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0220_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0220 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets new file mode 100644 index 000000000..44689a0a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.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. + */ +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, ON } from '@ohos.UiTest' + +export default function UIComponentTabsClip() { + + describe('UIComponentTabsClip', () => { + 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_TABS_CLIP_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_CLIP_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TABS_CLIP_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_CLIP_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTabsClip/UIComponentTabsClip0020"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_CLIP_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_CLIP_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_CLIP_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TABS_CLIP_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_CLIP_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTabsClip/UIComponentTabsClip0010"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_CLIP_0010 finish.`); + done() + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index daf797ea0..a7a4c5a5c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -19,7 +19,7 @@ import windowSnap from '../model/snapShot'; import Logger from '../model/Logger'; import Utils from '../model/Utils'; import uiAppearance from '@ohos.uiAppearance'; -import { Driver ,ON } from '@ohos.UiTest' +import { Component, Driver ,ON } from '@ohos.UiTest' /* * UIComponentUISupportColor @@ -390,5 +390,115 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1060 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1060 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColor1060_001')) + await Utils.sleep(200) + await button.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1070 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1070 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColor1070_001')) + await Utils.sleep(200) + await button.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1080 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1080 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1080 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColor1080_001')) + await Utils.sleep(200) + await button.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1090 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1090 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1090 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColor1090_001')) + await Utils.sleep(200) + await button.click(); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1100 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1100 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1100 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110"); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110 finish.`); + done() + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets new file mode 100644 index 000000000..d2340ef70 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentWaterFlowFooter() { + + describe('UIComponentWaterFlowFooter', () => { + 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() + }) + + + it('SUB_ACE_UI_COMPONENT_WATERFLOW_FOOTER_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_FOOTER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentWaterFlowFooter0010_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentWaterFlowFooter0010')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_FOOTER_0010 finish.`); + done() + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets new file mode 100644 index 000000000..00b935978 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets @@ -0,0 +1,142 @@ +/* + * 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 ,ON } from '@ohos.UiTest' + +export default function UIComponentWaterFlowSliding() { + + describe('UIComponentWaterFlowSliding', () => { + 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_WATERFLOW_SLIDING_0480 +* @tc.name SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0480 +* @tc.desc 1、创建waterflow,设置为移动窗口模式布局 + 2、设置margin属性 + 3、动态改变margin +*/ + it('SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0480', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0480 start.`); + Settings.createWindow("testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentWaterFlowSliding0480_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0480 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0470 +* @tc.name SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0470 +* @tc.desc 1、创建waterflow,设置为移动窗口模式布局 + 2、设置margin属性 + 3、动态改变margin +*/ + it('SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0470', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0470 start.`); + Settings.createWindow("testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470") + await Utils.sleep(1000) + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentWaterFlowSliding0470_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0470 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0270 +* @tc.name SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0270 +* @tc.desc 1、创建waterflow,顶部设置一个单独的flowitem可以改变显隐 + 2、顶部flowitem设为visibility.none,删除末尾节点 +*/ + it('SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0270', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0270 start.`); + Settings.createWindow("testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270") + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0270 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0320', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0320 start.`); + Settings.createWindow("testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320") + await Utils.sleep(1000) + + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let waterFlowCenter:Component = await driver.findComponent(ON.id('UIComponentWaterFlowSliding0320')); + await Utils.sleep(1000) + let pos = await waterFlowCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+200,pos.x,pos.y) + await Utils.sleep(2000) + + let button:Component = await driver.findComponent(ON.id('UIComponentWaterFlowSliding0320_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_WATERFLOW_SLIDING_0320 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets new file mode 100644 index 000000000..5a3b73721 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.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 { 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 ,ON } from '@ohos.UiTest' + +export default function UIRefreshComponentContent() { + + describe('UIRefreshComponentContent', () => { + 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() + }) + + it('SUB_ACE_UI_REFRESH_COMPONENTCONTENT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_REFRESH_COMPONENTCONTENT_0030 start.`); + Settings.createWindow("testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await Utils.sleep(1000) + + let list1:Component = await driver.findComponent(ON.id('refreshComponentcontent0030_001')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y-50,pos.x,pos.y+50) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + + Logger.error('TEST', `SUB_ACE_UI_REFRESH_COMPONENTCONTENT_0030 start.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040.ets new file mode 100644 index 000000000..ddafffc2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040.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. + */ +class MyDataSource00400 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0040 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource00400 = new MyDataSource00400([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource00400(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.CONTENT_FIRST) + .height('80%') + .width('100%'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050.ets new file mode 100644 index 000000000..2a305b1c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050.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. + */ +class MyDataSource0050 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0050 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0050 = new MyDataSource0050([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0050(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.CONTENT_FIRST) + .height('80%') + .width('100%'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060.ets new file mode 100644 index 000000000..e1a573f97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060.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. + */ +class MyDataSource0060 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0060 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0060 = new MyDataSource0060([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0060(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.ACTION_FIRST) + .height('80%') + .width('auto'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('auto') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070.ets new file mode 100644 index 000000000..a00d525bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070.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. + */ +class MyDataSource0070 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0070 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0070 = new MyDataSource0070([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0070(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.ACTION_FIRST) + .height('80%') + .width('auto'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080.ets new file mode 100644 index 000000000..767625910 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080.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. + */ +class MyDataSource0080 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0080 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0080 = new MyDataSource0080([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0080(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.NO_ANIMATION) + .height('80%') + .width('100%'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090.ets new file mode 100644 index 000000000..07fd300e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090.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. + */ +class MyDataSource0090 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0090 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0090 = new MyDataSource0090([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0090(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(AnimationMode.ACTION_FIRST) + .height('auto') + .width('auto'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('auto') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100.ets new file mode 100644 index 000000000..47d8d8f27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100.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. + */ +class MyDataSource0100 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0100 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0100 = new MyDataSource0100([]) + + aboutToAppear(): void { + for (let i = 0; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0100(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(null) + .height('80%') + .width('100%'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110.ets new file mode 100644 index 000000000..3d10e9161 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110.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. + */ +class MyDataSource0110 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct ArkUIAnimatedResponse0110 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0; + @State color1: Color[] = [Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green,Color.Red, Color.Blue, Color.Green, Color.Yellow]; + private list: number[] = []; + @State msgInfo: string = 'no TabContentMarkRenderDone'; + private tabsController: TabsController = new TabsController() + private swiperController: SwiperController = new SwiperController() + private swiperData: MyDataSource0110 = new MyDataSource0110([]) + + aboutToAppear(): void { + for (let i = 1; i <= 9; i++) { + this.list.push(i); + } + this.swiperData = new MyDataSource0110(this.list) + } + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('20%').id(name); + } + + build() { + Column() { + Text(this.msgInfo); + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController, index:6 }) { + ForEach(this.list, (index: number) => { + TabContent().tabBar(this.tabBuilder(index, 'tab' + this.list[index])).backgroundColor(this.color1[index]); + }) + } + .onTabBarClick((index: number) => { + this.currentIndex = index + this.swiperController.changeIndex(index, true) + }) + .barMode(BarMode.Scrollable) + .backgroundColor('#F1F3F5') + .animationMode(null) + .height('80%') + .width('100%'); + + + Swiper(this.swiperController) { + LazyForEach(this.swiperData, (item: string) => { + Text(item.toString()) + .onAppear(() => { + console.info('onAppear ' + item.toString()) + }) + .onDisAppear(() => { + console.info('onDisAppear ' + item.toString()) + }) + .width('100%') + .height('100%') + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .loop(false) + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { + this.currentIndex = targetIndex + this.tabsController.changeIndex(targetIndex) + }); + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737.ets new file mode 100644 index 000000000..bcb898778 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737.ets @@ -0,0 +1,165 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct FunctionJichuWaterFlow0350737 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + @Builder + itemFoot() { + Column() { + Text('Footer123') + .fontSize(100) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ footer: this.itemFoot(), scroller: this.scroller, sections: this.sections ,layoutMode:1}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0470') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142.ets new file mode 100644 index 000000000..f7f6ab8a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142.ets @@ -0,0 +1,165 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct FunctionJichuWaterFlow0350737142 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + @Builder + itemFoot() { + Column() { + Text('Footer123') + .fontSize(100) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ footer: this.itemFoot(), scroller: this.scroller, sections: this.sections ,layoutMode:3}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0470') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380.ets new file mode 100644 index 000000000..522e853f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380.ets @@ -0,0 +1,96 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct FunctionJichuWaterFlow0380 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State sections: WaterFlowSections = new WaterFlowSections() + @State isFullScreen: boolean = false + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State speed: number = 0 + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('change speed') + .id('FunctionJichuWaterFlow0380_001') + .onClick(()=>{ + this.speed = 20; + }) + Button('top') + .id('FunctionJichuWaterFlow0380_002') + .onClick(()=>{ + this.scroller.scrollEdge(Edge.Top) + }) + WaterFlow({ scroller: this.scroller, layoutMode: WaterFlowLayoutMode.ALWAYS_TOP_DOWN }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Red) + }, (item: string) => item) + } + .flingSpeedLimit(this.speed) + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/WaterFlowDataSource.ets new file mode 100644 index 000000000..2d6f4b1ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/WaterFlowDataSource.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060.ets new file mode 100644 index 000000000..1924563dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060.ets @@ -0,0 +1,182 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +import image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentListAndGridWaterSections0060 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number = 1 + @State bool:boolean=true + // @State layoutMode1:number=1 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + + Column({ space: 2 }) { + Scroll() { + Column() { + Row(){ + Button('默认布局').height(40).onClick(() => { + this.layoutMode1 = 0 + }) + Button('移动窗口布局').height(40).onClick(() => { + this.layoutMode1 = 1 + + }).id('UIComponentListAndGridWaterSections0060_001'); + + } + Row(){ + Button('单独节点显隐:'+`${this.visibilitys[this.Visibilitynum%3]}`) + .onClick((event: ClickEvent) => { + this.Visibilitynum++ + }) + Button("footer显隐:"+this.flag ) + .onClick(() => { + this.flag=!this.flag + }).id('UIComponentListAndGridWaterSections0060_002'); + } + } + } .border({width:1}).margin({left:2}) + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(this.visibilitys[this.Visibilitynum%3]); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.img2')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(this.colors[item % 5]) + }, (item: string, index: number) => item + index+Math.random()) + } + .id('UIComponentListAndGridWaterSections0060') + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Black) + .width(350) + .height('40%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430.ets new file mode 100644 index 000000000..510f4779e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0430 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollToIndex+5') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START) + }).id('UIComponentListAndGridWaterSections0430_001') + .margin({ top: 10, left: 20 }); + Button('scrollToIndex+0') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(0, false, ScrollAlign.START) + }).id('UIComponentListAndGridWaterSections0430_002') + .margin({ top: 10, left: 20 }); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0430') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440.ets new file mode 100644 index 000000000..eea2e813c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440.ets @@ -0,0 +1,167 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0440 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollPage + next Page') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }).id('UIComponentListAndGridWaterSections0440_001') + .margin({ top: 10, left: 20 }); + Button('scrollPage + back Page') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: false }); + }).id('UIComponentListAndGridWaterSections0440_002') + .margin({ top: 10, left: 20 }) + + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0440') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450.ets new file mode 100644 index 000000000..0173af524 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450.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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0450 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State yOffset: number=0; + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollTo+100') + .height('5%') + .onClick(() => { + this.yOffset = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: this.yOffset + 100 }); + }).id('UIComponentListAndGridWaterSections0450_001') + .margin({ top: 10, left: 20 }); + + Button('scrollTo-100') + .height('5%') + .onClick(() => { + this.scroller.scrollTo({ xOffset: 0, yOffset: this.yOffset }); + }).id('UIComponentListAndGridWaterSections0450_002') + .margin({ top: 10, left: 20 }) + + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0450') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460.ets new file mode 100644 index 000000000..623ce0a63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460.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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0460 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State yOffset: number=0; + @State xOffset: number=0; + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollEdge Edge.Bottom') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom); + }).id('UIComponentListAndGridWaterSections0460_001') + .margin({ top: 10, left: 20 }); + + Button('scrollEdge Edge.Top') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }).id('UIComponentListAndGridWaterSections0460_002') + .margin({ top: 10, left: 20 }); + + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0460') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470.ets new file mode 100644 index 000000000..4f467ee14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0470 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollToIndex+5') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START, { extraOffset: LengthMetrics.vp(5) }) + }).id('UIComponentListAndGridWaterSections0470_001') + .margin({ top: 10, left: 20 }); + Button('scrollToIndex+0') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(0, false, ScrollAlign.START, { extraOffset: LengthMetrics.vp(5) }) + }).id('UIComponentListAndGridWaterSections0470_002') + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections ,layoutMode:1}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0470') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480.ets new file mode 100644 index 000000000..0776a25a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480.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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0480 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollPage+Page') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }).id('UIComponentListAndGridWaterSections0480_001') + .margin({ top: 10, left: 20 }); + Button('scrollPage-Page') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: false }); + }).id('UIComponentListAndGridWaterSections0480_002') + .margin({ top: 10, left: 20 }); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections ,layoutMode:1}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0480') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490.ets new file mode 100644 index 000000000..d9f6d39a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0490 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('scrollEdge Edge.Bottom') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom); + }).id('UIComponentListAndGridWaterSections0490_001') + .margin({ top: 10, left: 20 }) + Button('scrollEdge Edge.Top') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }).id('UIComponentListAndGridWaterSections0490_002') + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections,layoutMode:1 }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .id('UIComponentListAndGridWaterSections0490') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550.ets new file mode 100644 index 000000000..30bd10cef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridWaterSections0550 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State newPosition: Position = {x:100,y:100} + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .offset(this.newPosition) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580.ets new file mode 100644 index 000000000..5348ca99e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580.ets @@ -0,0 +1,193 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource1' +import { LengthMetrics } from '@kit.ArkUI' + +import image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentListAndGridWaterSections0580 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State onscrollIndexInfo: string = '' + @State textvisibility: Visibility = Visibility.Visible; + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number|undefined|null=0 + @State bool:boolean=true + //@State layoutMode1:number=0 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + + Column({ space: 2 }) { + Scroll() { + Column() { + Row(){ + Button('默认布局').height(40).onClick(() => { + this.layoutMode1 = 0 + }) + Button('移动窗口布局').height(40).onClick(() => { + this.layoutMode1 = 1 + + }).id('UIComponentListAndGridWaterSections0580_001'); + + } + Row(){ + Button('单独节点显隐:'+`${this.visibilitys[this.Visibilitynum%3]}`) + .onClick((event: ClickEvent) => { + this.Visibilitynum++ + }); + Button("footer显隐:"+this.flag ) + .onClick(() => { + this.flag=!this.flag + }); + Button("Text隐藏" ) + .onClick(() => { + this.textvisibility = Visibility.Hidden; + }).id('UIComponentListAndGridWaterSections0580_002'); + } + Row(){ + Text(this.onscrollIndexInfo).visibility(this.textvisibility) + } + + } + } .border({width:1}).margin({left:2}) + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(Visibility.None); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.img2')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(this.colors[item % 5]) + }, (item: string, index: number) => item + index+Math.random()) + } + .id('UIComponentListAndGridWaterSections0580') + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '+last:' + last); + this.onscrollIndexInfo='onScrollIndex-' + 'first:' + first + '+last:' + last; + }) + .backgroundColor(Color.Black) + .width(350) + .height('40%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource.ets new file mode 100644 index 000000000..2d6f4b1ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource1.ets new file mode 100644 index 000000000..1b7ef412b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/WaterFlowDataSource1.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141.ets new file mode 100644 index 000000000..7b79dbbd1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141.ets @@ -0,0 +1,96 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State sections: WaterFlowSections = new WaterFlowSections() + @State isFullScreen: boolean = false + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State mode:number = 0; + @State row:string = '1fr 1fr 1fr'; + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('change mode') + .id('UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141_001') + .onClick((event: ClickEvent) => { + this.mode = 1; + }) + Button('change row') + .id('UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141_002') + .onClick((event: ClickEvent) => { + this.row = '1fr 1fr'; + }) + WaterFlow({ scroller: this.scroller, layoutMode: this.mode }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Blue) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate(this.row) + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624.ets new file mode 100644 index 000000000..4740ad84a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624.ets @@ -0,0 +1,84 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State sections: WaterFlowSections = new WaterFlowSections() + @State isFullScreen: boolean = false + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller, layoutMode: WaterFlowLayoutMode.ALWAYS_TOP_DOWN }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Blue) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824.ets new file mode 100644 index 000000000..e0dfb0fc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824.ets @@ -0,0 +1,84 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State sections: WaterFlowSections = new WaterFlowSections() + @State isFullScreen: boolean = false + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller, layoutMode: -1 }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Blue) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/WaterFlowDataSource.ets new file mode 100644 index 000000000..eff87786a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/WaterFlowDataSource.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211.ets new file mode 100644 index 000000000..574063ebb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211.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. + */ + +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +import { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListAndGridWaterflowSections0460211 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State sections: WaterFlowSections = new WaterFlowSections() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State isFullScreen: boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('splice') + .id('UIComponentListAndGridWaterflowSections0460211_002') + .height('5%') + .onClick(() => { + let totalCount: number = this.dataSource.totalCount() + let newSection: SectionOptions = { + itemsCount: totalCount, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + let oldLength: number = this.sections.length() + this.sections.splice(0, oldLength, [newSection]) + }) + .margin({ top: 10, left: 20 }) + Button("横竖屏切换") + .id('UIComponentListAndGridWaterflowSections0460211_001') + .onClick(() => { + this.horVerSwitch(); + }) + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Blue) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/WaterFlowDataSource.ets new file mode 100644 index 000000000..eff87786a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSections/WaterFlowDataSource.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660.ets new file mode 100644 index 000000000..9709c2a17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource2' + +@Entry +@Component +struct UIComponentListAndGridWaterflowSpring0150660 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number = 1 + @State bool:boolean=true + // @State layoutMode1:number=1 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + Column({ space: 2 }) { + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(this.visibilitys[this.Visibilitynum%3]); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Grey) + }, (item: string, index: number) => item + index+Math.random()) + } + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Transparent) + .width(350) + .height('60%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721.ets new file mode 100644 index 000000000..1bffc6e46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721.ets @@ -0,0 +1,142 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridWaterflowSpring0180721 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number = 1 + @State bool:boolean=true + // @State layoutMode1:number=1 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + Column({ space: 2 }) { + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(50) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(this.visibilitys[this.Visibilitynum%3]); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string, index: number) => item + index+Math.random()) + } + .id('UIComponentListAndGridWaterflowSpring0180721_001') + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Transparent) + .width(350) + .height('60%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290.ets new file mode 100644 index 000000000..300b9a2a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290.ets @@ -0,0 +1,154 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridWaterflowSpring0250290 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number = 1 + @State bool:boolean=true + // @State layoutMode1:number=1 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + Column({ space: 2 }) { + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(this.visibilitys[this.Visibilitynum%3]); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.img2')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Pink) + }, (item: string, index: number) => item + index+Math.random()) + } + .padding(this.fatherPadding) + .layoutDirection(FlexDirection.RowReverse) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Black) + .width(350) + .height('60%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource.ets new file mode 100644 index 000000000..fb2bcd7aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource2.ets new file mode 100644 index 000000000..f95647ac1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterflowSpring/WaterFlowDataSource2.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 15; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711.ets new file mode 100644 index 000000000..426849c5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource'; +import Curves from '@ohos.curves'; + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0510711 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + Button('scrollTo') + .id('UIComponentListAndGridXommonOnscroll0510711_001') + .onClick(()=>{ + let curve: Curve | ICurve = Curves.interpolatingSpring(10, 1, 228, 30); + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: { duration: 1000, curve: curve } }) + }) + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0510711_002') + .onClick(()=>{ + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136.ets new file mode 100644 index 000000000..28957bad4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0530136 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + + Button('scrollToIndex') + .id('UIComponentListAndGridXommonOnscroll0530136_001') + .onClick(() => { + this.scroller.scrollToIndex(10) + }) + + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0530136_002') + .onClick(()=>{ + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791.ets new file mode 100644 index 000000000..82ce3bf87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791.ets @@ -0,0 +1,127 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0540791 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + Button('scrollToIndex') + .id('UIComponentListAndGridXommonOnscroll0540791_001') + .onClick(()=>{ + this.scroller.scrollToIndex(10) + }) + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0540791_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659.ets new file mode 100644 index 000000000..514dd23de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659.ets @@ -0,0 +1,127 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0550659 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + Button('scrollBy') + .id('UIComponentListAndGridXommonOnscroll0550659_001') + .onClick(()=>{ + this.scroller.scrollBy(0,100); + }) + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0550659_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601.ets new file mode 100644 index 000000000..4915383d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0560601 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + + Button('scrollPage') + .id('UIComponentListAndGridXommonOnscroll0560601_001') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }) + + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0560601_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768.ets new file mode 100644 index 000000000..7e4b7fe3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768.ets @@ -0,0 +1,128 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0570768 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0570768_001') + .onClick(()=>{ + this.scroller.scrollEdge(Edge.Bottom); + }) + + Button('scrollEdge') + .id('UIComponentListAndGridXommonOnscroll0570768_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459.ets new file mode 100644 index 000000000..358d43603 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459.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. + */ +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListAndGridXommonOnscroll0680459 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + @State willScoll: string = ''; + @State didScoll: string = ''; + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize); + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Column() { + Text('onWillScroll handler: ' + this.willScoll) + Text('onDidScroll handler: ' + this.didScoll) + } + + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(40) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .animation({ + duration: 1200, + curve: Curve.Friction, + delay: 500, + playMode: PlayMode.Alternate, + expectedFrameRateRange: { + min: 20, + max: 120, + expected: 90, + } + }) + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onWillScroll(() => { + this.willScoll = 'onWillScroll succ'; + }) + .onDidScroll(() => { + this.didScoll = 'onDidScroll succ'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/WaterFlowDataSource.ets new file mode 100644 index 000000000..2d6f4b1ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridXommonOnscroll/WaterFlowDataSource.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380.ets new file mode 100644 index 000000000..2a1d9a3c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380.ets @@ -0,0 +1,97 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0080380 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollIndex: string = ''; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollIndex((first, last) => { + console.log(`renyj+${first},${last}`) + this.onScrollIndex = '' + first + last; + }) + + Text('onScrollIndex:' + this.onScrollIndex) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043.ets new file mode 100644 index 000000000..7c35e37b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043.ets @@ -0,0 +1,97 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0090043 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollIndex: string = ''; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollIndex((first, last) => { + console.log(`renyj+${first},${last}`) + this.onScrollIndex = '' + first + last; + }) + + Text('onScrollIndex:' + this.onScrollIndex) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890.ets new file mode 100644 index 000000000..315be1f88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890.ets @@ -0,0 +1,102 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0180890 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollIndex: string = ''; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('scrollToIndex') + .id('UIComponentListandgridWaterflowEventenhancement0180890_001') + .onClick(()=>{ + this.scroller.scrollPage({ next: true }); + }) + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollIndex((first, last) => { + console.log(`renyj+${first},${last}`) + this.onScrollIndex = '' + first + last; + }) + + Text('onScrollIndex:' + this.onScrollIndex) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448.ets new file mode 100644 index 000000000..10f975379 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448.ets @@ -0,0 +1,95 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0200448 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStart: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onScrollStart(() => { + this.onScrollStart = 'onScrollStart succ' + }) + Text('onScrollStart:' + this.onScrollStart) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655.ets new file mode 100644 index 000000000..b80d93fd1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655.ets @@ -0,0 +1,95 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0230655 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStart: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStart(() => { + this.onScrollStart = 'onScrollStart succ' + }) + Text('onScrollStart:' + this.onScrollStart) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733.ets new file mode 100644 index 000000000..e31d2fef3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733.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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0240733 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStart: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('scrollToIndex') + .id('UIComponentListandgridWaterflowEventenhancement0240733_001') + .onClick(()=>{ + this.scroller.scrollToIndex(20); + }) + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStart(() => { + this.onScrollStart = 'onScrollStart succ' + }) + Text('onScrollStart:' + this.onScrollStart) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294.ets new file mode 100644 index 000000000..4b0ec6fa0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294.ets @@ -0,0 +1,95 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0250294 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStop: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStop(() => { + this.onScrollStop = 'onScrollStop succ'; + }) + Text('onScrollStop:' + this.onScrollStop) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114.ets new file mode 100644 index 000000000..8d5e0bc09 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114.ets @@ -0,0 +1,95 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0280114 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStop: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStop(() => { + this.onScrollStop = 'onScrollStop succ'; + }) + Text('onScrollStop:' + this.onScrollStop) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143.ets new file mode 100644 index 000000000..4d8967f9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143.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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0290143 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStop: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('scrollToIndex') + .id('UIComponentListandgridWaterflowEventenhancement0290143_001') + .onClick(()=>{ + this.scroller.scrollToIndex(20); + }) + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStop(() => { + this.onScrollStop = 'onScrollStop succ'; + }) + Text('onScrollStop:' + this.onScrollStop) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets new file mode 100644 index 000000000..c320e2c7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets @@ -0,0 +1,95 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource'; + +@Entry +@Component +struct UIComponentListandgridWaterflowEventenhancement0300527 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State onScrollStop: string = '' + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.icon")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Pink) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('60%') + .onScrollStop(() => { + this.onScrollStop = 'onScrollStop succ'; + }) + Text('onScrollStop:' + this.onScrollStop) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/WaterFlowDataSource.ets new file mode 100644 index 000000000..eff87786a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/WaterFlowDataSource.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabs/UIComponentNavTabs0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabs/UIComponentNavTabs0010.ets new file mode 100644 index 000000000..dea2d8413 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabs/UIComponentNavTabs0010.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 webview from '@ohos.web.webview'; + +@Entry +@Component +struct UIComponentNavTabs0010 { + controller: webview.WebviewController = new webview.WebviewController(); + + build() { + Column({ space: 5 }) { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column() { + Web({ src: $rawfile("index.html"), controller: this.controller, incognitoMode: true }) + }.width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink')); + + TabContent() { + Column() { + Web({ src: $rawfile("index.html"), controller: this.controller, incognitoMode: true }) + }.width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow')); + + TabContent() { + Column() { + Web({ src: $rawfile("index.html"), controller: this.controller, incognitoMode: true }) + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue')); + + TabContent() { + Column() { + Web({ src: $rawfile("index.html"), controller: this.controller, incognitoMode: true }) + }.width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green')); + + } + .id('UIComponentNavTabs0010_001') + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090.ets new file mode 100644 index 000000000..fb34207b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090.ets @@ -0,0 +1,95 @@ +/* + * 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 itemType0090 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAction0090 { + @State data: itemType0090[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + private durationList: number[] = [] + private timeoutList: number[] = [] + private customContentTransition: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + } + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition + return tabContentAnimatedTransition + } + + aboutToAppear(): void { + let duration = 1000 + let timeout = 1000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration * i) + this.timeoutList.push(timeout * i) + } + } + + build() { + Column() { + Tabs() { + ForEach(this.data, (item: itemType0090, index: number) => { + TabContent() { + } + .tabBar(new SubTabBarStyle(item.text).id(item.text)) + .backgroundColor(item.backgroundColor) + // 自定义动画变化透明度、缩放页面等 + .opacity(this.opacityList[index]) + .scale({ x: this.scaleList[index], y: this.scaleList[index] }) + }) + } + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .id('UIComponentNavTabsAction0090') + .customContentTransition(this.customContentTransition); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130.ets new file mode 100644 index 000000000..491b70aea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130.ets @@ -0,0 +1,84 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsAction0130 { + @State currentIndex: number = 0; + @State infoMsg: string = ''; + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsAction0130'); + Text('' + this.infoMsg).id('tabsAction0130_003') + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + this.infoMsg='add success'; + }).id('tabsAction0130_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex += 1; + }).id('tabsAction0130_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140.ets new file mode 100644 index 000000000..5da972a07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140.ets @@ -0,0 +1,82 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsAction0140 { + @State currentIndex: number = 0; + @State infoMsg: string = ''; + @State simpleList: Array = ['1','2','3','4']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsAction0140'); + Text('' + this.infoMsg).id('tabsAction0140_003') + Button('delTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + this.simpleList.pop(); + this.infoMsg='del success'; + }).id('tabsAction0140_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex += 1; + }).id('tabsAction0140_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180.ets new file mode 100644 index 000000000..b3874ea69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180.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. + */ +class A { + text: string = '' + num: number = 0 +} + +@Entry +@Component +struct UIComponentNavTabsAction0180 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State msgInfo: string = '' + @Builder + NavigationTitle() { + Column() { + Text('Navigation Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + }.alignItems(HorizontalAlign.Start) + } + + + build() { + Column() { + Navigation() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo=this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo=this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + + } + .id('UIComponentNavTabsAction0180') + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('90%') + .height('50%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + } + .title(this.NavigationTitle) + .titleMode(NavigationTitleMode.Mini) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel); + }); + }.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/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003.ets new file mode 100644 index 000000000..9d397a7d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003.ets @@ -0,0 +1,154 @@ +/* + * 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 itemType003 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAnimated003 { + @State data: itemType003[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State changeIndex: number = 0; + private tabsController: TabsController = new TabsController() + @State msgInfo: string = '' + private durationList: number[] = [] + private timeoutList: number[] = [] + private baseCustomAnination: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + this.msgInfo='from ' + from + ' to ' + to; + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 300 + let timeout = 2000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration ) + this.timeoutList.push(timeout ) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink').selectedMode(this.selectedMode)).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green').selectedMode(this.selectedMode)).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.baseCustomAnination) + .onTabBarClick((index: number) => { + //this.msgInfo = 'trigger onTabBarClick' + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // this.msgInfo = 'trigger onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + //this.msgInfo = 'trigger onAnimationEnd' + }) + .onChange((index: number) => { + // this.msgInfo = 'trigger onChange' + }) + .id('UIComponentNavTabsAnimated003'); + + Text(this.msgInfo); + + Button('BOARDMode') + .onClick(() => { + if (this.selectedMode == SelectedMode.INDICATOR) { + this.selectedMode = SelectedMode.BOARD; + } + else { + this.selectedMode = SelectedMode.INDICATOR; + } + this.changeIndex++; + if(this.changeIndex>=4) + { + this.changeIndex=0; + } + this.msgInfo = 'trigger changeIndex' + this.changeIndex; + this.tabsController.changeIndex(this.changeIndex); + }).id('UIComponentNavTabsAnimated003_001'); + Button('clear') + .onClick(() => { + this.msgInfo = ''; + }).id('UIComponentNavTabsAnimated003_002'); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005.ets new file mode 100644 index 000000000..d30e4c569 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005.ets @@ -0,0 +1,154 @@ +/* + * 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 itemType005 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAnimated005 { + @State data: itemType005[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State changeIndex: number = 0; + private tabsController: TabsController = new TabsController() + @State msgInfo: string = '' + private durationList: number[] = [] + private timeoutList: number[] = [] + private baseCustomAnination: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + this.msgInfo='from ' + from + ' to ' + to; + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 300 + let timeout = 2000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration ) + this.timeoutList.push(timeout ) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink').selectedMode(this.selectedMode)).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green').selectedMode(this.selectedMode)).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.baseCustomAnination) + .onTabBarClick((index: number) => { + //this.msgInfo = 'trigger onTabBarClick' + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // this.msgInfo = 'trigger onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + //this.msgInfo = 'trigger onAnimationEnd' + }) + .onChange((index: number) => { + // this.msgInfo = 'trigger onChange' + }) + .id('UIComponentNavTabsAnimated005'); + + Text(this.msgInfo); + + Button('BOARDMode') + .onClick(() => { + if (this.selectedMode == SelectedMode.INDICATOR) { + this.selectedMode = SelectedMode.BOARD; + } + else { + this.selectedMode = SelectedMode.INDICATOR; + } + this.changeIndex++; + if(this.changeIndex>=4) + { + this.changeIndex=0; + } + this.msgInfo = 'trigger changeIndex' + this.changeIndex; + this.tabsController.changeIndex(this.changeIndex); + }).id('UIComponentNavTabsAnimated005_001'); + Button('clear') + .onClick(() => { + this.msgInfo = ''; + }).id('UIComponentNavTabsAnimated005_002'); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007.ets new file mode 100644 index 000000000..e8c5fdb62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007.ets @@ -0,0 +1,141 @@ +/* + * 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 itemType007 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAnimated007 { + @State data: itemType007[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State msgInfo: string = '' + private durationList: number[] = [] + private timeoutList: number[] = [] + private baseCustomAnination: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + this.msgInfo='from ' + from + ' to ' + to; + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 3000 + let timeout = 5000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration * i) + this.timeoutList.push(timeout * i) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink').selectedMode(this.selectedMode)).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green').selectedMode(this.selectedMode)).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.baseCustomAnination) + .onTabBarClick((index: number) => { + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + }) + .onChange((index: number) => { + }).id('UIComponentNavTabsAnimated007'); + + Text(this.msgInfo); + + Button('BOARDMode') + .onClick(()=>{ + if(this.selectedMode == SelectedMode.INDICATOR) { + this.selectedMode = SelectedMode.BOARD; + } + else + { + this.selectedMode = SelectedMode.INDICATOR; + } + }).id('UIComponentNavTabsAnimated007_001'); + Button('clear') + .onClick(()=>{ + this.msgInfo=''; + }).id('UIComponentNavTabsAnimated007_002'); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012.ets new file mode 100644 index 000000000..c54e833f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012.ets @@ -0,0 +1,132 @@ +/* + * 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 itemType012 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAnimated012 { + @State data: itemType012[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State msgInfo: string = '' + private durationList: number[] = [] + private timeoutList: number[] = [] + private customContentTransition: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + this.msgInfo='trigger finishTransition' + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + this.msgInfo='trigger customContentTransition'; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 3000 + let timeout = 5000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration * i) + this.timeoutList.push(timeout * i) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')).opacity(this.opacityList[2]) + .scale({ x: this.scaleList[2], y: this.scaleList[2] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.customContentTransition) + .onTabBarClick((index: number) => { + this.msgInfo='trigger onTabBarClick' + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.msgInfo='trigger onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.msgInfo='trigger onAnimationEnd' + }) + .onChange((index: number) => { + this.msgInfo='trigger onChange' + }).id('UIComponentNavTabsAnimated012'); + Text(this.msgInfo); + Button('clear') + .onClick(()=>{ + this.msgInfo=''; + }).id('UIComponentNavTabsAnimated012_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015.ets new file mode 100644 index 000000000..4715fc6f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015.ets @@ -0,0 +1,142 @@ +/* + * 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 itemType015 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsAnimated015 { + @State data: itemType015[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State msgInfo: string = '' + @State height1: string = '100%' + @State width1: string = '100%' + private durationList: number[] = [] + private timeoutList: number[] = [] + private customContentTransition: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + this.msgInfo='trigger finishTransition' + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + this.msgInfo='trigger customContentTransition'; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 3000 + let timeout = 5000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration * i) + this.timeoutList.push(timeout * i) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')).opacity(this.opacityList[2]) + .scale({ x: this.scaleList[2], y: this.scaleList[2] }); + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.customContentTransition) + .onChange((index: number) => { + this.msgInfo='trigger onChange' + }).id('UIComponentNavTabsAnimated015'); + + Button('change width/height') + .onClick(()=>{ + if(this.width1 == '100%') + { + this.width1 = '80%'; + } + else + { + this.width1 = '100%'; + } + + if(this.height1 == '100%') + { + this.height1 = '80%'; + } + else + { + this.height1 = '100%'; + } + + }).id('UIComponentNavTabsAnimated015_001'); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037.ets new file mode 100644 index 000000000..d9e57d4a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037.ets @@ -0,0 +1,237 @@ +/* + * 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 UIComponentNavTabsBlurStyle0037 { + private controller: TabsController = new TabsController() + @State indicatorColor: Color = Color.Yellow; + @State indicatorWidth: number = 40; + @State indicatorHeight: number = 10; + @State indicatorBorderRadius: number = 5; + @State indicatorSpace: number = 10; + @State subTabBorderRadius: number = 20; + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private colorFlag: boolean = true; + private widthFlag: boolean = true; + private heightFlag: boolean = true; + private borderFlag: boolean = true; + private spaceFlag: boolean = true; + + build() { + Column() { + Button("下划线颜色变化").width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.colorFlag) { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorColor = Color.Red + }) + } else { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorColor = Color.Yellow + }) + } + this.colorFlag = !this.colorFlag + }).id('UIComponentNavTabsBlurStyle0037_001'); + Button("下划线高度变化").width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.heightFlag) { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorHeight = 20 + }) + } else { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorHeight = 10 + }) + } + this.heightFlag = !this.heightFlag + }).id('UIComponentNavTabsBlurStyle0037_002'); + Button("下划线宽度变化").width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.widthFlag) { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorWidth = 30 + }) + } else { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorWidth = 50 + }) + } + this.widthFlag = !this.widthFlag + }).id('UIComponentNavTabsBlurStyle0037_003'); + Button("下划线圆角半径变化").width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.borderFlag) { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorBorderRadius = 0 + }) + } else { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorBorderRadius = 5 + }) + } + this.borderFlag = !this.borderFlag + }).id('UIComponentNavTabsBlurStyle0037_004'); + Button("下划线间距变化").width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.spaceFlag) { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorSpace = 20 + }) + } else { + animateTo({ + duration: 1000, // 动画时长 + curve: Curve.Linear, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.indicatorSpace = 10 + }) + } + this.spaceFlag = !this.spaceFlag + }).id('UIComponentNavTabsBlurStyle0037_005'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink).borderRadius('12vp') + }.tabBar(SubTabBarStyle.of('Pink') + .indicator({ + color: this.indicatorColor, //下划线颜色 + height: this.indicatorHeight, //下划线高度 + width: this.indicatorWidth, //下划线宽度 + borderRadius: this.indicatorBorderRadius, //下划线圆角半径 + marginTop: this.indicatorSpace //下划线与文字间距 + }) + .selectedMode(this.selectedMode) + .board({ borderRadius: this.subTabBorderRadius }) + .labelStyle({}) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink).borderRadius('12vp') + }.tabBar(SubTabBarStyle.of('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue).borderRadius('12vp') + }.tabBar(SubTabBarStyle.of('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green).borderRadius('12vp') + }.tabBar(SubTabBarStyle.of('Green')); + } + .vertical(false) + .scrollable(true) + .barHeight(140) + .barMode(BarMode.Fixed) + .animationDuration(400) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height(320) + .id('UIComponentNavTabsBlurStyle0037'); + }.width('100%').height(250).padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010.ets new file mode 100644 index 000000000..234f4acf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010.ets @@ -0,0 +1,141 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0010 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + ////Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + ////Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + ////Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + ////Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: []') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0010_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020.ets new file mode 100644 index 000000000..ba68b23fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020.ets @@ -0,0 +1,141 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0020 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [-1]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([-1]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0020_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030.ets new file mode 100644 index 000000000..d049aefc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030.ets @@ -0,0 +1,141 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0030 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [null]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([null]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0030_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040.ets new file mode 100644 index 000000000..1aa288a9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040.ets @@ -0,0 +1,142 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0040 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo='preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0040_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050.ets new file mode 100644 index 000000000..163f064b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0050 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,2,4,5]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,2,4,5]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo='preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0050_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060.ets new file mode 100644 index 000000000..f177f4366 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0060 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1000]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1000]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo='preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0060_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070.ets new file mode 100644 index 000000000..fabfba5a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0070 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State msgInfo: string='' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [[2,-2]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([2,-2]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo='preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo='preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0070_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080.ets new file mode 100644 index 000000000..a415251b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0080 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [this.currentIndex - 1, this.currentIndex + 1]]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([this.currentIndex - 1, this.currentIndex + 1]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0080_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090.ets new file mode 100644 index 000000000..44099233a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0090 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,10]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,10]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0090_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100.ets new file mode 100644 index 000000000..f43a5bc50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0100 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,1]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,1]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0100_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110.ets new file mode 100644 index 000000000..87905883a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110.ets @@ -0,0 +1,169 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0110 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(true) + .barHeight(100) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0110_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120.ets new file mode 100644 index 000000000..edfd4746e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0120 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0120_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130.ets new file mode 100644 index 000000000..fc13201b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130.ets @@ -0,0 +1,185 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0130 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State newVertical: boolean = false; + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(this.newVertical) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + // 按钮用于切换 barPosition + Button('Toggle Vertical') + .margin(5) + .onClick(() => { + this.newVertical = !this.newVertical; + console.info('this.newVertical=', this.newVertical); + }) + .id('UIComponentNavTabsCachedCount0130_001'); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0130_002'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140.ets new file mode 100644 index 000000000..9d274a03c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0140 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0140_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150.ets new file mode 100644 index 000000000..2f9eaddad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0150 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0150_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160.ets new file mode 100644 index 000000000..35dca6482 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160.ets @@ -0,0 +1,184 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0160 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State barPosition: BarPosition = BarPosition.Start // 新增状态以动态改变 barPosition + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .barPosition(this.barPosition) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0160_001'); + + Button('change BarPosition') + .margin(5) + .onClick(() => { + this.barPosition = (this.barPosition == BarPosition.Start) ? BarPosition.End : BarPosition.Start; + }).id('UIComponentNavTabsCachedCount0160_002'); + + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170.ets new file mode 100644 index 000000000..4008cb166 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170.ets @@ -0,0 +1,175 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0170 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0170_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180.ets new file mode 100644 index 000000000..75e8f2bf6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180.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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0180 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0180_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190.ets new file mode 100644 index 000000000..e4786bc0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190.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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0190 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1,3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0190_001'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200.ets new file mode 100644 index 000000000..79b7e2d93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200.ets @@ -0,0 +1,185 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0200 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State msgInfo: string = '' + @State barMode: BarMode = BarMode.Fixed // 新增状态以动态改变 barMode + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(false) + .barHeight(56) + .barMode(this.barMode) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0200_001'); + + Button('Toggle barMode') + .margin(5) + .onClick(() => { + // 切换 barPosition + this.barMode = (this.barMode == BarMode.Fixed) ? BarMode.Scrollable : BarMode.Fixed; + console.info('Bar position changed to: ' + this.barMode); + }).id('UIComponentNavTabsCachedCount0200_002'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210.ets new file mode 100644 index 000000000..275727f32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210.ets @@ -0,0 +1,193 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0210 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 3 + @State direction1: Direction = Direction.Rtl; + @State msgInfo: string = '' + @State barMode: BarMode = BarMode.Fixed // 新增状态以动态改变 barMode + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(4)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + //Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(5)) + + } + .vertical(true) + .barHeight(56) + .barMode(this.barMode) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(400) + .height(300) + .direction(this.direction1) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [1,3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + this.msgInfo = 'preloadItems success.' + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.msgInfo = 'preloadItems failed, error code: ' + error.code + ', error message: ' + error.message + }) + }).id('UIComponentNavTabsCachedCount0210_001'); + + Button('change Direction') + .margin(5) + .onClick(() => { + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + console.info('Bar position changed to: ' + this.barMode); + }).id('UIComponentNavTabsCachedCount0210_002'); + Text(this.msgInfo); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220.ets new file mode 100644 index 000000000..e8d26dd20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0220 { + @State nextIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.nextIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .padding(20) + .barHeight(60) + .animationDuration(0) + .onTabBarClick((index: number) => { + this.nextIndex = index + console.log("this.nextIndex=",this.nextIndex ); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsCachedCount0220'); + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + this.tabsController.preloadItems([1, 3]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('UIComponentNavTabsCachedCount0220_001'); + + Text('' + this.errMsg) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230.ets new file mode 100644 index 000000000..970b6fc44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230.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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0230 { + @State nextIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.nextIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)).margin(10); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)).margin(20); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)).margin(30); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)).margin(40); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onTabBarClick((index: number) => { + this.nextIndex = index + console.log("this.nextIndex=",this.nextIndex ); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsCachedCount0230'); + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + this.tabsController.preloadItems([1, 3]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('tabsCachedCount0230_001'); + + Text('' + this.errMsg).id('tabsCachedCount0230_003'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240.ets new file mode 100644 index 000000000..a4b39479e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240.ets @@ -0,0 +1,103 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0240 { + @State currentIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + console.log("this.currentIndex=",this.currentIndex ); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + + .id('tabsCachedCount0240'); + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第this.currentIndex -1、this.currentIndex + 1个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('tabsCachedCount0240_001'); + + Text('' + this.errMsg).id('tabsCachedCount0240_003'); + Text('' + this.currentIndex).id('tabsCachedCount0240_004'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250.ets new file mode 100644 index 000000000..6c3d50bc9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250.ets @@ -0,0 +1,102 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0250 { + @State nextIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.nextIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onTabBarClick((index: number) => { + this.nextIndex = index + console.log("this.nextIndex=",this.nextIndex ); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsCachedCount0250'); + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + this.tabsController.preloadItems([1, 3]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('tabsCachedCount0250_001'); + + Text('' + this.errMsg).id('tabsCachedCount0250_003'); + Text('' + this.nextIndex).id('tabsCachedCount0250_004'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260.ets new file mode 100644 index 000000000..cd562413b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0260 { + @State nextIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.nextIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onContentWillChange((currentIndex, comingIndex) => { + this.nextIndex = comingIndex; + console.log("this.currentIndex=",this.nextIndex ); + return true + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsCachedCount0260'); + + Button('preload items: [1, 4]') + .margin(5) + .onClick(() => { + // 预加载第this.currentIndex -1、this.currentIndex + 1个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 4]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('tabsCachedCount0260_001'); + + Text('' + this.errMsg).id('tabsCachedCount0260_003'); + Text('' + this.nextIndex).id('tabsCachedCount0260_004'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270.ets new file mode 100644 index 000000000..6a0ef6cd6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0270 { + @State currentIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('首页',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('发现',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('推荐',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('我的',3)); + + TabContent() { + Column(){ + Text('其它') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('其它',4)); + + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsCachedCount0270'); + + Button('preload items: [1, 4]') + .margin(5) + .onClick(() => { + // 预加载第this.currentIndex -1、this.currentIndex + 1个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 4]) + .then(() => { + this.errMsg = 'success'; + }) + .catch((error: BusinessError) => { + this.errMsg = error.message; + console.log("error=",this.errMsg ) + }) + }).id('tabsCachedCount0270_001'); + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 5 + this.tabsController.changeIndex(this.currentIndex) + }).id('tabsCachedCount0270_002'); + + Text('' + this.errMsg).id('tabsCachedCount0270_003'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280.ets new file mode 100644 index 000000000..08bf1563c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280.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. + */ +import { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0280 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Image(this.selectedIndex === index ? $r('app.media.cat') : $r('app.media.cat')) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain); + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Image($r('app.media.cat')); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [2, 3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([2, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }).id('UIComponentNavTabsCachedCount0280_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290.ets new file mode 100644 index 000000000..70d626fef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290.ets @@ -0,0 +1,139 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount0290 { + @State webController: webview.WebviewController = new webview.WebviewController(); + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private tabController: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabController }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Web({ src: 'www.huawei.com', controller: this.webController }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Web({ src: 'www.huawei.com', controller: this.webController }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Web({ src: 'www.huawei.com', controller: this.webController }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }); + Web({ src: 'www.huawei.com', controller: this.webController }); + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + + Button('preload items: [2, 3]') + .margin(5) + .onClick(() => { + // 预加载第2、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabController.preloadItems([2, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }).id('UIComponentNavTabsCachedCount0290_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0300.ets similarity index 74% rename from function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets rename to function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0300.ets index 0a9b2b6da..658251f33 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0300.ets @@ -13,12 +13,15 @@ * limitations under the License. */ import { BusinessError } from '@kit.BasicServicesKit' - +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' @Entry @Component -struct UIComponentNavTabsCachedCount014 { - @State currentIndex: number = 0 - private tabsController: TabsController = new TabsController() +struct UIComponentNavTabsCachedCount0300 { + @State currentIndex: number = 0; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); build() { Column() { @@ -41,24 +44,28 @@ struct UIComponentNavTabsCachedCount014 { } .width(360) .height(296) + .vertical(true) .backgroundColor('#F1F3F5') .onChange((index: number) => { this.currentIndex = index }) + .id('tabsCachedCount0300'); - Button('preload items: [1, 3]') + Button('preload items: [undefined]') .margin(5) .onClick(() => { // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 - this.tabsController.preloadItems([1, 3]) + this.tabsController.preloadItems([undefined]) .then(() => { - console.info('preloadItems success.') }) .catch((error: BusinessError) => { - console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + this.errMsg = error.message; + console.log("error=",this.errMsg ) }) - }) - .id('UIComponentNavTabs014_001') + }).id('tabsCachedCount0300_001'); + + Text('' + this.errMsg).id('tabsCachedCount0300_002') + } } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010.ets new file mode 100644 index 000000000..0849fe727 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010.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. + */ +import { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0010 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + this.textValue='trigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onTabBarClick((index: number) => { + + console.log(this.textValue); + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsCapabilityEnhancement0010'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsCapabilityEnhancement0010_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019.ets new file mode 100644 index 000000000..2706c679c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019.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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { i18n } from '@kit.LocalizationKit' +import { LengthMetrics } from '@kit.ArkUI' +import { intl } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0019 { + @State currentIndex: number = 0 + @State animationDuration: string = 'null' + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State errMsg: string = 'haveno'; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name1: string) { + Column() { + Text(name1) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }) + }.width('100%').id(name1) + } + + build() { + + Column({ }) { + + + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area)=> { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(null) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(0, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + this.errMsg='trigger onAnimationStart' + console.info('trigger onAnimationStart') + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onAnimationEnd' + console.info('trigger onAnimationEnd') + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onGestureSwipe' + console.info('trigger onGestureSwipe') + }); + + Text('' + this.errMsg).id('tabsCapabilityEnhancement0019_003'); + + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020.ets new file mode 100644 index 000000000..e83a6cddb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0020 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0020') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030.ets new file mode 100644 index 000000000..973fc6230 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030.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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0030 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + this.textValue='trigger onAnimationEnd'; + }) + .onTabBarClick((index: number) => { + + console.log(this.textValue); + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsCapabilityEnhancement0030'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsCapabilityEnhancement0030_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040.ets new file mode 100644 index 000000000..0b73d5d64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040.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. + */ +import { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0040 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + this.textValue='trigger onAnimationEnd'; + }) + .onTabBarClick((index: number) => { + console.log(this.textValue); + }) + .onClick(() => { + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width); + }).id('UIComponentNavTabsCapabilityEnhancement0040'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsCapabilityEnhancement0040_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050.ets new file mode 100644 index 000000000..73257e2f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050.ets @@ -0,0 +1,102 @@ +/* + * 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 UIComponentNavTabsCapabilityEnhancement0050 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = this.msgInfo + '\nBlue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = this.msgInfo + '\nGreen will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(1000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0050') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + //Text(this.msgInfo); + }.width('100%').height(400) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060.ets new file mode 100644 index 000000000..5d1c5a241 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060.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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { i18n } from '@kit.LocalizationKit' +import { LengthMetrics } from '@kit.ArkUI' +import { intl } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // ϵͳñ仯 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0060 { + @State currentIndex: number = 0 + @State animationDuration: number = 0 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State errMsg: string = 'haveno'; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name1: string) { + Column() { + Text(name1) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }) + }.width('100%').id(name1) + } + + build() { + + Column({ }) { + + + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area)=> { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // indexı仯ʵҳǩݵл + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // лʼʱûص»߸ҳһ𻬶ͬʱȽ䡣 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + this.errMsg='trigger onAnimationStart' + console.info('trigger onAnimationStart') + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // лʱûص»߶ֹͣ + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onAnimationEnd' + console.info('trigger onAnimationEnd') + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // ҳֻУ֡ûص + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onGestureSwipe' + console.info('trigger onGestureSwipe') + }); + + Text('' + this.errMsg).id('tabsCapabilityEnhancement0060_003'); + + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // ҳ滬һ룬tabBarлһҳ + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // ʱ + curve: Curve.Linear, // + iterations: 1, // Ŵ + playMode: PlayMode.Normal, // ģʽ + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070.ets new file mode 100644 index 000000000..7a35317d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070.ets @@ -0,0 +1,175 @@ +/* + * 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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { i18n } from '@kit.LocalizationKit' +import { LengthMetrics } from '@kit.ArkUI' +import { intl } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0070 { + @State currentIndex: number = 0 + @State animationDuration: number = 600 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State errMsg: string = 'haveno'; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + @Builder + tabBuilder(index: number, name1: string) { + Column() { + Text(name1) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }) + }.width('100%').id(name1) + } + + build() { + + Column({ }) { + + + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area)=> { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + this.errMsg='trigger onAnimationStart' + console.info('trigger onAnimationStart') + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onAnimationEnd' + console.info('trigger onAnimationEnd') + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + this.errMsg='trigger onGestureSwipe' + console.info('trigger onGestureSwipe') + }); + + Text('' + this.errMsg).id('tabsCapabilityEnhancement0070_003'); + + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets new file mode 100644 index 000000000..2ec46bae4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0080 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0080') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090.ets new file mode 100644 index 000000000..770679904 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0090 { + @State currentIndex: number = 2 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsCapabilityEnhancement0090') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(false); + + Button('动态修改index').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + }).id('UIComponentNavTabsCapabilityEnhancement0090_001'); + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + this.controller.changeIndex(this.currentIndex) + }).id('UIComponentNavTabsCapabilityEnhancement0090_002'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets new file mode 100644 index 000000000..a5a4a00b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0100 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0100') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets new file mode 100644 index 000000000..24da3bcb3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0110 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0110') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets new file mode 100644 index 000000000..9e584b5ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0120 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0120') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets new file mode 100644 index 000000000..14d5254af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0130 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0130') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140.ets new file mode 100644 index 000000000..ca97d7672 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140.ets @@ -0,0 +1,102 @@ +/* + * 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 UIComponentNavTabsCapabilityEnhancement0140 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = this.msgInfo + '\nBlue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = this.msgInfo + '\nGreen will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(1000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0140') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + //Text(this.msgInfo); + }.width('100%').height(400) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets new file mode 100644 index 000000000..460c9a64c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0150 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0150') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets new file mode 100644 index 000000000..fb500e968 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.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. + */ +@Entry +@Component +struct UIComponentNavTabsCapabilityEnhancement0160 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onAnimationEnd'; + }) + .id('UIComponentNavTabsCapabilityEnhancement0160') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360.ets new file mode 100644 index 000000000..0f045c2ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsContentAdapt0360 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + this.msgInfo='trigger onChange' + }) + .onContentWillChange((currentIndex, comingIndex) => { + return true + }) + .width('100%') + .height('auto') + .id('UIComponentNavTabsContentAdapt0360') + .backgroundColor(0xF1F3F5); + + Text(this.msgInfo); + Button('clear') + .onClick(()=>{ + this.msgInfo=''; + }).id('UIComponentNavTabsContentAdapt0360_001'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370.ets new file mode 100644 index 000000000..8df7bd92e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370.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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0370 { + private controller: TabsController = new TabsController() + @State gridMargin: number = 10 + @State gridGutter: number = 10 + @State sm: number = -2 + @State clickedContent: string = ""; + + build() { + Column() { + + Text("点击内容:" + this.clickedContent).width('100%').height(200).margin({ top: 5 }) + + + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "1").id('1')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "2").id('2')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "3").id('3')) + } + .width('350vp') + .animationDuration(300) + .height('60%') + .barGridAlign({ sm: this.sm, margin: this.gridMargin, gutter: this.gridGutter }) + .backgroundColor(0xf1f3f5) + .onTabBarClick((index: number) => { + this.clickedContent += "now index " + index + " is clicked\n"; + }) + } + .width('100%') + .height(500) + .margin({ top: 5 }) + .padding('10vp') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380.ets new file mode 100644 index 000000000..7bba8f7a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380.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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0380 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .onContentWillChange((currentIndex, comingIndex) => { + this.msgInfo='trigger onContentWillChange' + return true + }) + .width('100%') + .height('auto') + .id('UIComponentNavTabsContentAdapt0380') + .backgroundColor(0xF1F3F5); + + Text(this.msgInfo); + Button('clear') + .onClick(()=>{ + this.msgInfo=''; + }).id('UIComponentNavTabsContentAdapt0380_001'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100.ets new file mode 100644 index 000000000..04fbba59b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100.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. + */ +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0100 { + @State currentIndex: number = 3 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsEdgeeffect0100') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(false); + + Button('动态修改index').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + }).id('UIComponentNavTabsEdgeeffect0100_001'); + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + this.controller.changeIndex(this.currentIndex) + }).id('UIComponentNavTabsEdgeeffect0100_002'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170.ets new file mode 100644 index 000000000..c16012067 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170.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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0170 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + this.textValue='trigger onChange'; + console.log(this.textValue); + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsEdgeeffect0170'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0170_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180.ets new file mode 100644 index 000000000..8d9278258 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180.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. + */ +import { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0180 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onTabBarClick((index: number) => { + this.textValue='trigger onTabBarClick'; + console.log(this.textValue); + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsEdgeeffect0180'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0180_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190.ets new file mode 100644 index 000000000..c90da6b90 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190.ets @@ -0,0 +1,169 @@ +/* + * 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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0190 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + this.textValue='trigger onAnimationStart'; + console.log(this.textValue); + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsEdgeeffect0190'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0190_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200.ets new file mode 100644 index 000000000..92b66a78d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200.ets @@ -0,0 +1,168 @@ +/* + * 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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0200 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + this.textValue='trigger onAnimationEnd'; + console.log(this.textValue); + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsEdgeeffect0200'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0200_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210.ets new file mode 100644 index 000000000..5e6894de0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210.ets @@ -0,0 +1,174 @@ +/* + * 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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0210 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onContentWillChange((currentIndex, comingIndex) => { + + return true + }) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + this.textValue='trigger onGestureSwipe'; + console.log(this.textValue); + }).id('UIComponentNavTabsEdgeeffect0210'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0210_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220.ets new file mode 100644 index 000000000..057e3baee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220.ets @@ -0,0 +1,173 @@ +/* + * 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 { Configuration, UIAbility } from '@kit.AbilityKit' +import { LengthMetrics } from '@kit.ArkUI' +import { i18n, intl } from '@kit.LocalizationKit' + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0220 { + @State currentIndex: number = 0 + @State animationDuration: number = 300 + @State indicatorLeftMargin: number = 0 + @State indicatorWidth: number = 0 + @State textValue: string = ''; + private tabsWidth: number = 0 + private textInfos: [number, number][] = [] + private isStartAnimateTo: boolean = false + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontSize(16) + .fontColor(this.currentIndex === index ? '#007DFF' : '#182431') + .fontWeight(this.currentIndex === index ? 500 : 400) + .id(index.toString()) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.textInfos[index] = [newValue.globalPosition.x as number, newValue.width as number] + }); + + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .onAreaChange((oldValue: Area, newValue: Area) => { + this.tabsWidth = newValue.width as number + if (!this.isStartAnimateTo) { + this.setIndicatorAttr(this.textInfos[this.currentIndex][0], this.textInfos[this.currentIndex][1]) + } + }) + .barWidth('100%') + .barHeight(56) + .width('100%') + .height(296) + .backgroundColor('#F1F3F5') + .animationDuration(this.animationDuration) + .onContentWillChange((currentIndex, comingIndex) => { + this.textValue='trigger onContentWillChange'; + console.log(this.textValue); + return true + }) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + this.startAnimateTo(this.animationDuration, this.textInfos[targetIndex][0], this.textInfos[targetIndex][1]) + + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + // 切换动画结束时触发该回调。下划线动画停止。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event); + this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width); + + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + // 在页面跟手滑动过程中,逐帧触发该回调。 + let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event) + this.currentIndex = currentIndicatorInfo.index + this.setIndicatorAttr(currentIndicatorInfo.left, currentIndicatorInfo.width) + }).id('UIComponentNavTabsEdgeeffect0220'); + Text(this.textValue); + Button('clear text') + .onClick(() => { + this.textValue=''; + }).id('UIComponentNavTabsEdgeeffect0220_001'); + }.width('100%'); + } + + private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { + let nextIndex = index + if (index > 0 && (CommonUtil.getIsRTL() ? event.currentOffset < 0 : event.currentOffset > 0)) { + nextIndex-- + } else if (index < 3 && (CommonUtil.getIsRTL() ? event.currentOffset > 0 : event.currentOffset < 0)) { + nextIndex++ + } + let indexInfo = this.textInfos[index] + let nextIndexInfo = this.textInfos[nextIndex] + let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) + let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 + let currentLeft = indexInfo[0] + (nextIndexInfo[0] - indexInfo[0]) * swipeRatio + let currentWidth = indexInfo[1] + (nextIndexInfo[1] - indexInfo[1]) * swipeRatio + return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } + } + + private startAnimateTo(duration: number, leftMargin: number, width: number) { + this.isStartAnimateTo = true + animateTo({ + duration: duration, // 动画时长 + curve: Curve.Linear, // 动画曲线 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + this.isStartAnimateTo = false + console.info('play end') + } + }, () => { + this.setIndicatorAttr(leftMargin, width) + }) + } + + private setIndicatorAttr(leftMargin: number, width: number) { + this.indicatorWidth = width + if (CommonUtil.getIsRTL()) { + this.indicatorLeftMargin = this.tabsWidth - leftMargin - width + } else { + this.indicatorLeftMargin = leftMargin + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets new file mode 100644 index 000000000..f2db9758d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets @@ -0,0 +1,49 @@ +/* + * 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 UIComponentNavTabsExpandsafearea0130 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Text('文本') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('100%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets new file mode 100644 index 000000000..917f57842 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets @@ -0,0 +1,49 @@ +/* + * 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 UIComponentNavTabsExpandsafearea0140 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('100%') + Text('文本') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets new file mode 100644 index 000000000..4a9e9f190 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets @@ -0,0 +1,50 @@ +/* + * 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 UIComponentNavTabsExpandsafearea0150 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Text('文本') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + Text('文本') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets new file mode 100644 index 000000000..c22b34fd6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets @@ -0,0 +1,55 @@ +/* + * 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 UIComponentNavTabsExpandsafearea0160 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + @State heightValue: Length = 300; + + build() { + Column() { + Button('change heightValue') + .id('UIComponentNavTabsExpandsafearea0160_001') + .onClick(()=>{ + this.heightValue = '80%'; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height(this.heightValue) + Text('文本') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110.ets new file mode 100644 index 000000000..0cd6ab482 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110.ets @@ -0,0 +1,76 @@ +/* + * 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 UIComponentNavTabsImproTrace0110 { + @State currentIndex: number = 0 + @State tabContentWidth: number = 60 + @State tabContentHeight: number = 60 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(this.tabContentHeight) + .width(this.tabContentWidth) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Scrollable) + .barWidth('100%') + .barHeight(200) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('100%') + .height(400) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 2000; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0110_001'); + + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170.ets new file mode 100644 index 000000000..6399e7fce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170.ets @@ -0,0 +1,75 @@ +/* + * 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 UIComponentNavTabsImproTrace0170 { + @State currentIndex: number = 0 + @State tabContentWidth: number = 60 + @State tabContentHeight: number = 60 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(this.tabContentHeight) + .width(this.tabContentWidth) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Scrollable) + .barWidth('100%') + .barHeight(200) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('100%') + .height(400) + .backgroundColor('#F1F3F5') + .scrollable(true).id('UIComponentNavTabsImproTrace0170'); + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 2000; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0170_001'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020.ets new file mode 100644 index 000000000..65413fc55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020.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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0020 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + .id(title); + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)); + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)); + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)); + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)); + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor(Color.Red).justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('five',4)); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + .id('UIComponentNavTabsInterception0020'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140.ets new file mode 100644 index 000000000..e0a424443 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsInterception0140 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'no_value'; + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder('Red')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1) + .onContentWillChange((currentIndex, comingIndex) => { + if(comingIndex==3) + { + return false; + } + else + { + return true + } + + }) + .onTabBarClick((index: number) => { + this.nextIndex = 'click onTabBarClick('+index.toString()+')'; + }) + .id('tabsInterception0140'); + + Text('' + this.nextIndex).id('tabsInterception0140_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160.ets new file mode 100644 index 000000000..356f0725b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160.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. + */ +interface itemType0160 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsInterception0160 { + @State data: itemType0160[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }, + { + text: 'Green', + backgroundColor: Color.Green + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State changeIndex: number = 0; + @State currentIndex: number = 0; + private tabsController: TabsController = new TabsController() + @State msgInfo: string = '' + private durationList: number[] = [] + private timeoutList: number[] = [] + private customContentTransition: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + this.msgInfo='from ' + from + ' to ' + to; + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + + } + + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition; + return tabContentAnimatedTransition; + } + + aboutToAppear(): void { + let duration = 300 + let timeout = 2000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration ) + this.timeoutList.push(timeout ) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink').selectedMode(this.selectedMode)).opacity(this.opacityList[0]) + .scale({ x: this.scaleList[0], y: this.scaleList[0] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue').selectedMode(this.selectedMode)).opacity(this.opacityList[1]) + .scale({ x: this.scaleList[1], y: this.scaleList[1] }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green').selectedMode(this.selectedMode)).opacity(this.opacityList[3]) + .scale({ x: this.scaleList[3], y: this.scaleList[3] }); + + } + .animationDuration(3000) + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .vertical(false) + .customContentTransition(this.customContentTransition) + .onTabBarClick((index: number) => { + //this.msgInfo = 'trigger onTabBarClick' + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // this.msgInfo = 'trigger onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + //this.msgInfo = 'trigger onAnimationEnd' + }) + .onChange((index: number) => { + this.currentIndex = index + }) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + .id('UIComponentNavTabsInterception0160'); + + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150.ets new file mode 100644 index 000000000..23807b87b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150.ets @@ -0,0 +1,78 @@ +/* + * 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 UIComponentNavTabsInterface0150 { + @State currentIndex: number = 2 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(2000) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + Button('动态修改index').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + }).id('UIComponentNavTabsInterface0150_001'); + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + this.controller.changeIndex(this.currentIndex) + }).id('UIComponentNavTabsInterface0150_002'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170.ets new file mode 100644 index 000000000..41cd229f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170.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. + */ +@Entry +@Component +struct UIComponentNavTabsInterface0170 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Scrollable) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3/100) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsInterface0170') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + console.info(index.toString()) + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Button('Get duration') + .margin(5) + .onClick(() => { + let strJson = getInspectorByKey('UIComponentNavTabsInterface0170'); + let obj: ESObject = JSON.parse(strJson); + this.msgInfo = 'value=' + parseInt(obj.$attrs.animationDuration); + }).id('UIComponentNavTabsInterface0170_001'); + Text(this.msgInfo); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070.ets new file mode 100644 index 000000000..f7dfc06d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070.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. + */ +@Entry +@Component +struct UIComponentNavTabsLayout0070 { + @State arr: number[] = [1,2,3,4]; + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Column({ space: 5 }) { + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.width("100%"); + }.tabBar(new SubTabBarStyle('Pink')); + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsLayout0070') + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190.ets new file mode 100644 index 000000000..950920c45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0190 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + this.nextIndex = index.toString(); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1) + .id('tabsMirror0190'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsMirror0190_001'); + Text('' + this.nextIndex).id('tabsMirror0190_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200.ets new file mode 100644 index 000000000..055dab4e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200.ets @@ -0,0 +1,82 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0200 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onTabBarClick((index: number) => { + this.nextIndex = index.toString(); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1) + .id('tabsMirror0200'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsMirror0200_001'); + Text('' + this.nextIndex).id('tabsMirror0200_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210.ets new file mode 100644 index 000000000..174984e98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0210 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width('100%') + .backgroundColor(0xF1F3F5) + .animationDuration(400) + .direction(this.direction1) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + this.nextIndex='onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='onAnimationEnd' + }) + .id('tabsMirror0210'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsMirror0210_001'); + Text('' + this.nextIndex).id('tabsMirror0210_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220.ets new file mode 100644 index 000000000..54cdf4e68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0220 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width('100%') + .backgroundColor(0xF1F3F5) + .animationDuration(400) + .direction(this.direction1) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + //this.nextIndex='onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + //this.nextIndex='onAnimationEnd' + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + this.nextIndex='onGestureSwipe' + }) + .id('tabsMirror0220'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsMirror0220_001'); + Text('' + this.nextIndex).id('tabsMirror0220_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230.ets new file mode 100644 index 000000000..94a97e3b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230.ets @@ -0,0 +1,84 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0230 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width('100%') + .backgroundColor(0xF1F3F5) + .animationDuration(400) + .direction(this.direction1) + .onContentWillChange((currentIndex, comingIndex) => { + this.nextIndex = comingIndex.toString(); + return true + }) + .id('tabsMirror0230'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsMirror0230_001'); + Text('' + this.nextIndex).id('tabsMirror0230_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240.ets new file mode 100644 index 000000000..9b9cc7617 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240.ets @@ -0,0 +1,84 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsMirror0240 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width('100%') + .backgroundColor(0xF1F3F5) + .animationDuration(0) + .direction(this.direction1) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.nextIndex = index.toString(); + }) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 2) { + return false + } + return true + }) + .id('UIComponentNavTabsMirror0240'); + Button('change Direction').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.direction1 = Direction.Ltr; + }).id('UIComponentNavTabsMirror0240_001') + + Text('' + this.nextIndex).id('UIComponentNavTabsMirror0240_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets index 371a56d47..6a928db49 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets @@ -43,7 +43,7 @@ struct UIComponentNavTabsMirror0250 { TabContent() { Column() { Text('www.sohu.com'); - Web({ src: 'www.sohu.com', controller: this.controller }) + Web({ src: $rawfile("index.html"), controller: this.controller }) .fileAccess(true); } .width('100%').height('100%').backgroundColor(Color.Pink) @@ -52,7 +52,7 @@ struct UIComponentNavTabsMirror0250 { TabContent() { Column() { Text('www.sina.com'); - Web({ src: 'www.sina.com', controller: this.controller }) + Web({ src: $rawfile("index.html"), controller: this.controller }) .fileAccess(true); }.width('100%').height('100%').backgroundColor(Color.Yellow) }.tabBar(this.tabBuilder(1)); @@ -60,7 +60,7 @@ struct UIComponentNavTabsMirror0250 { TabContent() { Column() { Text('www.baidu.com'); - Web({ src: 'www.baidu.com', controller: this.controller }) + Web({ src: $rawfile("index.html"), controller: this.controller }) .fileAccess(true); }.width('100%').height('100%').backgroundColor(Color.Blue) }.tabBar(this.tabBuilder(2)); @@ -68,7 +68,7 @@ struct UIComponentNavTabsMirror0250 { TabContent() { Column() { Text('www.jd.com'); - Web({ src: 'www.jd.com', controller: this.controller }) + Web({ src: $rawfile("index.html"), controller: this.controller }) .fileAccess(true); }.width('100%').height('100%').backgroundColor(Color.Green) }.tabBar(this.tabBuilder(3)); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320.ets new file mode 100644 index 000000000..e2211ac98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320.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 UIComponentNavTabsMirror0320 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0320_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010.ets new file mode 100644 index 000000000..a17ff6f8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010.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. + */ +@Entry +@Component +struct UIComponentNavTabsNest0010 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + + @Builder + tabBuilder(index: number) { + Column() { + Text('Tab') + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(0)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(1)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(2)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(3)) + } + }.tabBar(new SubTabBarStyle('Pink').id('Pink')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')) + + } + .vertical(false) + .height(400) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('UIComponentNavTabsNest0010'); + }.width('100%').height(200); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020.ets new file mode 100644 index 000000000..559a3687b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020.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. + */ +@Entry +@Component +struct UIComponentNavTabsNest0020 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + + @Builder + tabBuilder(index: number) { + Column() { + Text('Tab') + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(0)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(1)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(2)) + + TabContent() { + Column().width('100%').height('300').backgroundColor(Color.Red) + } + .tabBar(this.tabBuilder(3)) + } + }.tabBar(new SubTabBarStyle('Pink').id('Pink')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')) + + } + .vertical(false) + .height(400) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('UIComponentNavTabsNest0020'); + }.width('100%').height(200); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010.ets new file mode 100644 index 000000000..6d5cc24ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0010 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'test' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'test' }, this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020.ets new file mode 100644 index 000000000..cced43bd4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0020 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030.ets new file mode 100644 index 000000000..8f9f97743 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0030 { + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')).id('tabContentId0'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(new SubTabBarStyle('blue').id('blue')).id('tabContentId1'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(new SubTabBarStyle('red').id('red')).id('tabContentId2'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(new SubTabBarStyle('green').id('green')).id('tabContentId3'); + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + + //.id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040.ets new file mode 100644 index 000000000..cd93b0f28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040.ets @@ -0,0 +1,97 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0040 { + @State currentIndex: number = 0; + @State width1: number = 360; + @State height1: number = 296; + private controller: TabsController = new TabsController(); + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width(this.width1).height(this.height1).backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(this.width1) + .height(this.height1) + .backgroundColor('#F1F3F5') + .id('testId') + Button('change width').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.width1 == 360) + { + this.width1 = 300 + } + else + { + this.width1 = 360 + } + if(this.height1 == 296) + { + this.height1 = 360 + } + else + { + this.height1 = 296 + } + }) + .id('UIComponentNavTabsObserver0040_001'); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050.ets new file mode 100644 index 000000000..144a33434 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050.ets @@ -0,0 +1,97 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; +import screen from '@ohos.screenshot'; +import { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0050 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId'); + + Button('Landscape') + .onClick(() => { + this.changeOrientation(true); + }).id('UIComponentNavTabsObserver0050_001'); + Button('Portrait') + .onClick(() => { + this.changeOrientation(false); + }).id('UIComponentNavTabsObserver0050_002'); + + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060.ets new file mode 100644 index 000000000..0ff88dc2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060.ets @@ -0,0 +1,97 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; +import screen from '@ohos.screenshot'; +import { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0060 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId'); + + Button('Landscape') + .onClick(() => { + this.changeOrientation(true); + }).id('UIComponentNavTabsObserver0060_001'); + Button('Portrait') + .onClick(() => { + this.changeOrientation(false); + }).id('UIComponentNavTabsObserver0060_002'); + + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070.ets new file mode 100644 index 000000000..c0b233ad4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0070 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + this.controller.changeIndex(this.currentIndex) + }) + .id('UIComponentNavTabsObserver0070_001'); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080.ets new file mode 100644 index 000000000..b1c9e5828 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0080 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + this.controller.changeIndex(this.currentIndex) + }) + .id('UIComponentNavTabsObserver0080_001'); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0090.ets similarity index 36% rename from function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets rename to function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0090.ets index 57f6ee4c8..9eaee081f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0090.ets @@ -12,73 +12,69 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { BusinessError } from '@kit.BasicServicesKit' +import { uiObserver as observer } from '@kit.ArkUI'; @Entry @Component -struct UIComponentNavTabsCachedCount015 { - @State currentIndex: number = 0 - private tabsController: TabsController = new TabsController() +struct UIComponentNavTabsObserver0090 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } build() { Column() { - Tabs({ index: this.currentIndex, barPosition: BarPosition.End, controller: this.tabsController }) { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { TabContent() { - MyComponent({ color: '#00CB87' }) - }.tabBar(SubTabBarStyle.of('green')) + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') TabContent() { - MyComponent({ color: '#007DFF' }) - }.tabBar(SubTabBarStyle.of('blue')) + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') TabContent() { - MyComponent({ color: '#FFBF00' }) - }.tabBar(SubTabBarStyle.of('yellow')) + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') TabContent() { - MyComponent({ color: '#E67C92' }) - }.tabBar(SubTabBarStyle.of('pink')) + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') } .width(360) .height(296) .backgroundColor('#F1F3F5') - .onChange((index: number) => { - this.currentIndex = index - }) - - Button('preload items: [1, 3]') - .margin(5) - .onClick(() => { - // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 - this.tabsController.preloadItems([1, 3]) - .then(() => { - console.info('preloadItems success.') - }) - .catch((error: BusinessError) => { - console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) - }) + .id('testId') + Button('动态修改index').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 }) - .id('UIComponentNavTabs015_001') - } - } -} + .id('UIComponentNavTabsObserver0090_001'); -@Component -struct MyComponent { - private color: string = "" - - aboutToAppear(): void { - console.info('aboutToAppear backgroundColor:' + this.color) - } - - aboutToDisappear(): void { - console.info('aboutToDisappear backgroundColor:' + this.color) + }.width('100%') } - - build() { - Column() - .width('100%') - .height('100%') - .backgroundColor(this.color) - } -} \ No newline at end of file +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100.ets new file mode 100644 index 000000000..4476fa570 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100.ets @@ -0,0 +1,93 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; +import screen from '@ohos.screenshot'; +import { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0100 { + @State vertical1: boolean = true; + ; + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .vertical(this.vertical1) + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId'); + + Button('change vertical') + .onClick(() => { + this.vertical1 = !this.vertical1; + }).id('UIComponentNavTabsObserver0100_001'); + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110.ets new file mode 100644 index 000000000..d9a1cf5ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0110 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + }.id(name).width('100%') + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120.ets new file mode 100644 index 000000000..bed4fedec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120.ets @@ -0,0 +1,82 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0120 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + @State visibility1: Visibility = Visibility.Visible + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0').visibility(this.visibility1) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + Button('change visibility').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.visibility1 = Visibility.Hidden; + }) + .id('UIComponentNavTabsObserver0120_001'); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130.ets new file mode 100644 index 000000000..b1daf2193 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130.ets @@ -0,0 +1,82 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0130 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + @State visibility1: Visibility = Visibility.Visible + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0').visibility(this.visibility1) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + Button('change visibility').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.visibility1 = Visibility.None; + }) + .id('UIComponentNavTabsObserver0130_001'); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150.ets new file mode 100644 index 000000000..c10f84fc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0150 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + }.id(name).width('100%') + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160.ets new file mode 100644 index 000000000..2d3fb6587 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0160 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170.ets new file mode 100644 index 000000000..7549957e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0170 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200.ets new file mode 100644 index 000000000..d4e3dbf30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; +import {tabContent11} from './tabcontent' +@Entry +@Component +struct UIComponentNavTabsObserver0200 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + tabContent11('Tab1'); + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + tabContent11('Tab2'); + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + tabContent11('Tab3'); + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + tabContent11('Tab4'); + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + this.selectedIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .id('testId') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210.ets new file mode 100644 index 000000000..be2b9382d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210.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 { uiObserver as observer } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentNavTabsObserver0210 { + + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + build() { + Column() { + Tabs() { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar('green').id('tabContentId0') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar('blue').id('tabContentId1') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar('yellow').id('tabContentId2') + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar('pink').id('tabContentId3') + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .id('testId') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/tabcontent.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/tabcontent.ets new file mode 100644 index 000000000..b9ddc3c7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsObserver/tabcontent.ets @@ -0,0 +1,30 @@ +/* + * 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 tabContent11(name: string) { + Column() { + Column() { + Text(name) + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.width('100%') +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010.ets new file mode 100644 index 000000000..f1fd2408b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010.ets @@ -0,0 +1,93 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsOnChange0010 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex:string = 'haveno'; + + + + @Builder tabBuilder(title: string) { + Column() { + Text(title) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(title); + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .width(400) + .height(200) + .backgroundColor(0xF1F3F5) + .animationDuration(400) + .direction(this.direction1) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + //this.nextIndex='onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + //this.nextIndex='onAnimationEnd' + }) + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + this.nextIndex='onGestureSwipe' + }) + .id('tabsOnChange0010'); + + Button('Direction change').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('tabsOnChange0010_001'); + Text('' + this.nextIndex).id('tabsOnChange0010_003'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010.ets new file mode 100644 index 000000000..63051e513 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010.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. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillHide0010 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillHide(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = 'Pink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillHide(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = 'Yellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillHide(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = 'Blue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillHide(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = 'Green will hide'; + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillHide0010') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020.ets new file mode 100644 index 000000000..9907d35a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020.ets @@ -0,0 +1,91 @@ +/* + * 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 UIComponentNavTabsOnWillHide0020 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0020') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030.ets new file mode 100644 index 000000000..563f99cde --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030.ets @@ -0,0 +1,91 @@ +/* + * 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 UIComponentNavTabsOnWillHide0030 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + }) + .id('UIComponentNavTabsOnWillHide0030') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .onTabBarClick((index: number) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040.ets new file mode 100644 index 000000000..25ffc908c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040.ets @@ -0,0 +1,90 @@ +/* + * 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 UIComponentNavTabsOnWillHide0040 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; +build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0040') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050.ets new file mode 100644 index 000000000..8cb25bb94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillHide0050 { + @State currentIndex: number = 0; + @State infoMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column() { + Text('oneContent') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('one', 0)) + .onWillShow(() => { + this.infoMsg = 'one will show'; + }) + .onWillHide(() => { + this.infoMsg = 'one will hide'; + }); + + TabContent() { + Column() { + Text('twoContent') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('two', 1)) + .onWillShow(() => { + this.infoMsg = 'two will show'; + }).onWillHide(() => { + this.infoMsg = 'two will hide'; + }); + + TabContent() { + Column() { + Text('threeContent') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('three', 2)) + .onWillShow(() => { + this.infoMsg = 'three will show'; + }).onWillHide(() => { + this.infoMsg = 'three will hide'; + }); + + TabContent() { + Column() { + Text('fourContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('four', 3)) + .onWillShow(() => { + this.infoMsg = 'four will show'; + }).onWillHide(() => { + this.infoMsg = 'four will hide'; + }); + + TabContent() { + Column() { + Text('fiveContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('five', 4)) + .onWillShow(() => { + this.infoMsg = 'five will show'; + }).onWillHide(() => { + this.infoMsg = 'five will hide'; + }); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsOnWillhide0050'); + + Text('' + this.infoMsg).id('tabsOnWillhide0050_003'); + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060.ets new file mode 100644 index 000000000..2934303f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsOnWillHide0060 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillHide(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = 'Pink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillHide(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = 'Yellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillHide(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = 'Blue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillHide(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = 'Green will hide'; + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillHide0060') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillHide0060_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070.ets new file mode 100644 index 000000000..aabfc9cfe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070.ets @@ -0,0 +1,89 @@ +/* + * 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 UIComponentNavTabsOnWillHide0070 { + @State msgInfo: string = ''; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0070') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080.ets new file mode 100644 index 000000000..ac248258e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080.ets @@ -0,0 +1,94 @@ +/* + * 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 UIComponentNavTabsOnWillHide0080 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; +build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0080') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Button("Hidden tabs") + .onClick((event?: ClickEvent) => { + this.visibility1 = Visibility.Hidden; + }).id('UIComponentNavTabsOnWillHide0080_001'); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100.ets new file mode 100644 index 000000000..6095764a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100.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. + */ +import { uiObserver as observer } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit' +function callbackFunc(info: observer.TabContentInfo) { + console.info('tabContentUpdate', JSON.stringify(info)); +} + +@Entry +@Component +struct UIComponentNavTabsOnWillHide0100 { + private controller: TabsController = new TabsController() + @State indicatorColor: Color = Color.Blue; + @State indicatorWidth: number = 40; + @State indicatorHeight: number = 10; + @State indicatorBorderRadius: number = 5; + @State indicatorSpace: number = 10; + @State subTabBorderRadius: number = 20; + @State mIndex: number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State dataArr: Array = new Array(); + @State msgInfo1: string = ''; + @State msgInfo2: string = ''; + + @State vertical: boolean = false + @State scrollable: boolean = false + + @State height1:number = 50 + // @State currentIndex: number = 1 + private tabsController: TabsController = new TabsController() + + aboutToAppear(): void { + for (let index = 1; index <= 5; index++) { + this.dataArr.push('page-' + index) + } + observer.on('tabContentUpdate', callbackFunc);//"state":0显示 "state":1 隐藏 + } + + aboutToDisappear(): void { + console.log('123') + observer.off('tabContentUpdate', callbackFunc);//不会有打印回调 + } + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start,index: this.mIndex, controller: this.controller }) { + ForEach(this.dataArr, (item: string, index: number) => { + TabContent() { + + Text(item) + .onAppear(()=>{ + console.info('Tabs_onAppear will123' + item.toString()); + + }) + .onDisAppear(()=>{ + console.info('Tabs_onDisAppear will123' + item.toString()) + this.msgInfo2='2. '+item+' trigger onDisAppear()'; + }) + .width('100%') + // .height(this.height1) + .height('100%') + .backgroundColor(this.colors[index%5]) + .borderRadius('12vp') + .textAlign(TextAlign.Center) + + }.tabBar(SubTabBarStyle.of(item) + .indicator({ + color: this.indicatorColor, //下划线颜色 + height: this.indicatorHeight, //下划线高度 + width: this.indicatorWidth, //下划线宽度 + borderRadius: this.indicatorBorderRadius, //下划线圆角半径 + marginTop: this.indicatorSpace //下划线与文字间距 + }) + .selectedMode(this.selectedMode) + .board({ borderRadius: this.subTabBorderRadius }) + .labelStyle({}) + ) .onWillShow(() => { + console.info("Pink will show") + }).onWillHide(() => { + console.info(item + "will Hide") + this.msgInfo1='1. '+ item+' trigger onWillHide()'; + }); + }, (item: string, index: number) => item + index) + } + // .fadingEdge(true) + .barBackgroundColor('#88888888') + .vertical(this.vertical) + .scrollable(this.scrollable) + .barMode(BarMode.Scrollable) + // .barWidth($r('app.float.boardSize_50')) + .barHeight(140) + .animationDuration(1000) + .edgeEffect(EdgeEffect.Spring) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height(320); + + Column({ space: 10 }) { + Button('尾部动态增加页面').height(30).onClick(() => { + this.dataArr.splice(this.dataArr.length, 0, '尾部动态增加') + this.mIndex = this.dataArr.length-1 + this.height1 = 100 + }).id('UIComponentNavTabsOnWillHide0100_001'); + + Button('尾部动态减少页面').height(30).onClick(() => { + this.dataArr.splice(this.dataArr.length-1, 1) + this.height1 = 200 + }).id('UIComponentNavTabsOnWillHide0100_002'); + Text(this.msgInfo1); + Text(this.msgInfo2) + } + }.width('auto').height('auto').padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110.ets new file mode 100644 index 000000000..33a4e7ebb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110.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. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillHide0110 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillHide0110') + .width(2000) + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { + this.msgInfo = 'trigger onVisibleAreaChange'; + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillHide0110_001'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120.ets new file mode 100644 index 000000000..43de5cab6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120.ets @@ -0,0 +1,90 @@ +/* + * 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 UIComponentNavTabsOnWillHide0120 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onChange'; + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + }) + .id('UIComponentNavTabsOnWillHide0120') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130.ets new file mode 100644 index 000000000..befab5cec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillHide0130 { + @State currentIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('oneContent') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('one',0)) + .onWillHide(() => { + //console.info("one will Hide"); + this.errMsg='one will Hide'; + }); + + TabContent() { + Column(){ + Text('twoContent') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('two',1)) + .onWillHide(() => { + //console.info("two will Hide"); + this.errMsg='one will Hide'; + }); + + TabContent() { + Column(){ + Text('threeContent') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('three',2)) + .onWillHide(() => { + //console.info("three will Hide"); + this.errMsg='three will Hide'; + }); + + TabContent() { + Column(){ + Text('fourContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('four',3)) + .onWillHide(() => { + //console.info("four will Hide"); + this.errMsg='four will Hide'; + }); + + TabContent() { + Column(){ + Text('fiveContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('five',4)) + .onWillHide(() => { + //console.info("five will Hide"); + this.errMsg='five will Hide'; + }); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + this.errMsg = 'onChange,index='+index.toString(); + console.info('onChange,index='+index.toString()); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsOnWillhide0130'); + + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 5 + this.tabsController.changeIndex(this.currentIndex) + }).id('tabsOnWillhide0130_001'); + + Text('' + this.errMsg).id('tabsOnWillhide0130_003'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140.ets new file mode 100644 index 000000000..7e10a43c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140.ets @@ -0,0 +1,93 @@ +/* + * 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 UIComponentNavTabsOnWillHide0140 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + this.msgInfo = this.msgInfo + '\ntrigger onChange'; + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + }) + .id('UIComponentNavTabsOnWillHide0140') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .onTabBarClick((index: number) => { + this.msgInfo = this.msgInfo + '\ntrigger onTabBarClick'; + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150.ets new file mode 100644 index 000000000..a17b01245 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150.ets @@ -0,0 +1,91 @@ +/* + * 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 UIComponentNavTabsOnWillHide0150 { + @State msgInfo: string = ''; + @State visibility1: Visibility = Visibility.Visible; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .visibility(this.visibility1) + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.msgInfo = this.msgInfo + '\ntrigger onAnimationStart'; + }) + .id('UIComponentNavTabsOnWillHide0150') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160.ets new file mode 100644 index 000000000..d639c7f53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160.ets @@ -0,0 +1,91 @@ +/* + * 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 UIComponentNavTabsOnWillHide0160 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + //this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = this.msgInfo + '\nBlue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = this.msgInfo + '\nGreen will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0160') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + this.msgInfo = 'GestureSwipe'; + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillHide0160_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170.ets new file mode 100644 index 000000000..6766e71b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillHide0170 { + @State currentIndex: number = 0; + private controller: TabsController = new TabsController(); + @State infoMsg: string = 'no value'; + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('one') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + console.info("one will show"); + this.infoMsg='one will show'; + }) + .onWillHide(() => { + console.info("one will hide") + this.infoMsg='one will hide'; + }) + TabContent() { + Column(){ + Text('two') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + console.info("two will show"); + this.infoMsg='two will show'; + }) + .onWillHide(() => { + console.info("two will hide") + this.infoMsg='two will hide'; + }) + + TabContent() { + Column(){ + Text('three') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + console.info("three will show"); + this.infoMsg='three will show'; + }) + .onWillHide(() => { + console.info("three will hide") + this.infoMsg='three will hide'; + }) + + TabContent() { + Column(){ + Text('four') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + console.info("four will show"); + this.infoMsg='four will show'; + }) + .onWillHide(() => { + console.info("four will hide") + this.infoMsg='four will hide'; + }) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + /*.onChange((index: number) => { + this.currentIndex = index + this.infoMsg=('onChange,index='+index); + })*/ + .onContentWillChange((currentIndex, comingIndex) => { + this.infoMsg='will onContentWillChange' + comingIndex.toString(); + console.info('will onContentWillChange' + comingIndex.toString()); + return true + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsOnWillhide0170'); + + Text('' + this.infoMsg).id('tabsOnWillhide0170_003'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190.ets new file mode 100644 index 000000000..11a8ef87a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190.ets @@ -0,0 +1,89 @@ +/* + * 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 UIComponentNavTabsOnWillHide0190 { + @State msgInfo: string = ''; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + this.msgInfo = this.msgInfo + '\nPink will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + this.msgInfo = this.msgInfo + '\nYellow will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + this.msgInfo = this.msgInfo + '\nBlue will hide'; + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + this.msgInfo = this.msgInfo + '\nGreen will hide'; + }) + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillHide0190') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010.ets new file mode 100644 index 000000000..554e0cf9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010.ets @@ -0,0 +1,108 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0010 { + @State currentIndex: number = 0; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('oneContent') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + // console.info("one will show"); + this.errMsg='one will show'; + }); + + TabContent() { + Column(){ + Text('twoContent') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + // console.info("two will show"); + this.errMsg='two will show'; + }); + + TabContent() { + Column(){ + Text('threeContent') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + // console.info("three will show"); + this.errMsg='three will show'; + }); + + TabContent() { + Column(){ + Text('fourContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + // console.info("four will show"); + this.errMsg='four will show'; + }); + + TabContent() { + Column(){ + Text('fiveContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('five',4)) + .onWillShow(() => { + //console.info("five will show"); + this.errMsg='five will show'; + }); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + this.errMsg = 'onChange,index='+index.toString(); + //console.info('onChange,index='+index.toString()); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsOnWillshow0010'); + + + Text('' + this.errMsg).id('tabsOnWillshow0010_003'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020.ets new file mode 100644 index 000000000..043536092 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0020 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State currentIndex: number = 0; + @State nextIndex: string = 'no show'; + + @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) + } + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + Text('' + this.nextIndex).id('tabsOnWillshow0020_003'); + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show"); + this.nextIndex='Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show"); + this.nextIndex='Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show"); + this.nextIndex='Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show"); + this.nextIndex='Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + } + .title(this.NavigationTitle) + .titleMode(NavigationTitleMode.Full) + .hideTitleBar(false) + .hideToolBar(false) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }); + + + + }.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/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030.ets new file mode 100644 index 000000000..815d5d34e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030.ets @@ -0,0 +1,108 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0030 { + @State currentIndex: number = 2; + private controller: TabsController = new TabsController(); + @State nextIndex: string = 'no value'; + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('one') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + console.info("one will show"); + this.nextIndex='one will show'; + }) + .onWillHide(() => { + console.info("one will hide") + }) + TabContent() { + Column(){ + Text('two') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + console.info("two will show"); + this.nextIndex='two will show'; + }) + .onWillHide(() => { + console.info("two will hide") + }) + + TabContent() { + Column(){ + Text('three') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + console.info("three will show"); + this.nextIndex='three will show'; + }) + .onWillHide(() => { + console.info("three will hide") + }) + + TabContent() { + Column(){ + Text('four') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + console.info("four will show"); + this.nextIndex='four will show'; + }) + .onWillHide(() => { + console.info("four will hide") + }) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + /*.onChange((index: number) => { + this.currentIndex = index + this.nextIndex=('onChange,index='+index); + })*/ + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Text('' + this.nextIndex).id('tabsOnWillshow0030_003'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040.ets new file mode 100644 index 000000000..efca92532 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsOnWillShow0040 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillShow0040') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0040_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050.ets new file mode 100644 index 000000000..bbadb22c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsOnWillShow0050 { + @State direction1: Direction = Direction.Rtl; + @State nextIndex: string = 'no show'; + + + build() { + Column({ space: 5 }) { + Text("SubTabBarStyle sample") + Column() { + Tabs({ index:2, barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')) + .onWillShow(() => { + this.nextIndex = 'Pink will show'; + console.info("Pink will show"); + }) + .onWillHide(() => { + console.info("Pink will hide"); + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show"); + this.nextIndex = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide"); + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show"); + }) + .onWillHide(() => { + console.info("Blue will hide"); + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + this.nextIndex = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide"); + }) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsOnWillshow0050'); + + Text('' + this.nextIndex).id('tabsOnWillshow0050_003'); + }.width('100%').height(200); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060.ets new file mode 100644 index 000000000..8d23446f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsOnWillShow0060 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillShow0060') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0060_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070.ets new file mode 100644 index 000000000..ae7eaa1a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsOnWillShow0070 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillShow0070') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0070_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080.ets new file mode 100644 index 000000000..47c028915 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080.ets @@ -0,0 +1,84 @@ +/* + * 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 UIComponentNavTabsOnWillShow0080 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillShow0080') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0080_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100.ets new file mode 100644 index 000000000..67d7f316e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100.ets @@ -0,0 +1,127 @@ +/* + * 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 { uiObserver as observer } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit' +function callbackFunc(info: observer.TabContentInfo) { + console.info('tabContentUpdate', JSON.stringify(info)); +} + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0100 { + private controller: TabsController = new TabsController() + @State indicatorColor: Color = Color.Blue; + @State indicatorWidth: number = 40; + @State indicatorHeight: number = 10; + @State indicatorBorderRadius: number = 5; + @State indicatorSpace: number = 10; + @State subTabBorderRadius: number = 20; + @State mIndex: number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State dataArr: Array = new Array(); + @State msgInfo1: string = ''; + @State msgInfo2: string = ''; + + @State vertical: boolean = false + @State scrollable: boolean = false + + @State height1:number = 50 + // @State currentIndex: number = 1 + private tabsController: TabsController = new TabsController() + + aboutToAppear(): void { + for (let index = 1; index <= 3; index++) { + this.dataArr.push('page-' + index) + } + observer.on('tabContentUpdate', callbackFunc);//"state":0显示 "state":1 隐藏 + } + + aboutToDisappear(): void { + console.log('123') + observer.off('tabContentUpdate', callbackFunc);//不会有打印回调 + } + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start,index: this.mIndex, controller: this.controller }) { + ForEach(this.dataArr, (item: string, index: number) => { + TabContent() { + + Text(item) + .onAppear(()=>{ + console.info('Tabs_onAppear will123' + item.toString()); + this.msgInfo2='2. '+item+' trigger onAppear()'; + }) + .onDisAppear(()=>{ + console.info('Tabs_onDisAppear will123' + item.toString()) + }) + .width('100%') + // .height(this.height1) + .height('100%') + .backgroundColor(this.colors[index%5]) + .borderRadius('12vp') + .textAlign(TextAlign.Center) + + }.tabBar(SubTabBarStyle.of(item) + .indicator({ + color: this.indicatorColor, //下划线颜色 + height: this.indicatorHeight, //下划线高度 + width: this.indicatorWidth, //下划线宽度 + borderRadius: this.indicatorBorderRadius, //下划线圆角半径 + marginTop: this.indicatorSpace //下划线与文字间距 + }) + .selectedMode(this.selectedMode) + .board({ borderRadius: this.subTabBorderRadius }) + .labelStyle({}) + ) .onWillShow(() => { + console.info("Pink will show") + this.msgInfo1='1. '+ item+' trigger onWillShow()'; + }); + }, (item: string, index: number) => item + index) + } + // .fadingEdge(true) + .barBackgroundColor('#88888888') + .vertical(this.vertical) + .scrollable(this.scrollable) + .barMode(BarMode.Scrollable) + // .barWidth($r('app.float.boardSize_50')) + .barHeight(140) + .animationDuration(1000) + .edgeEffect(EdgeEffect.Spring) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height(320); + + Column({ space: 10 }) { + Button('尾部动态增加页面').height(30).onClick(() => { + this.dataArr.splice(this.dataArr.length, 0, '尾部动态增加') + this.mIndex = this.dataArr.length-1 + this.height1 = 100 + }).id('UIComponentNavTabsOnWillShow0100_001'); + + Button('尾部动态减少页面').height(30).onClick(() => { + this.dataArr.splice(this.dataArr.length-1, 1) + this.height1 = 200 + }).id('UIComponentNavTabsOnWillShow0100_002'); + Text(this.msgInfo1); + Text(this.msgInfo2) + } + }.width('auto').height('auto').padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110.ets new file mode 100644 index 000000000..b1785f9d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110.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. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillShow0110 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + this.msgInfo = 'Pink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = 'Yellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = 'Blue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = 'Green will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsOnWillShow0110') + .width(2000) + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { + this.msgInfo = 'trigger onVisibleAreaChange'; + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0110_001'); + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120.ets new file mode 100644 index 000000000..15b9b267f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120.ets @@ -0,0 +1,112 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0120 { + @State currentIndex: number = 2; + private controller: TabsController = new TabsController(); + @State nextIndex: string = 'no value'; + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('one') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + console.info("one will show"); + this.nextIndex='one will show'; + }) + .onWillHide(() => { + console.info("one will hide") + }) + TabContent() { + Column(){ + Text('two') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + console.info("two will show"); + this.nextIndex='two will show'; + }) + .onWillHide(() => { + console.info("two will hide") + }) + + TabContent() { + Column(){ + Text('three') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + console.info("three will show"); + this.nextIndex='three will show'; + }) + .onWillHide(() => { + console.info("three will hide") + }) + + TabContent() { + Column(){ + Text('four') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + console.info("four will show"); + this.nextIndex='four will show'; + }) + .onWillHide(() => { + console.info("four will hide") + }) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + this.nextIndex=('onChange,index='+index); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 4 + }); + Text('' + this.nextIndex).id('tabsOnWillshow0120_003'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130.ets new file mode 100644 index 000000000..90ffe5246 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0130 { + @State currentIndex: number = 2; + @State errMsg: string = ''; + private tabsController: TabsController = new TabsController(); + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.tabsController, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('oneContent') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + // console.info("one will show"); + this.errMsg='one will show'; + }); + + TabContent() { + Column(){ + Text('twoContent') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + // console.info("two will show"); + this.errMsg='two will show'; + }); + + TabContent() { + Column(){ + Text('threeContent') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + // console.info("three will show"); + this.errMsg='three will show'; + }); + + TabContent() { + Column(){ + Text('fourContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + // console.info("four will show"); + this.errMsg='four will show'; + }); + + TabContent() { + Column(){ + Text('fiveContent') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder('five',4)) + .onWillShow(() => { + //console.info("five will show"); + this.errMsg='five will show'; + }); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + this.errMsg = 'onChange,index='+index.toString(); + //console.info('onChange,index='+index.toString()); + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('tabsOnWillshow0130'); + + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = (this.currentIndex + 1) % 5 + this.tabsController.changeIndex(this.currentIndex) + }).id('tabsOnWillshow0130_001'); + + Text('' + this.errMsg).id('tabsOnWillshow0130_003'); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140.ets new file mode 100644 index 000000000..203857db2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0140 { + @State currentIndex: number = 2; + private controller: TabsController = new TabsController(); + @State nextIndex: string = 'no value'; + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('one') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + console.info("one will show"); + this.nextIndex='one will show'; + }) + .onWillHide(() => { + console.info("one will hide") + }) + TabContent() { + Column(){ + Text('two') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + console.info("two will show"); + this.nextIndex='two will show'; + }) + .onWillHide(() => { + console.info("two will hide") + }) + + TabContent() { + Column(){ + Text('three') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + console.info("three will show"); + this.nextIndex='three will show'; + }) + .onWillHide(() => { + console.info("three will hide") + }) + + TabContent() { + Column(){ + Text('four') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + console.info("four will show"); + this.nextIndex='four will show'; + }) + .onWillHide(() => { + console.info("four will hide") + }) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + /*.onChange((index: number) => { + this.currentIndex = index + this.nextIndex=('onChange,index='+index); + })*/ + .onTabBarClick((index: number) => { + this.currentIndex = index; + this.nextIndex='will onTabBarClick' + index.toString(); + console.info('will onTabBarClick' + index.toString()) + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Text('' + this.nextIndex).id('tabsOnWillshow0140_003'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150.ets new file mode 100644 index 000000000..bcdf2d8d3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150.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. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillShow0150 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + //this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = this.msgInfo + '\nBlue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = this.msgInfo + '\nGreen will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.msgInfo = this.msgInfo + '\nonAnimationStart'; + }) + .id('UIComponentNavTabsOnWillShow0150') + .width('100%') + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0150_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160.ets new file mode 100644 index 000000000..76b31fe7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160.ets @@ -0,0 +1,91 @@ +/* + * 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 UIComponentNavTabsOnWillShow0160 { + @State msgInfo: string = ''; + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + //this.msgInfo = this.msgInfo + '\nPink will show'; + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + this.msgInfo = this.msgInfo + '\nYellow will show'; + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + this.msgInfo = this.msgInfo + '\nBlue will show'; + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + .onWillShow(() => { + console.info("Green will show") + this.msgInfo = this.msgInfo + '\nGreen will show'; + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .animationDuration(3000) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + + }) + .id('UIComponentNavTabsOnWillShow0160') + .width('100%') + .onGestureSwipe((index: number, event: TabsAnimationEvent) => { + this.msgInfo = 'GestureSwipe'; + }) + .backgroundColor(0xF1F3F5); + Text(this.msgInfo); + Button("clear") + .onClick((event?: ClickEvent) => { + this.msgInfo ='' + }).id('UIComponentNavTabsOnWillShow0160_001') + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170.ets new file mode 100644 index 000000000..974a77581 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +@Entry +@Component +struct UIComponentNavTabsOnWillShow0170 { + @State currentIndex: number = 2; + private controller: TabsController = new TabsController(); + @State nextIndex: string = 'no value'; + + + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('one') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('one',0)) + .onWillShow(() => { + console.info("one will show"); + this.nextIndex='one will show'; + }) + .onWillHide(() => { + console.info("one will hide") + }) + TabContent() { + Column(){ + Text('two') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('two',1)) + .onWillShow(() => { + console.info("two will show"); + this.nextIndex='two will show'; + }) + .onWillHide(() => { + console.info("two will hide") + }) + + TabContent() { + Column(){ + Text('three') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('three',2)) + .onWillShow(() => { + console.info("three will show"); + this.nextIndex='three will show'; + }) + .onWillHide(() => { + console.info("three will hide") + }) + + TabContent() { + Column(){ + Text('four') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('four',3)) + .onWillShow(() => { + console.info("four will show"); + this.nextIndex='four will show'; + }) + .onWillHide(() => { + console.info("four will hide") + }) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + /*.onChange((index: number) => { + this.currentIndex = index + this.nextIndex=('onChange,index='+index); + })*/ + + .onContentWillChange((currentIndex, comingIndex) => { + this.nextIndex='will onContentWillChange' + comingIndex.toString(); + console.info('will onContentWillChange' + comingIndex.toString()); + return true + }) + + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Text('' + this.nextIndex).id('tabsOnWillshow0170_003'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003.ets new file mode 100644 index 000000000..9dbe08c10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx003 { + @State nextIndex:string = 'no_animation'; + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx003'); + + Text('' + this.nextIndex).id('tabsUx003_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004.ets new file mode 100644 index 000000000..8c0f1fc86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx004 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + + } + .vertical(false) + .animationDuration(-300) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx004'); + + Text('' + this.nextIndex).id('tabsUx004_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005.ets new file mode 100644 index 000000000..ffe5aa5c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx005 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + + } + .vertical(false) + .animationDuration(undefined) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx005'); + + Text('' + this.nextIndex).id('tabsUx005_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007.ets new file mode 100644 index 000000000..30050b743 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007.ets @@ -0,0 +1,75 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx007 { + @State nextIndex:string = 'no_animation'; + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + + } + .vertical(false) + .animationDuration(0) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx007'); + + Text('' + this.nextIndex).id('tabsUx007_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008.ets new file mode 100644 index 000000000..6fedb0a14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx008 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + + } + .vertical(false) + .animationDuration(300) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx008'); + + Text('' + this.nextIndex).id('tabsUx008_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009.ets new file mode 100644 index 000000000..863690c2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009.ets @@ -0,0 +1,70 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx009 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')); + + } + .vertical(false) + .scrollable(true) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx009'); + + Text('' + this.nextIndex).id('tabsUx009_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010.ets new file mode 100644 index 000000000..281037b29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010.ets @@ -0,0 +1,72 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx010 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')); + + } + .vertical(false) + .animationDuration(-300) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx010'); + + Text('' + this.nextIndex).id('tabsUx010_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011.ets new file mode 100644 index 000000000..dc23e1c66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011.ets @@ -0,0 +1,72 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx010 { + @State nextIndex:string = 'no_animation'; + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')); + + } + .vertical(false) + .animationDuration(undefined) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx010'); + + Text('' + this.nextIndex).id('tabsUx010_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012.ets new file mode 100644 index 000000000..cf5ce5b1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012.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 { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx012 { + @State nextIndex:string = 'no_animation'; + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')); + + } + .vertical(false) + .animationDuration(0) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx012'); + + Text('' + this.nextIndex).id('tabsUx012_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013.ets new file mode 100644 index 000000000..391d5809f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013.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. + */ +import { BusinessError } from '@kit.BasicServicesKit' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx013 { + @State nextIndex:string = 'no_animation'; + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')); + + } + .vertical(false) + .animationDuration(500) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx013'); + + Text('' + this.nextIndex).id('tabsUx013_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014.ets new file mode 100644 index 000000000..1cffc21c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx014 { + @State nextIndex:string = 'no_animation'; + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(`Tab${index + 1}`) + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + + } + .vertical(false) + /*.animationDuration(undefined) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='onAnimationStart' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='onAnimationEnd' + })*/ + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx014'); + + Text('' + this.nextIndex).id('tabsUx014_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015.ets new file mode 100644 index 000000000..072f43366 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx015 { + @State nextIndex:string = 'no_animation'; + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(`Tab${index + 1}`) + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + + } + .vertical(false) + .animationDuration(-100) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx015'); + + Text('' + this.nextIndex).id('tabsUx015_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016.ets new file mode 100644 index 000000000..496b02f81 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx016 { + @State nextIndex:string = 'no_animation'; + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(`Tab${index + 1}`) + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + + } + .vertical(false) + .animationDuration(undefined) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx016'); + + Text('' + this.nextIndex).id('tabsUx016_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017.ets new file mode 100644 index 000000000..57d7eaef5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx017 { + @State nextIndex:string = 'no_animation'; + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(`Tab${index + 1}`) + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + + } + .vertical(false) + .animationDuration(0) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx017'); + + Text('' + this.nextIndex).id('tabsUx017_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018.ets new file mode 100644 index 000000000..57cfd2331 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018.ets @@ -0,0 +1,89 @@ +/* + * 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' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +@Entry +@Component + +struct UIComponentNavTabsUx018 { + @State nextIndex:string = 'no_animation'; + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(`Tab${index + 1}`) + } + + + build() { + Column({ space: 5 }) { + + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + + } + .vertical(false) + .animationDuration(500) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + this.nextIndex='have_animation' + }) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('tabsUx018'); + + Text('' + this.nextIndex).id('tabsUx018_003'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019.ets new file mode 100644 index 000000000..e64c6d4aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019.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. + */ +import { Configuration, UIAbility } from '@kit.AbilityKit' +import { i18n, intl } from '@kit.LocalizationKit' +import { LengthMetrics } from '@kit.ArkUI' + +export class CommonUtil { + private static isRTL: boolean = i18n.isRTL((new intl.Locale()).language) + + public static setIsRTL(isRTL: boolean): void { + CommonUtil.isRTL = isRTL + } + + public static getIsRTL(): boolean { + return CommonUtil.isRTL + } +} + +export default class EntryAbility extends UIAbility { + onConfigurationUpdate(newConfig: Configuration): void { + // 监听系统配置变化 + if (newConfig.language) { + CommonUtil.setIsRTL(i18n.isRTL(newConfig.language)) + } + } +} + +interface itemType019 { + text: string, + backgroundColor: Color +} + +@Entry +@Component +struct UIComponentNavTabsUx019 { + @State currentIndex: number = 0; + @State msgInfo: string = 'begin'; + @State data: itemType019[] = [ + { + text: 'Red', + backgroundColor: Color.Red + }, + { + text: 'Yellow', + backgroundColor: Color.Yellow + }, + { + text: 'Blue', + backgroundColor: Color.Blue + }] + @State opacityList: number[] = [] + @State scaleList: number[] = [] + private durationList: number[] = [] + private timeoutList: number[] = [] + private customContentTransition: (from: number, to: number) => TabContentAnimatedTransition = (from: number, to: number) => { + let tabContentAnimatedTransition = { + timeout: this.timeoutList[from], + transition: (proxy: TabContentTransitionProxy) => { + this.scaleList[from] = 1.0 + this.scaleList[to] = 0.5 + this.opacityList[from] = 1.0 + this.opacityList[to] = 0.5 + animateTo({ + duration: this.durationList[from], + onFinish: () => { + proxy.finishTransition() + } + }, () => { + this.scaleList[from] = 0.5 + this.scaleList[to] = 1.0 + this.opacityList[from] = 0.5 + this.opacityList[to] = 1.0 + }) + } + } as TabContentAnimatedTransition + return tabContentAnimatedTransition + } + + aboutToAppear(): void { + let duration = 1000 + let timeout = 1000 + for (let i = 1; i <= this.data.length; i++) { + this.opacityList.push(1.0) + this.scaleList.push(1.0) + this.durationList.push(duration * i) + this.timeoutList.push(timeout * i) + } + } + + build() { + Column() { + Text(this.msgInfo); + Tabs() { + ForEach(this.data, (item: itemType019, index: number) => { + TabContent() { + } + .tabBar(new SubTabBarStyle(item.text).id(item.text)) + .backgroundColor(item.backgroundColor) + // 自定义动画变化透明度、缩放页面等 + .opacity(this.opacityList[index]) + .scale({ x: this.scaleList[index], y: this.scaleList[index] }) + }) + } + .backgroundColor(0xf1f3f5) + .width('100%') + .height(500) + .customContentTransition(this.customContentTransition) + .animationDuration(1000) + .onChange((index: number) => { + this.currentIndex = index // 监听索引index的变化,实现页签内容的切换。 + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。 + this.currentIndex = targetIndex + console.log('trigger onAnimationStart'); + this.msgInfo='trigger onAnimationStart'; + }) + .onAnimationEnd((index: number, event: TabsAnimationEvent) => { + console.log('trigger onAnimationEnd'); + this.msgInfo='trigger onAnimationEnd' + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022.ets new file mode 100644 index 000000000..1cdf4440e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022.ets @@ -0,0 +1,78 @@ +/* + * 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 UIComponentNavTabsUx022 { + build() { + Column({ space: 5 }) { + + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')) + .onWillShow(() => { + console.info("Yellow will show") + }) + .onWillHide(() => { + console.info("Yellow will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Red').id('Red')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(false) + .animationDuration(300) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('UIComponentNavTabsUx022'); + }.width('100%').height(400); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130.ets new file mode 100644 index 000000000..7f44b8186 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130.ets @@ -0,0 +1,70 @@ +/* + * 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 UIComponentOtherRefreshAbility0130 { + @State isRefreshing: boolean = false; + @State refreshOffset1: number = 64; + @State infoMsg: string = 'no_value'; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Button('change refresh parameter') + .margin(5) + .onClick(() => { + this.refreshOffset1 = this.refreshOffset1 + 10; + this.infoMsg = 'this.refreshOffset='+this.refreshOffset1; + }).id('refreshAbility0130_001'); + + Text('' + this.infoMsg).id('refreshAbility0130_003'); + + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(this.refreshOffset1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140.ets new file mode 100644 index 000000000..042259cda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0140 { + @State isRefreshing: boolean = false; + @State pullToRefresh1: boolean = false; + @State refreshOffset1: number = 64; + @State infoMsg: string = 'no_value'; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Button('change refresh parameter') + .margin(5) + .onClick(() => { + this.pullToRefresh1 = !this.pullToRefresh1; + this.refreshOffset1 = this.refreshOffset1 + 10; + this.infoMsg = 'this.pullToRefresh='+this.pullToRefresh1; + this.infoMsg += '\n'; + this.infoMsg += 'this.refreshOffset='+this.refreshOffset1; + }).id('refreshAbility0140_001'); + + Text('' + this.infoMsg).id('refreshAbility0140_003'); + + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh1) + .refreshOffset(this.refreshOffset1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150.ets new file mode 100644 index 000000000..6a9dddb9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150.ets @@ -0,0 +1,97 @@ +/* + * 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 UIComponentOtherRefreshAbility0150 { + @State isRefreshing: boolean = false; + @State pullToRefresh1: boolean = false; + @State refreshOffset1: number = 64; + @State infoMsg: string = 'no_value'; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32); + Text("Refreshing...").fontSize(16).margin({left:20}) + } + + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // С߶Լ֤Զ߶ˢ߶ȱ仯ʱԶ߶ȲminHeight + .width("100%") + } + + build() { + Column() { + Button('change refresh parameter') + .margin(5) + .onClick(() => { + this.pullToRefresh1 = !this.pullToRefresh1; + this.refreshOffset1 = this.refreshOffset1 + 10; + this.infoMsg = 'this.pullToRefresh='+this.pullToRefresh1; + this.infoMsg += '\n'; + this.infoMsg += 'this.refreshOffset='+this.refreshOffset1; + }).id('refreshAbility0150_001'); + + Text('' + this.infoMsg).id('refreshAbility0150_003'); + + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh1) + .refreshOffset(this.refreshOffset1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }); + + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160.ets new file mode 100644 index 000000000..2a0664140 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0160 { + @State isRefreshing: boolean = false; + @State refreshOffset: number = 60; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshAbility0160') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170.ets new file mode 100644 index 000000000..979067d86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170.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. + */ +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct UIComponentOtherRefreshAbility0170 { + @State isRefreshing: boolean = false; + @State refreshOffset: number = 60; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State isFullScreen: boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Column() { + Text("Refresh test") + Button('change hor') + .id('UIComponentOtherRefreshAbility0170_001') + .onClick(()=>{ + this.horVerSwitch(); + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshAbility0170_002') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180.ets new file mode 100644 index 000000000..d3bedfcb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0180 { + @State isRefreshing: boolean = false; + @State refreshOffset: number = 60; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshAbility0180_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .pullDownRatio(1) + .padding(10) + .margin(20) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010.ets new file mode 100644 index 000000000..dae01588d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010.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 UIComponentOtherRefreshAnimation0010 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0010'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020.ets new file mode 100644 index 000000000..a72c8b855 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020.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 UIComponentOtherRefreshAnimation0020 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0020'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030.ets new file mode 100644 index 000000000..e38ca90ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0030 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshAnimation0030') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040.ets new file mode 100644 index 000000000..eb4ac2f0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0040 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + .id('UIComponentOtherRefreshAnimation0040'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050.ets new file mode 100644 index 000000000..3ed12eb5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050.ets @@ -0,0 +1,68 @@ +/* + * 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 UIComponentOtherRefreshAnimation0050 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(96) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0050'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060.ets new file mode 100644 index 000000000..9c85d096e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0060 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + .id('UIComponentOtherRefreshAnimation0060'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070.ets new file mode 100644 index 000000000..622316130 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0070 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0070'); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080.ets new file mode 100644 index 000000000..6721fdaa8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0080 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0080'); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090.ets new file mode 100644 index 000000000..26424c14f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090.ets @@ -0,0 +1,108 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentOtherRefreshAnimation0090 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + @State arr: String[] = ['0', '1', '2', '3']; + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16'); + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 10; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0090'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100.ets new file mode 100644 index 000000000..72de61209 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0100 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + scroller: Scroller = new Scroller(); + @State arr: String[] = ['0', '1', '2', '3']; + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0100'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110.ets new file mode 100644 index 000000000..2dce547d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0110 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + scroller: Scroller = new Scroller(); + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State numbers: string[] = []; + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + Scroll() { + Column({ space: 5 }) { + Blank() + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(GridDirection.Row) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0110'); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130.ets new file mode 100644 index 000000000..399f58be1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0130 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0130'); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140.ets new file mode 100644 index 000000000..b28407893 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAnimation0140 { + @State isRefreshing: boolean = false; + @State msgLog1: string = 'Refresh onOffsetChange offset:0'; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6'] + + build() { + Column() { + Text(this.msgLog1); + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgLog1 = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(96) + .pullToRefresh(true) + .id('UIComponentOtherRefreshAnimation0140'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/WaterFlowDataSource.ets new file mode 100644 index 000000000..fb2bcd7aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAnimation/WaterFlowDataSource.ets @@ -0,0 +1,141 @@ +/* + * 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 WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010.ets new file mode 100644 index 000000000..de872a57f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0010 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0010') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020.ets new file mode 100644 index 000000000..5a25d334e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0020 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'no_value'; + @State infoMsg2: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0020_003'); + Text('' + this.infoMsg2).id('refreshInteraction0020_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0020_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + if(refreshStatus.toString() == '3') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030.ets new file mode 100644 index 000000000..38d265df0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030.ets @@ -0,0 +1,103 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0030 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'refreshOffset less than 96'; + @State infoMsg2: string = 'no_trigger'; + @State maxRefreshOffset: number = 0; + + + + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0030_003'); + Text('' + this.infoMsg2).id('refreshInteraction0030_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0030_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(96) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + /*f(refreshStatus.toString() == '3') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus;*/ + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + if(value > 96) + { + this.infoMsg1 = 'refreshOffset > 96'; + } + }) + + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('trigger onRefreshing test'); + this.infoMsg2 = 'trigger onRefreshing test'; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040.ets new file mode 100644 index 000000000..0a3ac56ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040.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. + */ + +import { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0040 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'refreshOffset less than 64'; + @State infoMsg2: string = 'no_trigger'; + @State maxRefreshOffset: number = 0; + + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0040_003'); + Text('' + this.infoMsg2).id('refreshInteraction0040_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0040_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + /*f(refreshStatus.toString() == '3') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus;*/ + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + if(value > 64) + { + this.infoMsg1 = 'refreshOffset > 64'; + } + }) + + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('trigger onRefreshing test'); + this.infoMsg2 = 'trigger onRefreshing test'; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050.ets new file mode 100644 index 000000000..4a635267e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050.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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0050 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: number = 0; + @State infoMsg2: number = 0; + @State maxRefreshOffset: number = 0; + + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0050_003'); + Text('' + this.infoMsg2).id('refreshInteraction0050_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0050_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + /*f(refreshStatus.toString() == '3') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus;*/ + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.infoMsg1 = value; + }) + + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('trigger onRefreshing test'); + this.infoMsg2 = 1; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060.ets new file mode 100644 index 000000000..72c308e11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0060 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0060') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(640) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070.ets new file mode 100644 index 000000000..65a6e5482 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070.ets @@ -0,0 +1,95 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0070 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: number = 0; + @State infoMsg2: number = 0; + @State maxRefreshOffset: number = 0; + + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0070_003'); + Text('' + this.infoMsg2).id('refreshInteraction0070_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0070_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + this.infoMsg2 = 1; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.infoMsg1 = value; + }) + + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('trigger onRefreshing test'); + + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080.ets new file mode 100644 index 000000000..48ee4c20f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0080 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0080') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090.ets new file mode 100644 index 000000000..4180c2367 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0090 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0090') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100.ets new file mode 100644 index 000000000..545527e8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100.ets @@ -0,0 +1,68 @@ +/* + * 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 UIComponentOtherRefreshInterAction0100 { + @State isRefreshing: boolean = false; + @State msgLog2: string = 'Refresh onStatueChange state is:4'; + + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Text(this.msgLog2); + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterAction0100') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + this.msgLog2 = 'Refresh onStatueChange state is:' + refreshStatus; + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .refreshOffset(64) + .pullToRefresh(true); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130.ets new file mode 100644 index 000000000..d07a5de27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0130 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0130') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170.ets new file mode 100644 index 000000000..4181f677c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0170 { + @State isRefreshing: boolean = false; + @State marginValue: number = 10; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0170') + .margin(this.marginValue) + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + this.marginValue +=10; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180.ets new file mode 100644 index 000000000..373176827 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0180 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'Refresh onStatueChange state is 0'; + @State infoMsg2: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0180_003'); + Text('' + this.infoMsg2).id('refreshInteraction0180_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0180_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(128) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + if(refreshStatus.toString() == '0') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190.ets new file mode 100644 index 000000000..cf8c77d73 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0190 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'no_value'; + @State infoMsg2: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0190_003'); + Text('' + this.infoMsg2).id('refreshInteraction0190_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0190_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(128) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + if(refreshStatus.toString() == '1') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200.ets new file mode 100644 index 000000000..6ec582de4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0200 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'no_value'; + @State infoMsg2: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0200_003'); + Text('' + this.infoMsg2).id('refreshInteraction0200_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0200_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + if(refreshStatus.toString() == '2') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210.ets new file mode 100644 index 000000000..c8f53d4fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0210 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State infoMsg1: string = 'no_value'; + @State infoMsg2: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshInteraction0210_003'); + Text('' + this.infoMsg2).id('refreshInteraction0210_004'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0210_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(1) + .pullToRefresh(true) + .refreshOffset(64) + + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + if(refreshStatus.toString() == '3') { + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + } + this.infoMsg2 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220.ets new file mode 100644 index 000000000..08d0493ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220.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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0220 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State ratio: number = 1; + @State infoMsg: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg).id('refreshInteraction0220_003'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshInteraction0220_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(this.ratio) + .pullToRefresh(true) + .refreshOffset(64) + .onOffsetChange((offset: number)=>{ + this.ratio = 1 - Math.pow((offset / this.maxRefreshingHeight), 3) // 越接近最大距离,下拉跟手系数越小 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + this.infoMsg = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240.ets new file mode 100644 index 000000000..37134bffe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0240 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0240') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + this.arr.splice(5,1); + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250.ets new file mode 100644 index 000000000..d11b8a336 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0250 { + @State isRefreshing: boolean = false + @State lanesNumber: number = 1 + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + @Builder + customRefreshComponent() { + Stack() { + Row() { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({ left: 20 }) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({ minHeight: 32 }) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, builder: this.customRefreshComponent() }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .lanes(this.lanesNumber) + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0250') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + this.lanesNumber += 1; + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260.ets new file mode 100644 index 000000000..20e18f9eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260.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. + */ +interface TimeTable { + title: string; + projects: string[]; +} + +@Entry +@Component +struct UIComponentOtherRefreshInterAction0260 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + customRefreshComponent() { + Stack() { + Row() { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({ left: 20 }) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({ minHeight: 32 }) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, builder: this.customRefreshComponent() }) { + List({ space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + .width('90%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0260') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270.ets new file mode 100644 index 000000000..42a3e27c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0270 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + @Builder + customRefreshComponent() { + Stack() { + Row() { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({ left: 20 }) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({ minHeight: 32 }) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, builder: this.customRefreshComponent() }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + TextInput() + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0270') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430.ets new file mode 100644 index 000000000..a4d433e18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430.ets @@ -0,0 +1,90 @@ +/* + * 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 UIComponentOtherRefreshInterAction0430 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + @Builder + customRefreshComponent() { + Scroll() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, builder: this.customRefreshComponent() }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .id('UIComponentOtherRefreshInterAction0430') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010.ets new file mode 100644 index 000000000..97dd6ac2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010.ets @@ -0,0 +1,96 @@ +/* + * 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 DataSource0010 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0010 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: DataSource0010 = new DataSource0010([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0010(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0010_001') + .cachedCount(2) + .index(0) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030.ets new file mode 100644 index 000000000..9b2992de0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030.ets @@ -0,0 +1,97 @@ +/* + * 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 DataSource0030 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0030 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: DataSource0030 = new DataSource0030([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0030(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0030_001') + .cachedCount(2) + .index(0) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .vertical(true) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040.ets new file mode 100644 index 000000000..77b4cf46b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040.ets @@ -0,0 +1,96 @@ +/* + * 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 MyDataSource0040 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0040 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: MyDataSource0040 = new MyDataSource0040([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new MyDataSource0040(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .cachedCount(2) + .index(0) + .autoPlay(true) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050.ets new file mode 100644 index 000000000..d521693c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050.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 DataSource0050 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0050 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + private swiperController: SwiperController = new SwiperController() + private data: DataSource0050 = new DataSource0050([]) + + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0050(list) + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0050_001') + .cachedCount(2) + .index(0) + .displayCount(2, true) + .interval(1000) + .indicator(Indicator.digit()// 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060.ets new file mode 100644 index 000000000..8456c39ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060.ets @@ -0,0 +1,97 @@ +/* + * 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 DataSource0060 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0060 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: DataSource0060 = new DataSource0060([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0060(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0060_001') + .cachedCount(2) + .index(0) + .disableSwipe(true) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070.ets new file mode 100644 index 000000000..26656b8be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070.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. + */ +class DataSource0070 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0070 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: DataSource0070 = new DataSource0070([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0070(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0070_001') + .nestedScroll(SwiperNestedScrollMode.SELF_ONLY) + .cachedCount(2) + .index(0) + .autoPlay(true) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080.ets new file mode 100644 index 000000000..31ddec869 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080.ets @@ -0,0 +1,97 @@ +/* + * 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 DataSource0080 implements IDataSource { + private list: number[] = [] + + constructor(list: number[]) { + this.list = list + } + + totalCount(): number { + return this.list.length + } + + getData(index: number): number { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0080 { + @State isRefreshing: boolean = false; + private swiperController: SwiperController = new SwiperController() + private data: DataSource0080 = new DataSource0080([]) + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 3; i++) { + list.push(i); + } + this.data = new DataSource0080(list) + } + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterConnection0080_001') + .nestedScroll(SwiperNestedScrollMode.SELF_FIRST) + .cachedCount(2) + .index(0) + .interval(1000) + .indicator(Indicator.digit() // 设置数字导航点样式 + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ size: 20, weight: FontWeight.Bold }) + .selectedDigitFont({ size: 20, weight: FontWeight.Normal })) + .loop(false) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110.ets new file mode 100644 index 000000000..f84b35225 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110.ets @@ -0,0 +1,47 @@ +/* + * 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 webview from '@ohos.web.webview' + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0110 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + controller: webview.WebviewController = new webview.WebviewController(); + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Web({ src: $rawfile("index.html"), controller: this.controller }) + .id('UIComponentOtherRefreshInterConnection0110_001') + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120.ets new file mode 100644 index 000000000..587aefe4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120.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. + */ +import webview from '@ohos.web.webview' + + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0120 { + @State isRefreshing: boolean = false; + controller: webview.WebviewController = new webview.WebviewController(); + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Web({ src: $rawfile("index.html"), controller: this.controller }) + .id('UIComponentOtherRefreshInterConnection0120_001') + .nestedScroll({ + scrollForward: NestedScrollMode.SELF_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST, + }) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130.ets new file mode 100644 index 000000000..7298ebb3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130.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. + */ +import webview from '@ohos.web.webview' + + +@Entry +@Component +struct UIComponentOtherRefreshInterConnection0130 { + @State isRefreshing: boolean = false; + controller: webview.WebviewController = new webview.WebviewController(); + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + Web({ src: $rawfile("index.html"), controller: this.controller }) + .id('UIComponentOtherRefreshInterConnection0130_001') + .nestedScroll({ + scrollForward: NestedScrollMode.PARALLEL, + scrollBackward: NestedScrollMode.PARALLEL, + }) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010.ets new file mode 100644 index 000000000..4b7fb5733 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010.ets @@ -0,0 +1,60 @@ +/* + * 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 UIComponentOtherRefreshInterface0010 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State RefreshStatus: RefreshStatus = RefreshStatus.Inactive; + + build() { + Column() { + Text("RefreshStatus" + this.RefreshStatus) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + + .onStateChange((refreshStatus: RefreshStatus) => { + this.RefreshStatus = refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020.ets new file mode 100644 index 000000000..4bf29a84d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020.ets @@ -0,0 +1,60 @@ +/* + * 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 UIComponentOtherRefreshInterface0020 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State RefreshStatus: RefreshStatus = RefreshStatus.Inactive; + + build() { + Column() { + Text("RefreshStatus" + this.RefreshStatus) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + + .onStateChange((refreshStatus: RefreshStatus) => { + this.RefreshStatus = refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030.ets new file mode 100644 index 000000000..7edd31833 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030.ets @@ -0,0 +1,60 @@ +/* + * 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 UIComponentOtherRefreshInterface0030 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State RefreshStatus: RefreshStatus = RefreshStatus.Inactive; + + build() { + Column() { + Text("RefreshStatus" + this.RefreshStatus) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + + .onStateChange((refreshStatus: RefreshStatus) => { + this.RefreshStatus = refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040.ets new file mode 100644 index 000000000..457919503 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040.ets @@ -0,0 +1,60 @@ +/* + * 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 UIComponentOtherRefreshInterface0040 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State RefreshStatus: RefreshStatus = RefreshStatus.Inactive; + + build() { + Column() { + Text("RefreshStatus" + this.RefreshStatus) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + + .onStateChange((refreshStatus: RefreshStatus) => { + this.RefreshStatus = refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130.ets new file mode 100644 index 000000000..e197f908f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0130 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160.ets new file mode 100644 index 000000000..7ec378a4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterface0160 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterface0160') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(150) + .pullDownRatio(1) + .pullToRefresh(true); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets index 07269db1e..d62317713 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets @@ -14,7 +14,7 @@ */ @Entry @Component -struct UIComponentOtherRefreshPromptText0170 { +struct UIComponentOtherRefreshInterface0170 { @State isRefreshing: boolean = false; @State promptText: string = "Refreshing..."; @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets index 49240b522..60fb0a2fc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets @@ -14,7 +14,7 @@ */ @Entry @Component -struct UIComponentOtherRefreshPromptText0180 { +struct UIComponentOtherRefreshInterface0180 { @State isRefreshing: boolean = false; @State promptText: string = "Refreshing..."; @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200.ets new file mode 100644 index 000000000..0aa1de9a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterface0200 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentOtherRefreshInterface0200') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(150) + .pullDownRatio(1) + .pullToRefresh(true); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100.ets new file mode 100644 index 000000000..3dffac58c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshOnOffsetChange0100 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State msgInfo: string = 'Refresh onOffsetChange offset:0'; + build() { + Column() { + Text(this.msgInfo); + Refresh({ refreshing: $$this.isRefreshing }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + .id('UIComponentOtherRefreshOnOffsetChange0100'); + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + this.msgInfo = 'Refresh onOffsetChange offset:' + value; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010.ets new file mode 100644 index 000000000..3d5262734 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010.ets @@ -0,0 +1,75 @@ +/* + * 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 UIComponentOtherRefreshPromptText0010 { + @State isRefreshing: boolean = false; + @State RefreshingTxt: Resource = $r("app.string.module_test_desc"); + @State infoMsg1: string = 'no trigger'; + @State infoMsg2: string = 'no trigger'; + @State refreshOffset: number = 0; + + + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshPrompttext0010_003'); + Text('' + this.infoMsg2).id('refreshPrompttext0010_004'); + Refresh({ refreshing: $$this.isRefreshing, promptText:this.RefreshingTxt}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshPrompttext0010_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .onOffsetChange((offset: number) => { + this.refreshOffset=offset; + this.infoMsg2 = 'this.refreshOffset=' + this.refreshOffset ; + }) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + + if(refreshStatus == 2 || refreshStatus == 3) + { + if(this.refreshOffset >= 96) { + + this.infoMsg1 = 'this.refreshOffset default is 96vp'; + } + } + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030.ets new file mode 100644 index 000000000..618ef240f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030.ets @@ -0,0 +1,76 @@ +/* + * 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 UIComponentOtherRefreshPromptText0030 { + @State isRefreshing: boolean = false; + @State RefreshingTxt: string = 'Refreshing...'; + @State infoMsg1: string = 'no trigger'; + @State infoMsg2: number = 0; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text(this.RefreshingTxt).fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue); + } + } + + build() { + Column() { + Text('' + this.infoMsg1).id('refreshPrompttext0030_003'); + Text('' + this.infoMsg2).id('refreshPrompttext0030_004'); + Refresh({ refreshing: $$this.isRefreshing, promptText: 'promptText123', builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshPrompttext0030_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + //.refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + this.infoMsg1 = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160.ets new file mode 100644 index 000000000..41b36f30a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160.ets @@ -0,0 +1,72 @@ +/* + * 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 UIComponentOtherRefreshPromptText0160 { + @State isRefreshing: boolean = false; + @State promptText: string | null = null; + @State offsetValue: number = 20; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + build() { + Column() { + Button('change offset') + .id('UIComponentOtherRefreshPromptText0160_001') + .onClick(() => { + this.offsetValue += 10; + }) + Refresh({ refreshing: this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentOtherRefreshPromptText0160_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(this.offsetValue) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170.ets new file mode 100644 index 000000000..dc7ee2350 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0170 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(false) + .refreshOffset(-100) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180.ets new file mode 100644 index 000000000..49240b522 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0180 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220.ets new file mode 100644 index 000000000..324c8daa8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220.ets @@ -0,0 +1,76 @@ +/* + * 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 common from '@ohos.app.ability.common'; +@Entry +@Component +struct UIComponentOtherRefreshPromptText0220 { + @State isRefreshing: boolean = false; + @State promptText: string = 'openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234'; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State isFullScreen: boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Column() { + Button('change hor') + .id('UIComponentOtherRefreshPromptText0220_001') + .onClick(()=>{ + this.horVerSwitch(); + }) + Refresh({ refreshing: this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentOtherRefreshPromptText0220_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230.ets new file mode 100644 index 000000000..7b55818fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0230 { + @State isRefreshing: boolean = false; + @State promptText: string = 'cde'; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Button('change promptText') + .id('UIComponentOtherRefreshPromptText0230_001') + .onClick(()=>{ + this.promptText = 'abc'; + }) + Refresh({ refreshing: this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentOtherRefreshPromptText0230_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240.ets new file mode 100644 index 000000000..8c5744d18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240.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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0240 { + @State isRefreshing: boolean = false; + @State promptText: string | undefined = undefined; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + build() { + Column() { + Refresh({ refreshing: this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250.ets new file mode 100644 index 000000000..e91c54db4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250.ets @@ -0,0 +1,59 @@ +/* + * 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 UIComponentOtherRefreshPromptText0250 { + @State isRefreshing: boolean = false; + @State promptText: string | null = null; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060.ets new file mode 100644 index 000000000..54e8abd88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060.ets @@ -0,0 +1,75 @@ +/* + * 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 UIComponentRefreshPulldownradio0060 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State ratio: number = 10; + @State refreshOffset: number = 80; + @State pullToRefresh: boolean = true; + + build() { + Column() { + Button('change') + .id('UIComponentRefreshPulldownradio0060_001') + .onClick(() => { + this.ratio += 10; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentRefreshPulldownradio0060_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh) + .refreshOffset(96) + .pullDownRatio(this.ratio) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120.ets new file mode 100644 index 000000000..c21ba599f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120.ets @@ -0,0 +1,76 @@ +/* + * 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 UIComponentRefreshPulldownradio0120 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State ratio: number = 10; + @State refreshOffset: number = 80; + @State pullToRefresh: boolean = true; + + build() { + Column() { + Button('change') + .id('UIComponentRefreshPulldownradio0120_001') + .onClick(() => { + this.ratio += 10; + this.refreshOffset = 50; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentRefreshPulldownradio0120_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh) + .refreshOffset(96) + .pullDownRatio(this.ratio) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130.ets new file mode 100644 index 000000000..a3e393a39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130.ets @@ -0,0 +1,76 @@ +/* + * 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 UIComponentRefreshPulldownradio0130 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State ratio: number = 10; + @State refreshOffset: number = 80; + @State pullToRefresh: boolean = true; + + build() { + Column() { + Button('change') + .id('UIComponentRefreshPulldownradio0130_001') + .onClick(() => { + this.ratio += 10; + this.pullToRefresh = !this.pullToRefresh; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentRefreshPulldownradio0130_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh) + .refreshOffset(96) + .pullDownRatio(this.ratio) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140.ets new file mode 100644 index 000000000..34cf825e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140.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 { ComponentContent } from '@ohos.arkui.node'; + +@Builder +function customRefreshingContent() { + Stack() { + Row() { + LoadingProgress().height(32) + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIComponentRefreshPulldownradio0140 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State maxRefreshingHeight: number = 100.0; + @State ratio: number = 1; + @State infoMsg: string = 'no_value'; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent)) + } + + build() { + Column() { + Text('' + this.infoMsg).id('refreshPullDownradio0140_003'); + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('refreshPullDownradio0140_001') + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullDownRatio(this.ratio) + .pullToRefresh(true) + .refreshOffset(64) + .onOffsetChange((offset: number)=>{ + this.ratio = 1 - Math.pow((offset / this.maxRefreshingHeight), 3) // 越接近最大距离,下拉跟手系数越小 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + this.infoMsg = 'Refresh onStatueChange state is ' + refreshStatus; + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160.ets new file mode 100644 index 000000000..d808343a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160.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. + */ +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct UIComponentRefreshPulldownradio0160 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State ratio: number = 10; + @State refreshOffset: number = 80; + @State pullToRefresh: boolean = true; + @State isFullScreen: boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Column() { + Button('change') + .id('UIComponentRefreshPulldownradio0160_001') + .onClick(() => { + this.horVerSwitch(); + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .id('UIComponentRefreshPulldownradio0160_002') + .backgroundColor(0x89CFF0) + .pullToRefresh(this.pullToRefresh) + .refreshOffset(96) + .pullDownRatio(this.ratio) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370.ets new file mode 100644 index 000000000..cbd3f4a0e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370.ets @@ -0,0 +1,76 @@ +/* + * 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 { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; +@Entry +@Component +struct UIComponentScrollSwiperTeace0370 { + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column({ space: 5 }) { + Column() { + Button('Landscape') + .onClick(() => { + this.changeOrientation(true); + }).id('UIComponentScrollSwiperTeace0370_001'); + Button('Portrait') + .onClick(() => { + this.changeOrientation(false); + }).id('UIComponentScrollSwiperTeace0370_002'); + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')); + + } + .vertical(false) + .scrollable(true) + .animationDuration(3000) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .id('UIComponentScrollSwiperTeace0370'); + + + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200.ets new file mode 100644 index 000000000..7fe1c10a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200.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. + */ +import { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0200 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')) + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')) + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Pink')) + + } + .id('UIComponentTabTabbarTabbarsymbol0200') + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210.ets new file mode 100644 index 000000000..05583d83d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210.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. + */ +import { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0210 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')) + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')) + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black').id('Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Pink').id('Pink')) + + } + .id('UIComponentTabTabbarTabbarsymbol0210') + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220.ets new file mode 100644 index 000000000..dd8766594 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220.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 { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0220 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')) + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')) + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black').id('Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Pink').id('Pink')) + + } + .id('UIComponentTabTabbarTabbarsymbol0220') + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296); + + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex = (this.currentIndex + 1) % 2 + this.controller.changeIndex(this.currentIndex) + }).id('UIComponentTabTabbarTabbarsymbol0220_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0010.ets new file mode 100644 index 000000000..f16924dc3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0010.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. + */ +@Entry +@Component +struct UIComponentTabsClip0010 { + private controller1: TabsController = new TabsController(); + @State dividerColor: string = 'red'; + @State strokeWidth: number = 2; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .borderRadius(20) + .clip(true) + .vertical(true) + .scrollable(true) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0020.ets new file mode 100644 index 000000000..d5b63551d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabsClip/UIComponentTabsClip0020.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. + */ +@Entry +@Component +struct UIComponentTabsClip0020 { + private controller1: TabsController = new TabsController(); + @State dividerColor: string = 'red'; + @State strokeWidth: number = 2; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .borderRadius(20) + .clip(false) + .vertical(true) + .scrollable(true) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060.ets new file mode 100644 index 000000000..fe4a67582 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060.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. + */ +@Entry +@Component +struct UIComponentUISupportColor1060 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.LIGHT; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Button('change colorMode') + .id('UIComponentUISupportColor1060_001') + .onClick(()=>{ + this.colorMode = ThemeColorMode.LIGHT; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070.ets new file mode 100644 index 000000000..a6645282d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070.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. + */ +@Entry +@Component +struct UIComponentUISupportColor1070 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.LIGHT; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Button('change colorMode') + .id('UIComponentUISupportColor1070_001') + .onClick(()=>{ + this.colorMode = ThemeColorMode.DARK; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080.ets new file mode 100644 index 000000000..0c871e2e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080.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. + */ +@Entry +@Component +struct UIComponentUISupportColor1080 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.DARK; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Button('change colorMode') + .id('UIComponentUISupportColor1080_001') + .onClick(()=>{ + this.colorMode = ThemeColorMode.LIGHT; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090.ets new file mode 100644 index 000000000..514301bf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090.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. + */ +@Entry +@Component +struct UIComponentUISupportColor1090 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.DARK; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Button('change colorMode') + .id('UIComponentUISupportColor1090_001') + .onClick(()=>{ + this.colorMode = ThemeColorMode.DARK; + }) + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100.ets new file mode 100644 index 000000000..6c72489b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100.ets @@ -0,0 +1,62 @@ +/* + * 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 UIComponentUISupportColor1100 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.LIGHT; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110.ets new file mode 100644 index 000000000..df07ed245 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110.ets @@ -0,0 +1,62 @@ +/* + * 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 UIComponentUISupportColor1110 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + @State colorMode: ThemeColorMode = ThemeColorMode.DARK; + + build() { + WithTheme({ colorMode: this.colorMode }) { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText }) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor($r('sys.color.background_primary')) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(100) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010.ets new file mode 100644 index 000000000..6514d17bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010.ets @@ -0,0 +1,183 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +import image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentWaterFlowFooter0010 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number =0 + @State layoutMode1: number|undefined|null=1 + @State bool:boolean=true + // @State layoutMode1:number=1 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + + Column({ space: 2 }) { + Scroll() { + Column() { + Row(){ + Button('默认布局').height(40).onClick(() => { + this.layoutMode1 = 0 + }) + Button('移动窗口布局').height(40).onClick(() => { + this.layoutMode1 = 1 + + }) + + } + Row(){ + Button('单独节点显隐:'+`${this.visibilitys[this.Visibilitynum%3]}`) + .onClick((event: ClickEvent) => { + this.Visibilitynum++ + }) + Button("footer显隐:"+this.flag ) + .onClick(() => { + this.flag=!this.flag + }).id('UIComponentWaterFlowFooter0010_001'); + } + } + } .border({width:1}).margin({left:2}) + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + } + .visibility(this.visibilitys[this.Visibilitynum%3]) + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.img2')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(this.colors[item % 5]) + }, (item: string, index: number) => item + index+Math.random()) + } + .id('UIComponentWaterFlowFooter0010') + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Black) + .width(350) + .height('40%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/WaterFlowDataSource.ets new file mode 100644 index 000000000..70577a8fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowFooter/WaterFlowDataSource.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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdded(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChanged(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDeleted(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMoved(from, to) + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public Add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public AddLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public AddItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public Delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public Delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public DeleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public Reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 10) + this.notifyDataReload() + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270.ets new file mode 100644 index 000000000..532c700df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270.ets @@ -0,0 +1,108 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentWaterFlowSliding0270 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemHeader() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + FlowItem() { + Column() { + Text("N9999").fontSize(12).height('16') + } + } + + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .visibility(Visibility.None) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320.ets new file mode 100644 index 000000000..ddbe1f95b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320.ets @@ -0,0 +1,182 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource1' +import { LengthMetrics } from '@kit.ArkUI' + +import image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentWaterFlowSliding0320 { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State onReachText: string = '' + @State columnsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr','null', '0.5fr', 'abc' ,'repeat(auto-fill,100)','undefined'] + @State columnsTemplateNum: number = 0 + @State columnsGap: [string, string, number] = ['5vp', 'abc', 10] + @State columnsGapNum: number = 0 + @State rowsTemplate: string[] = ['1fr 1fr 2fr', '1fr 1fr 0fr', '0.5fr', 'abc' ,'repeat(auto-fill,100)'] + @State rowsTemplateNum: number = 0 + @State rowsGap: [string, string, number] = ['5vp', 'abc', 10] + @State rowsGapNum: number = 0 + @State layoutDirection: FlexDirection[] = [FlexDirection.Column, FlexDirection.ColumnReverse, FlexDirection.RowReverse, FlexDirection.Row] + @State layoutDirectionNum: number = 0 + @State fatherPadding: number = 0 + @State fatherMargin: number = 0 + @State safePadding:number=30 + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + @State rotation: number = 0 + @State data: number[] = [] + @State smooth:boolean=false + @State directions :Direction[]=[Direction.Auto,Direction.Ltr,Direction.Rtl] + @State Direction : number = 0 + @State layoutMode1: number|undefined|null=0 + @State bool:boolean=true + //@State layoutMode1:number=0 + @State extraoffsetnum:number=0 + @State extraoffsets:number[]=[0,-1.5,20,100,50,-1000,500,100000] + @State ScrollAlign:number=0 + @State ScrollAligns:ScrollAlign[]=[ScrollAlign.START,ScrollAlign.CENTER,ScrollAlign.END,ScrollAlign.AUTO] + @State text1:string='' + @State height1:number=50 + // + @State visibilitys:Visibility[]=[Visibility.Visible,Visibility.Hidden,Visibility.None] + @State Visibilitynum:number=0 + @State canoverscroll:boolean=true + + // + @State flag :boolean = true + // + @State clipNum:number=0 + @State text2:string='' + @State bool1:boolean=true + @State bool2:boolean=true + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(200) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + if(this.flag) { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + }else{} + } + + build() { + + Column({ space: 2 }) { + Scroll() { + Column() { + Row(){ + Button('默认布局').height(40).onClick(() => { + this.layoutMode1 = 0 + }) + Button('移动窗口布局').height(40).onClick(() => { + this.layoutMode1 = 1 + + }).id('UIComponentWaterFlowSliding0320_001'); + + } + Row(){ + Button('单独节点显隐:'+`${this.visibilitys[this.Visibilitynum%3]}`) + .onClick((event: ClickEvent) => { + this.Visibilitynum++ + }) + Button("footer显隐:"+this.flag ) + .onClick(() => { + this.flag=!this.flag + }).id('UIComponentWaterFlowSliding0320_002'); + } + } + } .border({width:1}).margin({left:2}) + Column(){ + }.height('10%') + WaterFlow({ footer: this.itemFoot, scroller: this.scroller, layoutMode:this.layoutMode1}) { + FlowItem() { + Text("TopItem") + .width(60).height(this.height1) + .fontColor(Color.White) + .backgroundColor(Color.Brown) + }.visibility(this.visibilitys[this.Visibilitynum%3]); + LazyForEach(this.datasource, (item: number,index:number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.img2')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(this.colors[item % 5]) + }, (item: string, index: number) => item + index+Math.random()) + } + .id('UIComponentWaterFlowSliding0320') + .padding(this.fatherPadding) + .direction(this.directions[this.Direction]) + .edgeEffect(EdgeEffect.Spring,{alwaysEnabled:true}) + .scrollBar(BarState.Auto) + .scrollBarWidth(20) + .enableScrollInteraction(this.bool) + .columnsTemplate(this.columnsTemplate[this.columnsTemplateNum]) + .rowsTemplate(this.rowsTemplate[this.rowsTemplateNum]) + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(this.columnsGap[this.columnsGapNum]) + .rowsGap(this.rowsGap[this.rowsGapNum]) + .onScrollIndex((first: number, last: number) => { + console.info('onScrollIndex-' + 'first:' + first + '、last:' + last) + }) + .backgroundColor(Color.Black) + .width(350) + .height('40%') + .border({width:1}) + .layoutDirection(this.layoutDirection[this.layoutDirectionNum]) + .margin(this.fatherMargin) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470.ets new file mode 100644 index 000000000..522204656 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470.ets @@ -0,0 +1,128 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentWaterFlowSliding0470 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State newPosition: Position = {x:100,y:100} + @State newPosition1: Position = {x:50,y:50} + @State newPosition2: Position = {x:100,y:100} + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('change position') + .height('5%') + .onClick(() => { + if(this.newPosition == this.newPosition1) + { + this.newPosition = this.newPosition2; + } + else + { + this.newPosition = this.newPosition1; + } + }) + .id('UIComponentWaterFlowSliding0470_001') + .margin({ top: 10, left: 20 }) + + WaterFlow({ layoutMode: 1 }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .id('UIComponentWaterFlowSliding0470') + .offset(this.newPosition) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480.ets new file mode 100644 index 000000000..ac28df1eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480.ets @@ -0,0 +1,126 @@ +/* + * 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentWaterFlowSliding0480 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State newMargin: number = 0 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(200) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('change margin') + .height('5%') + .onClick(() => { + if(this.newMargin == 100) + { + this.newMargin = 0; + } + else + { + this.newMargin = 100; + } + }) + .id('UIComponentWaterFlowSliding0480_001') + .margin({ top: 10, left: 20 }) + + WaterFlow({ layoutMode: 1 }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .id('UIComponentWaterFlowSliding0480') + .margin(this.newMargin) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource.ets new file mode 100644 index 000000000..2d6f4b1ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource1.ets new file mode 100644 index 000000000..1b7ef412b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentWaterFlowSliding/WaterFlowDataSource1.ets @@ -0,0 +1,142 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030.ets new file mode 100644 index 000000000..f5d9664a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030.ets @@ -0,0 +1,90 @@ +/* + * 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 { ComponentContent } from '@ohos.arkui.node'; + +class Params { + refreshStatus: RefreshStatus = RefreshStatus.Inactive + + constructor(refreshStatus: RefreshStatus) { + this.refreshStatus = refreshStatus; + } +} + +@Builder +function customRefreshingContent(params:Params) { + Stack() { + Row() { + LoadingProgress().height(32) + Text("refreshStatus: "+params.refreshStatus).fontSize(16).margin({left:20}).id('refreshComponentcontent0030_003'); + } + .alignItems(VerticalAlign.Center) + } + .align(Alignment.Center) + .clip(true) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") +} + +@Entry +@Component +struct UIRefreshComponentContent0030 { + @State isRefreshing: boolean = false; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + @State refreshStatus: RefreshStatus = RefreshStatus.Inactive; + private contentNode?: ComponentContent = undefined; + + aboutToAppear():void { + let uiContext = this.getUIContext(); + this.contentNode = new ComponentContent(uiContext, wrapBuilder(customRefreshingContent), new Params(this.refreshStatus)) + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, refreshingContent:this.contentNode}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .id('refreshComponentcontent0030_001') + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + this.refreshStatus = refreshStatus + this.contentNode?.update(new Params(this.refreshStatus)) // 更新自定义组件内容 + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower1.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..29cc6c27358b19227f89bc2764761bd84e40cb3a GIT binary patch literal 21001 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 RcyCHk(ZFYCwE@f?|37*5=_CLE literal 0 HcmV?d00001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower2.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/flower2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ebb21d26e2793d751a6dba71fff81540fdfaabe2 GIT binary patch literal 58438 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 literal 0 HcmV?d00001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92..0ace47383 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1801,6 +1801,300 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0360", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0380", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0370", + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737", + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350737142", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0430", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0440", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0450", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0460", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0470", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0480", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0490", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0550", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0060", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0580", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0090", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0180", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0130", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0140", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0037", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0280", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0290", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0110", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0170", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0020", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0140", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0160", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0150", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface0170", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0320", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0190", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0200", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0210", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0220", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0230", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0240", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0080", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0100", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0110", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0070", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0040", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0060", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0150", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0160", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0010", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0020", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0030", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0050", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0120", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0130", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0140", + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0170", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0110", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0100", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0020", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0030", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0040", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0050", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0060", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0070", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0080", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0120", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0130", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0140", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0150", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0160", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0170", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0010", + "testability/pages/UIComponentNavTabsOnWillHide/UIComponentNavTabsOnWillHide0190", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0130", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0140", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0150", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0160", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0170", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0180", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0100", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0130", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0430", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0170", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0250", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0260", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0240", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0270", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0010", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0060", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0080", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0020", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0030", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0040", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0050", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0070", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0090", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0180", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0190", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0200", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0210", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0220", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0010", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0020", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0030", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0040", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0130", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0160", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0200", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0010", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0030", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0160", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0170", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0180", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0220", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0230", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0240", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0250", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0200", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0210", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0220", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0100", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0170", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0180", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0190", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0200", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0210", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0220", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160", + "testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0270", + "testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0470", + "testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0480", + "testability/pages/UIComponentWaterFlowSliding/UIComponentWaterFlowSliding0320", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0040", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0050", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0060", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0070", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0080", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0090", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0100", + "testability/pages/ArkUIAnimatedResponse/ArkUIAnimatedResponse0110", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0020", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0030", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0050", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0090", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0140", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0010", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0040", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0060", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0070", + "testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0019", + "testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated003", + "testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated005", + "testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated007", + "testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012", + "testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated015", + "testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0010", + "testability/pages/UIComponentNavTabsNest/UIComponentNavTabsNest0020", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx003", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx004", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx005", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx007", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx008", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx009", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx010", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx011", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx012", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx013", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx014", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx015", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx016", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx017", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx018", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx019", + "testability/pages/UIComponentNavTabsUx/UIComponentNavTabsUx022", + "testability/pages/UIComponentNavTabsLayout/UIComponentNavTabsLayout0070", + "testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0070", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0080", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0110", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0100", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0090", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0140", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0050", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0020", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0010", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0040", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0060", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0130", + "testability/pages/UIComponentOtherRefreshAnimation/UIComponentOtherRefreshAnimation0030", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0040", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0110", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0130", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0120", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0010", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0030", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0060", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0050", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0080", + "testability/pages/UIComponentOtherRefreshInterConnection/UIComponentOtherRefreshInterConnection0070", + "testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0020", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0030", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0040", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0010", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0160", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0060", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0050", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0170", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0100", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0150", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0110", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0120", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0130", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0200", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0210", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0070", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0080", + "testability/pages/UIComponentNavTabsObserver/UIComponentNavTabsObserver0090", + "testability/pages/UIComponentWaterFlowFooter/UIComponentWaterFlowFooter0010", + "testability/pages/UIComponentTabsClip/UIComponentTabsClip0020", + "testability/pages/UIComponentTabsClip/UIComponentTabsClip0010", + "testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0130", + "testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0120", + "testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0140", + "testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0060", + "testability/pages/UIComponentRefreshPulldownradio/UIComponentRefreshPulldownradio0160", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1060", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1070", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1080", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1090", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1100", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1110", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0540791", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0530136", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0510711", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0550659", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0570768", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0560601", + "testability/pages/UIComponentListAndGridXommonOnscroll/UIComponentListAndGridXommonOnscroll0680459", + "testability/pages/UIComponentNavTabs/UIComponentNavTabs0010", + "testability/pages/UIRefreshComponentContent/UIRefreshComponentContent0030", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0010", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0020", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0030", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0040", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0050", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0060", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0070", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0080", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0090", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0100", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0110", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0120", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0130", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0140", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0150", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0160", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0170", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0180", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0190", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0200", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0210", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0220", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0230", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0240", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0250", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0260", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0270", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount0300", + "testability/pages/UIComponentNavTabsOnChange/UIComponentNavTabsOnChange0010", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0080380", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0200448", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0240733", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0230655", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0250294", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0290143", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0280114", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0180890", + "testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0090043", + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0380", + "testability/pages/UIComponentListAndGridWaterflowSections/UIComponentListAndGridWaterflowSections0460211", + "testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141656824", + "testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141", + "testability/pages/UIComponentListAndGridWaterflowGetItemMainSizeByIndex/UIComponentListAndGridWaterflowGetItemMainSizeByIndex0010141624", + "testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0180721", + "testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0150660", + "testability/pages/UIComponentListAndGridWaterflowSpring/UIComponentListAndGridWaterflowSpring0250290" ] } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/index.html b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/index.html new file mode 100644 index 000000000..565132cc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/index.html @@ -0,0 +1,11 @@ + + + + + + Hello World + + +

Hello, World!

+ + \ No newline at end of file -- Gitee From 1f482da0bce7bb631dee94a728fd0f60f308e5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9D=E8=BF=AA?= Date: Wed, 8 Jan 2025 15:41:20 +0800 Subject: [PATCH 2/3] add beforeEach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ArkUIAnimatedResponse.test.ets | 22 ++++++++++++++++++- .../ArkUITabScrollable.test.ets | 20 +++++++++++++++++ .../ArkUITabsIconStyleSelectedColor.test.ets | 21 +++++++++++++++++- ...ArkUITabsIconStyleUnselectedColor.test.ets | 21 +++++++++++++++++- .../ArkUITabsLabelStyleSelectedColor.test.ets | 22 ++++++++++++++++++- ...rkUITabsLabelStyleUnselectedColor.test.ets | 21 +++++++++++++++++- .../ArkUITabsLabelStylefont.test.ets | 21 +++++++++++++++++- .../ArkUITabsSingleSelectedcolor.test.ets | 22 ++++++++++++++++++- .../ArkUITabsSingleUnselectedcolor.test.ets | 21 +++++++++++++++++- .../ArkUITabsVertical.test.ets | 21 +++++++++++++++++- .../FunctionJichuWaterFlow.test.ets | 21 +++++++++++++++++- ...IComponentListAndGridWaterFlowAdd.test.ets | 21 +++++++++++++++++- ...ComponentListAndGridWaterSections.test.ets | 21 +++++++++++++++++- ...idWaterflowGetItemMainSizeByIndex.test.ets | 21 +++++++++++++++++- ...onentListAndGridWaterflowSections.test.ets | 21 +++++++++++++++++- ...mponentListAndGridWaterflowSpring.test.ets | 21 +++++++++++++++++- ...omponentListAndGridXommonOnscroll.test.ets | 22 ++++++++++++++++++- ...tandgridWaterflowEventenhancement.test.ets | 21 +++++++++++++++++- .../UIComponentNavModifier.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsAction.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsAnimated.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsBlurStyle.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsCachedCount.test.ets | 21 +++++++++++++++++- ...onentNavTabsCapabilityEnhancement.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsContentAdapt.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsEdgeeffect.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsExpandsafearea.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsHeight.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsImproTrace.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsInterception.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsInterface.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsLayout.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsMirror.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsNest.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsObserver.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsOnChange.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsOnWillHide.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsOnWillShow.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsSubTabbarStyle.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabs.test.ets | 20 ++++++++++++++++- .../UIComponentNavTabsUx.test.ets | 21 +++++++++++++++++- .../UIComponentNavTabsWidth.test.ets | 20 ++++++++++++++++- .../UIComponentOtherRefreshAbility.test.ets | 21 +++++++++++++++++- .../UIComponentOtherRefreshAnimation.test.ets | 20 ++++++++++++++++- ...IComponentOtherRefreshInterAction.test.ets | 21 +++++++++++++++++- ...ponentOtherRefreshInterConnection.test.ets | 21 +++++++++++++++++- .../UIComponentOtherRefreshInterface.test.ets | 21 +++++++++++++++++- ...mponentOtherRefreshOnOffsetChange.test.ets | 21 +++++++++++++++++- ...UIComponentOtherRefreshPromptText.test.ets | 21 +++++++++++++++++- .../UIComponentRefreshPulldownradio.test.ets | 21 +++++++++++++++++- .../UIComponentTabTabBarSymbol.test.ets | 21 +++++++++++++++++- .../UIComponentTabsClip.test.ets | 21 +++++++++++++++++- .../UIComponentWaterFlowFooter.test.ets | 21 +++++++++++++++++- .../UIComponentWaterFlowSliding.test.ets | 21 +++++++++++++++++- .../UIRefreshComponentContent.test.ets | 21 +++++++++++++++++- 55 files changed, 1101 insertions(+), 54 deletions(-) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets index f82e9bcc6..f8a3a2791 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets @@ -18,10 +18,30 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUIAnimatedResponse() { describe('ArkUIAnimatedResponse', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets index 92546b19a..bcd507d2b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -18,10 +18,30 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabScrollable() { describe('ArkUITabScrollable', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets index f14cafdd0..cda0ce331 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsIconStyleSelectedColor() { describe('ArkUITabsIconStyleSelectedColor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets index 59ae60edc..c85c75e7e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -19,10 +19,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsIconStyleUnselectedColor() { describe('ArkUITabsIconStyleUnselectedColor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets index 20bc4b030..245ff231a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -18,10 +18,30 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStyleSelectedColor() { describe('ArkUITabsLabelStyleSelectedColor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets index 2c34e10be..18dde585e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStyleUnselectedColor() { describe('ArkUITabsLabelStyleUnselectedColor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets index 1b981023c..9ec4875ed 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStylefont() { describe('ArkUITabsLabelStylefont', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets index aaf0374fa..cdbf70e42 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -19,10 +19,30 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsSingleSelectedcolor() { describe('ArkUITabsSingleSelectedcolor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets index c340ddbb0..7e306a20d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -19,10 +19,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsSingleUnselectedcolor() { describe('ArkUITabsSingleUnselectedcolor', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets index d206dfca0..97affa88b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsVertical() { describe('ArkUITabsVertical', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets index ed40d544f..21f5fbddb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function FunctionJichuWaterFlow() { describe('FunctionJichuWaterFlow', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets index 39fd93b6c..7a71cb251 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterFlowAdd() { describe('UIComponentListAndGridWaterFlowAdd', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets index b42c2ac64..d536b2d11 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterSections() { describe('UIComponentListAndGridWaterSections', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets index ab2b0dcf8..7acca6cb6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets @@ -19,10 +19,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterflowGetItemMainSizeByIndex() { describe('UIComponentListAndGridWaterflowGetItemMainSizeByIndex', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets index b755c3a0f..2ec39db4d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets @@ -19,10 +19,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterflowSections() { describe('UIComponentListAndGridWaterflowSections', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets index 84f16aca4..b2ac6c635 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets @@ -19,10 +19,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterflowSpring() { describe('UIComponentListAndGridWaterflowSpring', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets index da988f20f..46ccfb561 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets @@ -18,10 +18,30 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridXommonOnscroll() { describe('UIComponentListAndGridXommonOnscroll', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets index 52f6de3f1..4b1c72d1f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets @@ -20,10 +20,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListandgridWaterflowEventenhancement() { describe('UIComponentListandgridWaterflowEventenhancement', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets index 6521f74b7..f70472b83 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavModifier() { describe('UIComponentNavModifier', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets index 7daa0bd7b..8db9b0be0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsAction() { describe('UIComponentNavTabsAction', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets index d50bd93cc..18a9c79fd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsAnimated() { describe('UIComponentNavTabsAnimated', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets index 703244ca8..8c9dbdb6a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsBlurStyle() { describe('UIComponentNavTabsBlurStyle', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets index 7e575844a..fc6d78123 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsCachedCount() { describe('UIComponentNavTabsCachedCount', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets index 21df0cae8..fcdd70d99 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsCapabilityEnhancement() { describe('UIComponentNavTabsCapabilityEnhancement', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets index c93a6cef0..2d543981f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsContentAdapt() { describe('UIComponentNavTabsContentAdapt', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets index 09415a275..756bce6ec 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsEdgeeffect() { describe('UIComponentNavTabsEdgeeffect', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets index 755b58cf2..d478148a8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsExpandsafearea() { describe('UIComponentNavTabsExpandsafearea', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets index 3e8ebdf16..ebfcae44c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsHeight() { describe('UIComponentNavTabsHeight', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets index 6029c6f08..4dd9b020d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsImproTrace() { describe('UIComponentNavTabsImproTrace', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets index fc4f1fe7f..b943529d8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsInterception() { describe('UIComponentNavTabsInterception', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets index f8547087e..d2320df7f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsInterface() { describe('UIComponentNavTabsInterface', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets index 697766a31..63440a195 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsLayout() { describe('UIComponentNavTabsLayout', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets index 2d1177a13..a22b9c2e3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsMirror() { describe('UIComponentNavTabsMirror', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets index 90bf024df..2d9f96dcd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsNest() { describe('UIComponentNavTabsNest', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets index f9939cdcf..926402383 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsObserver() { describe('UIComponentNavTabsObserver', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets index 7425d19e5..20c0ffc81 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsOnChange() { describe('UIComponentNavTabsOnChange', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets index 13cc5ed3d..83c6d82ef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsOnWillHide() { describe('UIComponentNavTabsOnWillHide', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets index d64393ea9..db11c6289 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsOnWillShow() { describe('UIComponentNavTabsOnWillShow', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets index 5520f61e1..2f89da30c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsSubTabbarStyle() { describe('UIComponentNavTabsSubTabbarStyle', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets index f4a5ac116..770a41b5f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets @@ -18,10 +18,28 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabs() { describe('UIComponentNavTabs', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets index 14b4bfe65..7414289e1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsUx() { describe('UIComponentNavTabsUx', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets index 18ddd5a88..3dd13e6d2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -18,10 +18,28 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsWidth() { describe('UIComponentNavTabsWidth', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets index 4919af5ec..7d5da66e3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshAbility() { describe('UIComponentOtherRefreshAbility', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets index b5d51adaa..bac58523c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets @@ -18,10 +18,28 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshAnimation() { describe('UIComponentOtherRefreshAnimation', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets index 93a10ad7a..7a74be6fc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshInterAction() { describe('UIComponentOtherRefreshInterAction', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets index c5f465451..fc648bba3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshInterConnection() { describe('UIComponentOtherRefreshInterConnection', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets index 66bd2e257..c13729fe3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshInterface() { describe('UIComponentOtherRefreshInterface', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets index 4273a8a42..387f573e8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshOnOffsetChange() { describe('UIComponentOtherRefreshOnOffsetChange', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets index dfb5c459d..cc0ce3a2e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshPromptText() { describe('UIComponentOtherRefreshPromptText', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets index 0b406af2b..f3918e50b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentRefreshPulldownradio() { describe('UIComponentRefreshPulldownradio', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets index c9e99a8b5..98acf62a6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentTabTabBarSymbol() { describe('UIComponentTabTabBarSymbol', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets index 44689a0a3..31f87a2f9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentTabsClip() { describe('UIComponentTabsClip', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets index d2340ef70..d352896fe 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentWaterFlowFooter() { describe('UIComponentWaterFlowFooter', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets index 00b935978..c2b2e1f6b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentWaterFlowSliding() { describe('UIComponentWaterFlowSliding', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets index 5a3b73721..38a327bef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets @@ -18,10 +18,29 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' - +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIRefreshComponentContent() { describe('UIRefreshComponentContent', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + afterEach(async (done: Function) => { if (Settings.windowClass == undefined) { return -- Gitee From 1342a827c3e32ebef5619fcf8f053bda4b1ddb02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9D=E8=BF=AA?= Date: Mon, 20 Jan 2025 11:48:58 +0800 Subject: [PATCH 3/3] bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ArkUIAnimatedResponse.test.ets | 17 +++- .../ArkUITabScrollable.test.ets | 17 +++- .../ArkUITabsIconStyleSelectedColor.test.ets | 17 +++- ...ArkUITabsIconStyleUnselectedColor.test.ets | 17 +++- .../ArkUITabsLabelStyleSelectedColor.test.ets | 17 +++- ...rkUITabsLabelStyleUnselectedColor.test.ets | 17 +++- .../ArkUITabsLabelStylefont.test.ets | 17 +++- .../ArkUITabsSingleSelectedcolor.test.ets | 17 +++- .../ArkUITabsSingleUnselectedcolor.test.ets | 17 +++- .../ArkUITabsVertical.test.ets | 17 +++- .../FunctionJichuWaterFlow.test.ets | 17 +++- ...IComponentListAndGridWaterFlowAdd.test.ets | 17 +++- ...ComponentListAndGridWaterSections.test.ets | 17 +++- ...idWaterflowGetItemMainSizeByIndex.test.ets | 16 +++- ...onentListAndGridWaterflowSections.test.ets | 16 +++- ...mponentListAndGridWaterflowSpring.test.ets | 16 +++- ...omponentListAndGridXommonOnscroll.test.ets | 17 +++- ...tandgridWaterflowEventenhancement.test.ets | 22 +++++- .../UIComponentNavModifier.test.ets | 17 +++- .../UIComponentNavTabsAction.test.ets | 17 +++- .../UIComponentNavTabsAnimated.test.ets | 25 ++++-- .../UIComponentNavTabsBlurStyle.test.ets | 17 +++- .../UIComponentNavTabsCachedCount.test.ets | 17 +++- ...onentNavTabsCapabilityEnhancement.test.ets | 17 +++- .../UIComponentNavTabsContentAdapt.test.ets | 17 +++- .../UIComponentNavTabsEdgeeffect.test.ets | 17 +++- .../UIComponentNavTabsExpandsafearea.test.ets | 17 +++- .../UIComponentNavTabsHeight.test.ets | 17 +++- .../UIComponentNavTabsImproTrace.test.ets | 17 +++- .../UIComponentNavTabsInterception.test.ets | 17 +++- .../UIComponentNavTabsInterface.test.ets | 17 +++- .../UIComponentNavTabsLayout.test.ets | 17 +++- .../UIComponentNavTabsMirror.test.ets | 17 +++- .../UIComponentNavTabsNest.test.ets | 17 +++- .../UIComponentNavTabsObserver.test.ets | 17 +++- .../UIComponentNavTabsOnChange.test.ets | 17 +++- .../UIComponentNavTabsOnWillHide.test.ets | 17 +++- .../UIComponentNavTabsOnWillShow.test.ets | 17 +++- .../UIComponentNavTabsSubTabbarStyle.test.ets | 17 +++- .../UIComponentNavTabs.test.ets | 17 +++- .../UIComponentNavTabsUx.test.ets | 17 +++- .../UIComponentNavTabsWidth.test.ets | 17 +++- .../UIComponentOtherRefreshAbility.test.ets | 17 +++- .../UIComponentOtherRefreshAnimation.test.ets | 17 +++- ...IComponentOtherRefreshInterAction.test.ets | 17 +++- ...ponentOtherRefreshInterConnection.test.ets | 17 +++- .../UIComponentOtherRefreshInterface.test.ets | 17 +++- ...mponentOtherRefreshOnOffsetChange.test.ets | 18 ++++- ...UIComponentOtherRefreshPromptText.test.ets | 17 +++- .../UIComponentRefreshPulldownradio.test.ets | 17 +++- .../UIComponentScrollSwiperTeace.test.ets | 70 ++++++++++++++--- .../UIComponentTabTabBarSymbol.test.ets | 17 +++- .../UIComponentTabsClip.test.ets | 17 +++- .../UIComponentUISupportColor.test.ets | 78 +++++++++++++------ .../UIComponentWaterFlowFooter.test.ets | 17 +++- .../UIComponentWaterFlowSliding.test.ets | 17 +++- .../UIRefreshComponentContent.test.ets | 17 +++- ...ndgridWaterflowEventenhancement0300527.ets | 9 ++- ...ponentNavTabsCapabilityEnhancement0080.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0100.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0110.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0120.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0130.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0150.ets | 2 +- ...ponentNavTabsCapabilityEnhancement0160.ets | 2 +- 65 files changed, 959 insertions(+), 158 deletions(-) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets index f8a3a2791..4ee7c5219 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIAnimatedResponseTest/ArkUIAnimatedResponse.test.ets @@ -42,11 +42,24 @@ export default function ArkUIAnimatedResponse() { }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets index bcd507d2b..a8aeeaa53 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -42,11 +42,24 @@ export default function ArkUITabScrollable() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets index cda0ce331..eb2e97fb0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -41,11 +41,24 @@ export default function ArkUITabsIconStyleSelectedColor() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets index c85c75e7e..013457135 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -42,11 +42,24 @@ export default function ArkUITabsIconStyleUnselectedColor() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets index 245ff231a..1be7c86ea 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -42,11 +42,24 @@ export default function ArkUITabsLabelStyleSelectedColor() { }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets index 18dde585e..dfdbad3a4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -41,11 +41,24 @@ export default function ArkUITabsLabelStyleUnselectedColor() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets index 9ec4875ed..3d952c9dc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -41,11 +41,24 @@ export default function ArkUITabsLabelStylefont() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets index cdbf70e42..2fa3d7017 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -43,11 +43,24 @@ export default function ArkUITabsSingleSelectedcolor() { }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets index 7e306a20d..81db8af33 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -42,11 +42,24 @@ export default function ArkUITabsSingleUnselectedcolor() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets index 97affa88b..eaa79205a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -41,11 +41,24 @@ export default function ArkUITabsVertical() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets index 21f5fbddb..48a8d3730 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -41,11 +41,24 @@ export default function FunctionJichuWaterFlow() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets index 7a71cb251..a7fbdaeb6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -41,11 +41,24 @@ export default function UIComponentListAndGridWaterFlowAdd() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets index d536b2d11..3c5a91f6e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -41,11 +41,24 @@ export default function UIComponentListAndGridWaterSections() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets index 7acca6cb6..3981d1409 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowGetItemMainSizeByIndexTest/UIComponentListAndGridWaterflowGetItemMainSizeByIndex.test.ets @@ -42,7 +42,21 @@ export default function UIComponentListAndGridWaterflowGetItemMainSizeByIndex() done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets index 2ec39db4d..13ebaec3e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSectionsTest/UIComponentListAndGridWaterflowSections.test.ets @@ -42,7 +42,21 @@ export default function UIComponentListAndGridWaterflowSections() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets index b2ac6c635..dedef2d47 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterflowSpringTest/UIComponentListAndGridWaterflowSpring.test.ets @@ -42,7 +42,21 @@ export default function UIComponentListAndGridWaterflowSpring() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets index 46ccfb561..b7fa149fe 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridXommonOnscrollTest/UIComponentListAndGridXommonOnscroll.test.ets @@ -42,11 +42,24 @@ export default function UIComponentListAndGridXommonOnscroll() { }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets index 4b1c72d1f..5ff7af48b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridWaterflowEventenhancementTest/UIComponentListandgridWaterflowEventenhancement.test.ets @@ -43,11 +43,24 @@ export default function UIComponentListandgridWaterflowEventenhancement() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) @@ -158,6 +171,7 @@ export default function UIComponentListandgridWaterflowEventenhancement() { Settings.createWindow("testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527"); await Utils.sleep(1000); let driver = Driver.create(); + let button:Component = await driver.findComponent(ON.id('UIComponentListandgridWaterflowEventenhancement0300527_01')); let water = await driver.findComponent(ON.type('WaterFlow')); await Utils.sleep(1000); let point = await water.getBoundsCenter(); @@ -169,9 +183,11 @@ export default function UIComponentListandgridWaterflowEventenhancement() { await driver.fling({ x: point.x, y: point.y - 100 },point, 5, 600); + await Utils.sleep(1000); + await button.click(); await Utils.sleep(3000); await windowSnap.snapShot(); - await Utils.sleep(1000); + await Utils.sleep(2000); Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_EVENTENHANCEMENT_0300_527 finish.`); done() }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets index f70472b83..457a974de 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavModifier() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets index 8db9b0be0..0d283ec82 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsAction() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets index 18a9c79fd..8fec8c2c6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsAnimatedTest/UIComponentNavTabsAnimated.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsAnimated() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) @@ -67,20 +80,20 @@ export default function UIComponentNavTabsAnimated() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012 start.`); Settings.createWindow("testability/pages/UIComponentNavTabsAnimated/UIComponentNavTabsAnimated012") await Utils.sleep(1000) - let driver : Driver = Driver.create(); + /*let driver : Driver = Driver.create(); await driver.delayMs(1000) let button1:Component = await driver.findComponent(ON.id('Yellow')); await Utils.sleep(1000) await button1.click() - await Utils.sleep(2000) + await Utils.sleep(3000) let button2:Component = await driver.findComponent(ON.id('Pink')); await Utils.sleep(1000) await button2.click() - await Utils.sleep(2000) + await Utils.sleep(6000)*/ await windowSnap.snapShot() - await Utils.sleep(2000) + await Utils.sleep(3000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ANIMATED_012 finish.`); done() }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets index 8c9dbdb6a..627859f62 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsBlurStyle() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets index fc6d78123..4fbacc0c5 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsCachedCount() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets index fcdd70d99..f6cd4638e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCapabilityEnhancementTest/UIComponentNavTabsCapabilityEnhancement.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsCapabilityEnhancement() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets index 2d543981f..40af161b7 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsContentAdapt() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets index 756bce6ec..23a48c673 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsEdgeeffect() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets index d478148a8..67bd608ff 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsExpandsafearea() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets index ebfcae44c..128ac5276 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsHeight() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets index 4dd9b020d..4a6254c28 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsImproTrace() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets index b943529d8..81ff322c4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsInterception() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets index d2320df7f..68096b064 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsInterface() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets index 63440a195..c0baa9b98 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsLayoutTest/UIComponentNavTabsLayout.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsLayout() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets index a22b9c2e3..47c6675a6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsMirror() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets index 2d9f96dcd..970dcb899 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsNestTest/UIComponentNavTabsNest.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsNest() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets index 926402383..9dd5fbde9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsObserverTest/UIComponentNavTabsObserver.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsObserver() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets index 20c0ffc81..946a1a2a9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnChangeTest/UIComponentNavTabsOnChange.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsOnChange() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets index 83c6d82ef..dae7238a4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillHideTest/UIComponentNavTabsOnWillHide.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsOnWillHide() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets index db11c6289..c90033651 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsOnWillShow() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets index 2f89da30c..76b05757a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsSubTabbarStyle() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets index 770a41b5f..783229c0e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsTest/UIComponentNavTabs.test.ets @@ -40,11 +40,24 @@ export default function UIComponentNavTabs() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets index 7414289e1..fba2f3081 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsUxTest/UIComponentNavTabsUx.test.ets @@ -41,11 +41,24 @@ export default function UIComponentNavTabsUx() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets index 3dd13e6d2..1062d529c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -40,11 +40,24 @@ export default function UIComponentNavTabsWidth() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets index 7d5da66e3..22eb9dc7e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshAbility() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets index bac58523c..896d21ddb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAnimationTest/UIComponentOtherRefreshAnimation.test.ets @@ -40,11 +40,24 @@ export default function UIComponentOtherRefreshAnimation() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets index 7a74be6fc..3f5a97519 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshInterAction() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets index fc648bba3..de656b962 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterConnectionTest/UIComponentOtherRefreshInterConnection.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshInterConnection() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets index c13729fe3..1741471dc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshInterface() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets index 387f573e8..bd2ab5eec 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshOnOffsetChangeTest/UIComponentOtherRefreshOnOffsetChange.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshOnOffsetChange() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) @@ -57,7 +70,6 @@ export default function UIComponentOtherRefreshOnOffsetChange() { done() }) - it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ONOFFSETCHANGE_0100', 0, async (done: Function) => { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ONOFFSETCHANGE_0100 start.`); Settings.createWindow("testability/pages/UIComponentOtherRefreshOnOffsetChange/UIComponentOtherRefreshOnOffsetChange0100") diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets index cc0ce3a2e..737f82849 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -41,11 +41,24 @@ export default function UIComponentOtherRefreshPromptText() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets index f3918e50b..e4ed436b6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRefreshPulldownradioTest/UIComponentRefreshPulldownradio.test.ets @@ -41,11 +41,24 @@ export default function UIComponentRefreshPulldownradio() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets index 8a157d7fb..b1b80a733 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -17,10 +17,57 @@ import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' -import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' - +import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperTeace() { + describe('UIComponentScrollSwiperTeace', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) + +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_SCROLL_SWIPER_TEACE_0070 */ @@ -55,12 +102,13 @@ export default function UIComponentScrollSwiperTeace() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_Teace_0080 finish.`); done() }) - - it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370', 0, async (done: Function) => { + + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370', 0, async (done: Function) => { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370 start.`); Settings.createWindow("testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0370") - await Utils.sleep(1000) - let driver : Driver = Driver.create(); + await Utils.sleep(2000) + /*let driver : Driver = Driver.create(); await driver.delayMs(1000) let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentScrollSwiperTeace0370')) @@ -77,14 +125,12 @@ export default function UIComponentScrollSwiperTeace() { let button2 :Component = await driver.findComponent(ON.id('UIComponentScrollSwiperTeace0370_002')) await Utils.sleep(1000) button2.click() - await Utils.sleep(1000) + await Utils.sleep(1000)*/ await windowSnap.snapShot() await Utils.sleep(3000) Logger.error('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0370 finish.`); done() }) - - }) } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets index 98acf62a6..1f8dd4546 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -41,11 +41,24 @@ export default function UIComponentTabTabBarSymbol() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets index 31f87a2f9..770cd28e4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabsClipTest/UIComponentTabsClip.test.ets @@ -41,11 +41,24 @@ export default function UIComponentTabsClip() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index a7a4c5a5c..4b202a2eb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -12,34 +12,63 @@ * 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, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' +export default function UIComponentUISupportColor() { -import { describe, afterEach, 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 uiAppearance from '@ohos.uiAppearance'; -import { Component, Driver ,ON } from '@ohos.UiTest' + describe('UIComponentUISupportColor', () => { -/* - * UIComponentUISupportColor - * - * 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)}`) - * */ + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); +}) -export default function UIComponentUISupportColor() { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); - describe('UIComponentUISupportColor', () => { + 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() + }) /* @@ -499,6 +528,5 @@ export default function UIComponentUISupportColor() { Logger.error('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1110 finish.`); done() }) - }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets index d352896fe..e9b3f5a34 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowFooterTest/UIComponentWaterFlowFooter.test.ets @@ -41,11 +41,24 @@ export default function UIComponentWaterFlowFooter() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets index c2b2e1f6b..3dc7e2afd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentWaterFlowSlidingTest/UIComponentWaterFlowSliding.test.ets @@ -41,11 +41,24 @@ export default function UIComponentWaterFlowSliding() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets index 38a327bef..41da24cd2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIRefreshComponentContentTest/UIRefreshComponentContent.test.ets @@ -41,11 +41,24 @@ export default function UIRefreshComponentContent() { done(); }) - afterEach(async (done: Function) => { +afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + if (Settings.windowClass == undefined) { return } - Settings.windowClass.destroyWindow((err) => { if (err.code) { Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets index c320e2c7e..500de62b1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridWaterflowEventenhancement/UIComponentListandgridWaterflowEventenhancement0300527.ets @@ -63,7 +63,13 @@ struct UIComponentListandgridWaterflowEventenhancement0300527 { build() { Column({ space: 2 }) { - WaterFlow() { + Button("滚动到Top") + .id("UIComponentListandgridWaterflowEventenhancement0300527_01") + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + + WaterFlow({ scroller: this.scroller }) { LazyForEach(this.dataSource, (item: number) => { FlowItem() { Column() { @@ -89,6 +95,7 @@ struct UIComponentListandgridWaterflowEventenhancement0300527 { .onScrollStop(() => { this.onScrollStop = 'onScrollStop succ'; }) + Text('onScrollStop:' + this.onScrollStop) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets index 2ec46bae4..b4728765f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0080.ets @@ -91,7 +91,7 @@ struct UIComponentNavTabsCapabilityEnhancement0080 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets index a5a4a00b8..2bf29af9d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0100.ets @@ -91,7 +91,7 @@ struct UIComponentNavTabsCapabilityEnhancement0100 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets index 24da3bcb3..8a27fcd9a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0110.ets @@ -91,7 +91,7 @@ struct UIComponentNavTabsCapabilityEnhancement0110 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets index 9e584b5ef..641a976d7 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0120.ets @@ -91,7 +91,7 @@ struct UIComponentNavTabsCapabilityEnhancement0120 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets index 14d5254af..71d8ed1fe 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0130.ets @@ -93,7 +93,7 @@ struct UIComponentNavTabsCapabilityEnhancement0130 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets index 460c9a64c..dc59f9efb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0150.ets @@ -91,7 +91,7 @@ struct UIComponentNavTabsCapabilityEnhancement0150 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets index fb500e968..3e0f8d573 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCapabilityEnhancement/UIComponentNavTabsCapabilityEnhancement0160.ets @@ -93,7 +93,7 @@ struct UIComponentNavTabsCapabilityEnhancement0160 { .onTabBarClick((index: number) => { }) .backgroundColor(0xF1F3F5); - Text(this.msgInfo); + //Text(this.msgInfo); }.width('100%').height(400) } } -- Gitee